From beea300af42e39e3202f9112bba1790c223a69748aedbe5d9695e909b204888f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Fri, 13 Jun 2025 12:42:39 +0000 Subject: [PATCH] - Convert to pip-based build and libalternatives OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-virtualenv-clone?expand=0&rev=21 --- .gitattributes | 23 +++++++ .gitignore | 1 + python-virtualenv-clone.changes | 81 +++++++++++++++++++++++++ python-virtualenv-clone.spec | 102 ++++++++++++++++++++++++++++++++ virtualenv-clone-0.5.7.tar.gz | 3 + 5 files changed, 210 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 python-virtualenv-clone.changes create mode 100644 python-virtualenv-clone.spec create mode 100644 virtualenv-clone-0.5.7.tar.gz diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/python-virtualenv-clone.changes b/python-virtualenv-clone.changes new file mode 100644 index 0000000..8dff3af --- /dev/null +++ b/python-virtualenv-clone.changes @@ -0,0 +1,81 @@ +------------------------------------------------------------------- +Fri Jun 13 12:39:59 UTC 2025 - Markéta Machová + +- Convert to pip-based build and libalternatives + +------------------------------------------------------------------- +Wed Oct 12 18:23:26 UTC 2022 - Yogalakshmi Arunachalam + +- Update to version 0.5.7 + * Added tox.ini to source distributions. + +- Update to version 0.5.6 + * Added support for Python 3.10. + +- Update to version 0.5.5 + * Added support for Python 3.9. + +------------------------------------------------------------------- +Thu Apr 16 07:54:58 UTC 2020 - Tomáš Chvátal + +- Update to 0.5.4: + * Added support for Python 3.8. + +------------------------------------------------------------------- +Fri Apr 12 06:28:38 UTC 2019 - Marketa Calabkova + +- update to version 0.5.3 + 0.5.? + * Fixed incorrect Python version value. + * Added support for Python 3.7. + 0.4.0 + * Dropped support for EOL Python versions that no longer + receive any updates from the core CPython team. + 0.3.0 + * Added support for Python 3. + * Fixed a bug with writing unicode in .pth files incorrectly. + * Fixed support for paths involving symbolic links. + +------------------------------------------------------------------- +Tue Dec 4 12:55:50 UTC 2018 - Matej Cepl + +- Remove superfluous devel dependency for noarch package + +------------------------------------------------------------------- +Wed Apr 19 15:38:16 UTC 2017 - toddrme2178@gmail.com + +- Implement single-spec version. + +------------------------------------------------------------------- +Mon Feb 29 12:14:12 UTC 2016 - someuniquename@gmail.com + +- Update to version 2.6 + * Fix symlinks that point to the old virtual env + +------------------------------------------------------------------- +Tue Dec 9 15:41:42 UTC 2014 - toddrme2178@gmail.com + +- Fix update-alternatives as requested. + +------------------------------------------------------------------- +Mon Dec 1 12:34:42 UTC 2014 - toddrme2178@gmail.com + +- Update to 2.5 + * Speed clone_virtualenv up slightly by removing duplicate calls + to spawn process + * Improve windows compatibility + * Ship LICENSE along with the source distribution to pypi. + * Added verbose mode with logging. + * Bugfixes +- Implement update alternatives to allow co-install with python 3 + version. + +------------------------------------------------------------------- +Thu Oct 24 11:16:45 UTC 2013 - speilicke@suse.com + +- Require python-setuptools instead of distribute (upstreams merged) + +------------------------------------------------------------------- +Thu Aug 2 02:53:07 UTC 2012 - alexandre@exatati.com.br + +- Initial package (0.2.4) for openSUSE. diff --git a/python-virtualenv-clone.spec b/python-virtualenv-clone.spec new file mode 100644 index 0000000..dcaa176 --- /dev/null +++ b/python-virtualenv-clone.spec @@ -0,0 +1,102 @@ +# +# spec file for package python-virtualenv-clone +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%bcond_without libalternatives +Name: python-virtualenv-clone +Version: 0.5.7 +Release: 0 +Summary: Script to clone virtualenvs +License: MIT +Group: Development/Languages/Python +URL: https://github.com/edwardgeorge/virtualenv-clone +Source: https://files.pythonhosted.org/packages/source/v/virtualenv-clone/virtualenv-clone-%{version}.tar.gz +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module virtualenv} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: alts +Requires: python-virtualenv +Requires(preun): update-alternatives +BuildArch: noarch +%python_subpackages + +%description +virtualenv cloning script. + +A script for cloning a non-relocatable virtualenv. + +Virtualenv provides a way to make virtualenv's relocatable which could then be +copied as we wanted. However making a virtualenv relocatable this way breaks +the no-site-packages isolation of the virtualenv as well as other aspects that +come with relative paths and '%{_bindir}/env' shebangs that may be undesirable. + +Also, the .pth and .egg-link rewriting doesn't seem to work as intended. This +attempts to overcome these issues and provide a way to easily clone an +existing virtualenv. + +It performs the following: + +- copies sys.argv[1] dir to sys.argv[2] +- updates the hardcoded VIRTUAL_ENV variable in the activate script to the + new repo location. (--relocatable doesn't touch this) +- updates the shebangs of the various scripts in bin to the new python if + they pointed to the old python. (version numbering is retained.) + + it can also change '%{_bindir}/env python' shebangs to be absolute too, + though this functionality is not exposed at present. + +- checks sys.path of the cloned virtualenv and if any of the paths are from + the old environment it finds any .pth or .egg-link files within sys.path + located in the new environment and makes sure any absolute paths to the + old environment are updated to the new environment. + +- finally it double checks sys.path again and will fail if there are still + paths from the old environment present. + +%prep +%setup -q -n virtualenv-clone-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +# setup up update-alternatives +%python_clone -a %{buildroot}%{_bindir}/virtualenv-clone + +%check +# The tests are not shipped and there are no tags in git repo :/ +#%%pytest + +%preun +%python_libalternatives_reset_alternative virtualenv-clone + +%files %{python_files} +%license LICENSE +%doc README.md +%python_alternative %{_bindir}/virtualenv-clone +%{python_sitelib}/clonevirtualenv.py +%pycache_only %{python_sitelib}/__pycache__/clonevirtualenv* +%{python_sitelib}/virtualenv[-_]clone-%{version}*-info + +%changelog diff --git a/virtualenv-clone-0.5.7.tar.gz b/virtualenv-clone-0.5.7.tar.gz new file mode 100644 index 0000000..168124c --- /dev/null +++ b/virtualenv-clone-0.5.7.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:418ee935c36152f8f153c79824bb93eaf6f0f7984bae31d3f48f350b9183501a +size 6454