From 7d7ffc1619ed598fc59737318f1b3e57fccee23a Mon Sep 17 00:00:00 2001 From: openeuler-ci-bot <80474298@qq.com> Date: Tue, 27 Oct 2020 22:30:15 +0800 Subject: [PATCH 1/4] [patch tracking] 20201027223007638441 - https://github.com/pypa/pip/commit/5bfd1db071c78c4bdcf2e80cc2142f1557d17d25 --- ...1db071c78c4bdcf2e80cc2142f1557d17d25.patch | 164 ++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 5bfd1db071c78c4bdcf2e80cc2142f1557d17d25.patch diff --git a/5bfd1db071c78c4bdcf2e80cc2142f1557d17d25.patch b/5bfd1db071c78c4bdcf2e80cc2142f1557d17d25.patch new file mode 100644 index 0000000..da6f005 --- /dev/null +++ b/5bfd1db071c78c4bdcf2e80cc2142f1557d17d25.patch @@ -0,0 +1,164 @@ +diff --git a/.azure-pipelines/macos.yml b/.azure-pipelines/macos.yml +deleted file mode 100644 +index 9ad9edae86..0000000000 +--- a/.azure-pipelines/macos.yml ++++ /dev/null +@@ -1,11 +0,0 @@ +-variables: +- CI: true +- +-jobs: +-- template: jobs/test.yml +- parameters: +- vmImage: macos-10.14 +- +-- template: jobs/package.yml +- parameters: +- vmImage: macos-10.14 +diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml +index 0ff16be644..ebe98fec7d 100644 +--- a/.github/workflows/linting.yml ++++ b/.github/workflows/linting.yml +@@ -19,7 +19,6 @@ jobs: + os: + - Ubuntu + - Windows +- - MacOS + + steps: + - uses: actions/checkout@v2 +diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml +new file mode 100644 +index 0000000000..bdf3f671bd +--- /dev/null ++++ b/.github/workflows/macos.yml +@@ -0,0 +1,129 @@ ++name: MacOS ++ ++on: ++ push: ++ branches: ++ - master ++ pull_request: ++ schedule: ++ # Run every Friday at 18:02 UTC ++ - cron: 2 18 * * 5 ++ ++jobs: ++ dev-tools: ++ name: Quality Check ++ runs-on: macos-latest ++ ++ steps: ++ # Caches ++ - name: pip cache ++ uses: actions/cache@v1 ++ with: ++ path: ~/.cache/pip ++ key: ${{ runner.os }}-pip-${{ hashFiles('tools/requirements/tests.txt') }}-${{ hashFiles('tools/requirements/docs.txt') }}-${{ hashFiles('tox.ini') }} ++ restore-keys: | ++ ${{ runner.os }}-pip- ++ ${{ runner.os }}- ++ - name: Set PY (for pre-commit cache) ++ run: echo "::set-env name=PY::$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" ++ - name: pre-commit cache ++ uses: actions/cache@v1 ++ with: ++ path: ~/.cache/pre-commit ++ key: pre-commit|2020-02-14|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} ++ ++ # Setup ++ - uses: actions/checkout@v2 ++ - name: Set up Python 3.8 ++ uses: actions/setup-python@v2 ++ with: ++ python-version: 3.8 ++ ++ - name: Install tox ++ run: python -m pip install tox ++ ++ # Main check ++ - run: python -m tox -e "lint,docs" ++ ++ packaging: ++ name: Packaging ++ runs-on: macos-latest ++ ++ steps: ++ # Caches ++ - name: pip cache ++ uses: actions/cache@v1 ++ with: ++ path: ~/.cache/pip ++ key: ${{ runner.os }}-pip-${{ hashFiles('tools/requirements/tests.txt') }}-${{ hashFiles('tools/requirements/docs.txt') }}-${{ hashFiles('tox.ini') }} ++ restore-keys: | ++ ${{ runner.os }}-pip- ++ ${{ runner.os }}- ++ # Setup ++ - name: Set up git credentials ++ run: | ++ git config --global user.email "pypa-dev@googlegroups.com" ++ git config --global user.name "pip" ++ - uses: actions/checkout@v2 ++ - name: Set up Python 3.8 ++ uses: actions/setup-python@v2 ++ with: ++ python-version: 3.8 ++ - name: Install tox and nox ++ run: python -m pip install tox nox ++ ++ # Main check ++ - name: Check vendored packages ++ run: python -m tox -e "vendoring" ++ ++ - name: Prepare dummy release ++ run: nox -s prepare-release -- 99.9 ++ ++ - name: Generate distributions for the dummy release ++ run: nox -s build-release -- 99.9 ++ ++ tests: ++ name: Tests / ${{ matrix.python }} ++ runs-on: macos-latest ++ ++ needs: dev-tools ++ ++ strategy: ++ fail-fast: false ++ matrix: ++ python: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9] ++ ++ steps: ++ # Caches ++ - name: pip cache ++ uses: actions/cache@v1 ++ with: ++ path: ~/.cache/pip ++ key: ${{ runner.os }}-pip-${{ hashFiles('tools/requirements/tests.txt') }}-${{ hashFiles('tools/requirements/docs.txt') }}-${{ hashFiles('tox.ini') }} ++ restore-keys: | ++ ${{ runner.os }}-pip- ++ ${{ runner.os }}- ++ # Setup ++ - uses: actions/checkout@v2 ++ - uses: actions/setup-python@v2 ++ with: ++ python-version: ${{ matrix.python }} ++ ++ - name: Install tox ++ run: python -m pip install tox 'virtualenv<20' ++ ++ # Main check ++ - name: Run unit tests ++ run: >- ++ python -m tox -e py -- ++ -m unit ++ --verbose ++ --numprocesses auto ++ ++ - name: Run integration tests ++ run: >- ++ python -m tox -e py -- ++ -m integration ++ --verbose ++ --numprocesses auto ++ --durations=5 -- Gitee From 3c52ef21b5981ae3af1f699d721e05057721ffd1 Mon Sep 17 00:00:00 2001 From: openeuler-ci-bot <80474298@qq.com> Date: Tue, 27 Oct 2020 22:30:16 +0800 Subject: [PATCH 2/4] [patch tracking] 20201027223007638441 - https://github.com/pypa/pip/commit/f5ac3434814c910c1e4831c1525cd5f8ec5c245a --- ...3434814c910c1e4831c1525cd5f8ec5c245a.patch | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 f5ac3434814c910c1e4831c1525cd5f8ec5c245a.patch diff --git a/f5ac3434814c910c1e4831c1525cd5f8ec5c245a.patch b/f5ac3434814c910c1e4831c1525cd5f8ec5c245a.patch new file mode 100644 index 0000000..1127f9b --- /dev/null +++ b/f5ac3434814c910c1e4831c1525cd5f8ec5c245a.patch @@ -0,0 +1,47 @@ +diff --git a/src/pip/_internal/resolution/resolvelib/resolver.py b/src/pip/_internal/resolution/resolvelib/resolver.py +index cb7d1ae8a5..52f228bc60 100644 +--- a/src/pip/_internal/resolution/resolvelib/resolver.py ++++ b/src/pip/_internal/resolution/resolvelib/resolver.py +@@ -180,7 +180,10 @@ def get_installation_order(self, req_set): + assert self._result is not None, "must call resolve() first" + + graph = self._result.graph +- weights = get_topological_weights(graph) ++ weights = get_topological_weights( ++ graph, ++ expected_node_count=len(self._result.mapping) + 1, ++ ) + + sorted_items = sorted( + req_set.requirements.items(), +@@ -190,8 +193,8 @@ def get_installation_order(self, req_set): + return [ireq for _, ireq in sorted_items] + + +-def get_topological_weights(graph): +- # type: (Graph) -> Dict[Optional[str], int] ++def get_topological_weights(graph, expected_node_count): ++ # type: (Graph, int) -> Dict[Optional[str], int] + """Assign weights to each node based on how "deep" they are. + + This implementation may change at any point in the future without prior +@@ -231,7 +234,7 @@ def visit(node): + + # Sanity checks + assert weights[None] == 0 +- assert len(weights) == len(graph) ++ assert len(weights) == expected_node_count + + return weights + +diff --git a/tests/unit/resolution_resolvelib/test_resolver.py b/tests/unit/resolution_resolvelib/test_resolver.py +index 0f240ec6ce..4a62cefb60 100644 +--- a/tests/unit/resolution_resolvelib/test_resolver.py ++++ b/tests/unit/resolution_resolvelib/test_resolver.py +@@ -232,5 +232,5 @@ def test_new_resolver_get_installation_order(resolver, edges, ordered_reqs): + def test_new_resolver_topological_weights(name, edges, expected_weights): + graph = _make_graph(edges) + +- weights = get_topological_weights(graph) ++ weights = get_topological_weights(graph, len(expected_weights)) + assert weights == expected_weights -- Gitee From a495cdebbf759343fe3607292f5874e2cb98fcc0 Mon Sep 17 00:00:00 2001 From: openeuler-ci-bot <80474298@qq.com> Date: Tue, 27 Oct 2020 22:30:16 +0800 Subject: [PATCH 3/4] [patch tracking] 20201027223007638441 - https://github.com/pypa/pip/commit/b39aeeb6df2c4f5b6628bbb5d1d7f291bfb4d119 --- ...eeb6df2c4f5b6628bbb5d1d7f291bfb4d119.patch | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 b39aeeb6df2c4f5b6628bbb5d1d7f291bfb4d119.patch diff --git a/b39aeeb6df2c4f5b6628bbb5d1d7f291bfb4d119.patch b/b39aeeb6df2c4f5b6628bbb5d1d7f291bfb4d119.patch new file mode 100644 index 0000000..a992dc9 --- /dev/null +++ b/b39aeeb6df2c4f5b6628bbb5d1d7f291bfb4d119.patch @@ -0,0 +1,50 @@ +diff --git a/news/8996.bugfix.rst b/news/8996.bugfix.rst +new file mode 100644 +index 0000000000..fa3528e7c4 +--- /dev/null ++++ b/news/8996.bugfix.rst +@@ -0,0 +1,3 @@ ++Do not fail in pip freeze when encountering a ``direct_url.json`` metadata file ++with editable=True. Render it as a non-editable ``file://`` URL until modern ++editable installs are standardized and supported. +diff --git a/src/pip/_internal/utils/direct_url_helpers.py b/src/pip/_internal/utils/direct_url_helpers.py +index a355a6c5ee..87bd61fa01 100644 +--- a/src/pip/_internal/utils/direct_url_helpers.py ++++ b/src/pip/_internal/utils/direct_url_helpers.py +@@ -43,10 +43,6 @@ def direct_url_as_pep440_direct_reference(direct_url, name): + fragments.append(direct_url.info.hash) + else: + assert isinstance(direct_url.info, DirInfo) +- # pip should never reach this point for editables, since +- # pip freeze inspects the editable project location to produce +- # the requirement string +- assert not direct_url.info.editable + requirement += direct_url.url + if direct_url.subdirectory: + fragments.append("subdirectory=" + direct_url.subdirectory) +diff --git a/tests/unit/test_direct_url_helpers.py b/tests/unit/test_direct_url_helpers.py +index 55cd5855b9..b0cb50c6eb 100644 +--- a/tests/unit/test_direct_url_helpers.py ++++ b/tests/unit/test_direct_url_helpers.py +@@ -55,6 +55,21 @@ def test_as_pep440_requirement_dir(): + ) + + ++def test_as_pep440_requirement_editable_dir(): ++ # direct_url_as_pep440_direct_reference behaves the same ++ # irrespective of the editable flag. It's the responsibility of ++ # callers to render it as editable ++ direct_url = DirectUrl( ++ url="file:///home/user/project", ++ info=DirInfo(editable=True), ++ ) ++ direct_url.validate() ++ assert ( ++ direct_url_as_pep440_direct_reference(direct_url, "pkg") == ++ "pkg @ file:///home/user/project" ++ ) ++ ++ + def test_as_pep440_requirement_vcs(): + direct_url = DirectUrl( + url="https:///g.c/u/p.git", -- Gitee From 053a347bd7bf973150bb399c9e059976ec045ae2 Mon Sep 17 00:00:00 2001 From: openeuler-ci-bot <80474298@qq.com> Date: Tue, 27 Oct 2020 22:30:16 +0800 Subject: [PATCH 4/4] [patch tracking] 20201027223007638441 - update spec file --- python-pip.spec | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/python-pip.spec b/python-pip.spec index 05f810a..cabca22 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -7,7 +7,7 @@ pip is the package installer for Python. You can use pip to install packages fro %global bashcompdir %(b=$(pkg-config --variable=completionsdir bash-completion 2>/dev/null); echo ${b:-%{_sysconfdir}/bash_completion.d}) Name: python-%{srcname} Version: 20.2.2 -Release: 2 +Release: 3 Summary: A tool for installing and managing Python packages License: MIT and Python and ASL 2.0 and BSD and ISC and LGPLv2 and MPLv2.0 and (ASL 2.0 or BSD) URL: http://www.pip-installer.org @@ -17,6 +17,9 @@ Patch1: allow-stripping-given-prefix-from-wheel-RECORD-files.patch Patch2: emit-a-warning-when-running-with-root-privileges.patch Patch3: remove-existing-dist-only-if-path-conflicts.patch Patch6000: dummy-certifi.patch +Patch6001: 5bfd1db071c78c4bdcf2e80cc2142f1557d17d25.patch +Patch6002: f5ac3434814c910c1e4831c1525cd5f8ec5c245a.patch +Patch6003: b39aeeb6df2c4f5b6628bbb5d1d7f291bfb4d119.patch Source10: pip-allow-older-versions.patch %description %{_description} @@ -140,6 +143,9 @@ install -p dist/%{python_wheelname} -t %{buildroot}%{python_wheeldir} %{python_wheeldir}/%{python_wheelname} %changelog +* 20201027223007638441 patch-tracking 20.2.2-3 +- append patch file of upstream repository from <5bfd1db071c78c4bdcf2e80cc2142f1557d17d25> to + * Tue Sep 1 2020 wenzhanli - 20.2.2-2 - add pip-allow-older-versions.patch @@ -183,4 +189,4 @@ install -p dist/%{python_wheelname} -t %{buildroot}%{python_wheeldir} - DESC: Synchronize a patch * Mon Sep 23 2019 openEuler Buildteam - 18.0-6 -- Package init +- Package init \ No newline at end of file -- Gitee