diff --git a/Isolate-spawned-processes-by-unsetting-PYTHONPATH.patch b/Isolate-spawned-processes-by-unsetting-PYTHONPATH.patch new file mode 100644 index 0000000000000000000000000000000000000000..8f92e3778c2e8292710578079a9dbbcb6a84ec78 --- /dev/null +++ b/Isolate-spawned-processes-by-unsetting-PYTHONPATH.patch @@ -0,0 +1,43 @@ +From 395edd9c8f055005922b8e66a21ba9f0d2a7c2fd Mon Sep 17 00:00:00 2001 +From: Karolina Surma +Date: Thu, 24 Feb 2022 09:38:54 +0100 +Subject: [PATCH] Isolate spawned processes by unsetting PYTHONPATH + +--- + setuptools/tests/environment.py | 5 +++++ + setuptools/tests/fixtures.py | 3 ++- + 2 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/setuptools/tests/environment.py b/setuptools/tests/environment.py +index a0c0ec6..b0eac3a 100644 +--- a/setuptools/tests/environment.py ++++ b/setuptools/tests/environment.py +@@ -18,6 +18,11 @@ class VirtualEnv(jaraco.envs.VirtualEnv): + def run(self, cmd, *args, **kwargs): + cmd = [self.exe(cmd[0])] + cmd[1:] + kwargs = {"cwd": self.root, **kwargs} # Allow overriding ++ if "env" not in kwargs: ++ env = dict(os.environ) ++ if "PYTHONPATH" in env: ++ del env["PYTHONPATH"] ++ kwargs["env"] = env + return subprocess.check_output(cmd, *args, **kwargs) + + +diff --git a/setuptools/tests/fixtures.py b/setuptools/tests/fixtures.py +index 7599e65..d61ffa4 100644 +--- a/setuptools/tests/fixtures.py ++++ b/setuptools/tests/fixtures.py +@@ -98,7 +98,8 @@ def venv(tmp_path, setuptools_wheel): + env = environment.VirtualEnv() + env.root = path.Path(tmp_path / 'venv') + env.req = str(setuptools_wheel) +- return env.create() ++ with contexts.environment(PYTHONPATH=None): ++ return env.create() + + + @pytest.fixture +-- +2.35.1 + diff --git a/Point-to-a-custom-pre-built-distribution-of-setuptools.patch b/Point-to-a-custom-pre-built-distribution-of-setuptools.patch new file mode 100644 index 0000000000000000000000000000000000000000..ba2dabcbf5924b308f169dd08bc4b7848af15942 --- /dev/null +++ b/Point-to-a-custom-pre-built-distribution-of-setuptools.patch @@ -0,0 +1,45 @@ +From d00beeefc6172036ecc17ad7945e80852d5210a5 Mon Sep 17 00:00:00 2001 +From: Karolina Surma +Date: Wed, 2 Mar 2022 11:42:41 +0100 +Subject: [PATCH] Point to a custom pre-built distribution of setuptools + +--- + setuptools/tests/fixtures.py | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/setuptools/tests/fixtures.py b/setuptools/tests/fixtures.py +index d61ffa4..cc2d4d8 100644 +--- a/setuptools/tests/fixtures.py ++++ b/setuptools/tests/fixtures.py +@@ -1,7 +1,10 @@ + import contextlib ++import os + import sys + import subprocess + ++from pathlib import Path ++ + import pytest + import path + +@@ -64,6 +67,8 @@ def sample_project(tmp_path): + + @pytest.fixture(scope="session") + def setuptools_sdist(tmp_path_factory, request): ++ if os.getenv("PRE_BUILT_SETUPTOOLS_SDIST"): ++ return Path(os.getenv("PRE_BUILT_SETUPTOOLS_SDIST")).resolve() + with contexts.session_locked_tmp_dir( + request, tmp_path_factory, "sdist_build") as tmp: + dist = next(tmp.glob("*.tar.gz"), None) +@@ -79,6 +84,8 @@ def setuptools_sdist(tmp_path_factory, request): + + @pytest.fixture(scope="session") + def setuptools_wheel(tmp_path_factory, request): ++ if os.getenv("PRE_BUILT_SETUPTOOLS_WHEEL"): ++ return Path(os.getenv("PRE_BUILT_SETUPTOOLS_WHEEL")).resolve() + with contexts.session_locked_tmp_dir( + request, tmp_path_factory, "wheel_build") as tmp: + dist = next(tmp.glob("*.whl"), None) +-- +2.35.1 + diff --git a/README.md b/README.md deleted file mode 100644 index 7342728d557c602f51c6d278bba9f3dd9faaf356..0000000000000000000000000000000000000000 --- a/README.md +++ /dev/null @@ -1,11 +0,0 @@ -Anolis OS -======================================= -# 代码仓库说明 -## 分支说明 ->进行代码开发工作时,请注意选择当前版本对应的分支 -* aX分支为对应大版本的主分支,如a8分支对应当前最新版本 -* aX.Y分支为对应小版本的维护分支,如a8.2分支对应8.2版本 -## 开发流程 -1. 首先fork目标分支到自己的namespace -2. 在自己的fork分支上做出修改 -3. 向对应的仓库中提交merge request,源分支为fork分支 diff --git a/Remove-optional-or-unpackaged-test-deps.patch b/Remove-optional-or-unpackaged-test-deps.patch new file mode 100644 index 0000000000000000000000000000000000000000..df738ca18633d036d1879101f6108db5108481c7 --- /dev/null +++ b/Remove-optional-or-unpackaged-test-deps.patch @@ -0,0 +1,46 @@ +From bc29357f2effabd91c47562d332f0ae731ffcee0 Mon Sep 17 00:00:00 2001 +From: Karolina Surma +Date: Mon, 21 Feb 2022 09:22:42 +0100 +Subject: [PATCH] Update + +--- + setup.cfg | 14 -------------- + 1 file changed, 14 deletions(-) + +diff --git a/setup.cfg b/setup.cfg +index 4a4a9a2..ce587f6 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -38,19 +38,8 @@ exclude = + [options.extras_require] + testing = + pytest >= 6 +- pytest-checkdocs >= 2.4 +- pytest-flake8 +- pytest-black >= 0.3.7; \ +- python_implementation != "PyPy" +- pytest-cov; \ +- python_implementation != "PyPy" +- pytest-mypy >= 0.9.1; \ +- python_implementation != "PyPy" +- pytest-enabler >= 1.0.1 +- pytest-perf + + mock +- flake8-2020 + virtualenv>=13.0.0 + wheel + pip>=19.1 # For proper file:// URLs support. +@@ -58,9 +47,6 @@ testing = + pytest-xdist + sphinx>=4.3.2 + jaraco.path>=3.2.0 +- build[virtualenv] +- filelock>=3.4.0 +- pip_run>=8.8 + testing-integration = + pytest + pytest-xdist +-- +2.35.1 + diff --git a/python-setuptools.spec b/python-setuptools.spec new file mode 100644 index 0000000000000000000000000000000000000000..86c2600e21a43a29b62ef4ffa469c11bfd260686 --- /dev/null +++ b/python-setuptools.spec @@ -0,0 +1,133 @@ +%bcond_with tests + +%global srcname setuptools +%global python_wheel_name %{srcname}-%{version}-py3-none-any.whl + +Name: python-setuptools +Version: 60.9.3 +Release: 1%{?dist} +Summary: Easily build and distribute Python packages + +License: MIT and ASL 2.0 and (BSD or ASL 2.0) and Python +URL: https://pypi.python.org/pypi/%{srcname} +Source0: https://files.pythonhosted.org/packages/14/74/54890935244ce053abcc4fa01ef4982a84743a8d128d4cf5eae56e2d156c/%{srcname}-%{version}.tar.gz + +Patch0: Remove-optional-or-unpackaged-test-deps.patch +Patch1: Isolate-spawned-processes-by-unsetting-PYTHONPATH.patch +Patch2: Point-to-a-custom-pre-built-distribution-of-setuptools.patch + +BuildArch: noarch +BuildRequires: python3-devel +BuildRequires: pyproject-rpm-macros >= 0-44 +BuildRequires: python%{python3_pkgversion}-setuptools +BuildRequires: python3-rpm-generators >= 11-8 +%if %{with tests} +BuildRequires: gcc +BuildRequires: python%{python3_pkgversion}-pytest +%endif + +%description +Setuptools is a collection of enhancements to the Python distutils that allow +you to more easily build and distribute Python packages, especially ones that +have dependencies on other packages. + +This package also contains the runtime components of setuptools, necessary to +execute the software that requires pkg_resources. + + +%global bundled %{expand: +Provides: bundled(python%{python3_pkgversion}dist(appdirs)) = 1.4.3 +Provides: bundled(python%{python3_pkgversion}dist(importlib-metadata)) = 4.11.1 +Provides: bundled(python%{python3_pkgversion}dist(importlib-resources)) = 5.4 +Provides: bundled(python%{python3_pkgversion}dist(jaraco-text)) = 3.7 +Provides: bundled(python%{python3_pkgversion}dist(more-itertools)) = 8.8 +Provides: bundled(python%{python3_pkgversion}dist(ordered-set)) = 3.1.1 +Provides: bundled(python%{python3_pkgversion}dist(packaging)) = 21.3 +Provides: bundled(python%{python3_pkgversion}dist(pyparsing)) = 2.2.1 +Provides: bundled(python%{python3_pkgversion}dist(typing-extensions)) = 4.0.1 +Provides: bundled(python%{python3_pkgversion}dist(zipp)) = 3.7 +} + +%package -n python%{python3_pkgversion}-setuptools +Summary: Easily build and distribute Python 3 packages +%{bundled} + +%py_provides python%{python3_pkgversion}-pkg_resources +%py_provides python%{python3_pkgversion}-pkg-resources + +%description -n python%{python3_pkgversion}-setuptools +Setuptools is a collection of enhancements to the Python 3 distutils that allow +you to more easily build and distribute Python 3 packages, especially ones that +have dependencies on other packages. + +This package also contains the runtime components of setuptools, necessary to +execute the software that requires pkg_resources. + +%package -n %{python_wheel_pkg_prefix}-%{srcname}-wheel +Summary: The setuptools wheel +%{bundled} + +%description -n %{python_wheel_pkg_prefix}-%{srcname}-wheel +A Python wheel of setuptools to use with venv. + + +%prep +%autosetup -p1 -n %{srcname}-%{version} +rm -r %{srcname}.egg-info + +find setuptools pkg_resources -name \*.py | xargs sed -i -e '1 {/^#!\//d}' +rm -f setuptools/*.exe +rm -r docs/conf.py + +%generate_buildrequires +%pyproject_buildrequires -r %{?with_tests:-x testing} + +%build +%pyproject_wheel + + +%install +%pyproject_install +%pyproject_save_files setuptools pkg_resources _distutils_hack + +rm -rf %{buildroot}%{python3_sitelib}/pkg_resources/tests/ +sed -i '/\/pkg_resources\/tests\b/d' %{pyproject_files} + +mkdir -p %{buildroot}%{python_wheel_dir} +install -p %{_pyproject_wheeldir}/%{python_wheel_name} -t %{buildroot}%{python_wheel_dir} + +%if %{with tests} +%check +cat pkg_resources/_vendor/vendored.txt setuptools/_vendor/vendored.txt > allvendor.txt +%{_rpmconfigdir}/pythonbundles.py allvendor.txt --namespace 'python%{python3_pkgversion}dist' --compare-with '%{bundled}' + +test $(du %{_pyproject_wheeldir}/%{python_wheel_name} | cut -f1) -lt 800 + +test ! -d %{buildroot}%{python3_sitelib}/pkg_resources/tests +test ! -d %{buildroot}%{python3_sitelib}/setuptools/tests + +rm pyproject.toml + +PRE_BUILT_SETUPTOOLS_WHEEL=%{_pyproject_wheeldir}/%{python_wheel_name} \ +PYTHONPATH=$(pwd) %pytest \ + --ignore=setuptools/tests/test_integration.py \ + --ignore=setuptools/tests/integration/ \ + --ignore=setuptools/tests/test_develop.py \ + -k "not test_pip_upgrade_from_source" +%endif # with tests + +%files -n python%{python3_pkgversion}-setuptools %{?!with_bootstrap:-f %{pyproject_files}} +%license LICENSE +%doc docs/* CHANGES.rst README.rst +%{python3_sitelib}/distutils-precedence.pth + +%files -n %{python_wheel_pkg_prefix}-%{srcname}-wheel +%license LICENSE +# we own the dir for simplicity +%dir %{python_wheel_dir}/ +%{python_wheel_dir}/%{python_wheel_name} + + +%changelog +* Wed Mar 16 2022 forrest_ly - 60.9.3-1 +- Init for Anolis OS 23 diff --git a/setuptools-60.9.3.tar.gz b/setuptools-60.9.3.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..2d98ba9b4fafa2d1f5922cb8fcebb4b950048810 Binary files /dev/null and b/setuptools-60.9.3.tar.gz differ