From ed619ba85059cb270060bfef71866e326bd7cdce Mon Sep 17 00:00:00 2001 From: Albert Tugushev Date: Thu, 15 Oct 2020 08:37:23 +0700 Subject: [PATCH 1/7] Add pip==20.3 support --- piptools/repositories/pypi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/piptools/repositories/pypi.py b/piptools/repositories/pypi.py index 261ffcd3f..0a2cea10d 100644 --- a/piptools/repositories/pypi.py +++ b/piptools/repositories/pypi.py @@ -186,7 +186,10 @@ def resolve_reqs(self, download_dir, ireq, wheel_cache): if not ireq.prepared: # If still not prepared, e.g. a constraint, do enough to assign # the ireq a name: - resolver._get_abstract_dist_for(ireq) + if PIP_VERSION[:2] <= (20, 2): + resolver._get_abstract_dist_for(ireq) + else: + resolver._get_dist_for(ireq) return set(results) From 5864e2bdebd79bdfaff9929c0965622f3b0686ae Mon Sep 17 00:00:00 2001 From: Albert Tugushev Date: Thu, 15 Oct 2020 09:12:53 +0700 Subject: [PATCH 2/7] Update latest support pip version in README --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 314eeaf2c..c5277fdd9 100644 --- a/README.rst +++ b/README.rst @@ -464,5 +464,5 @@ versions. +---------------+-----------------+ | 5.0.0 - 5.3.0 | 20.0 - 20.1.1 | +---------------+-----------------+ -| >= 5.4.0 | 20.1 - 20.2.* | +| >= 5.4.0 | 20.1 - 20.3.* | +---------------+-----------------+ From d928b2fe73ff74cf11a357b3ec6e634a5d03005a Mon Sep 17 00:00:00 2001 From: Albert Tugushev Date: Thu, 15 Oct 2020 09:20:04 +0700 Subject: [PATCH 3/7] Bump latest and previous supported versions --- .appveyor.yml | 20 ++++++++++---------- .github/workflows/ci.yml | 2 +- .travis.yml | 2 +- tox.ini | 11 ++++++++++- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 220bcea89..be0a13fda 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -3,28 +3,28 @@ environment: PYTHON: "C:\\Python36" matrix: - - TOXENV: py27-pip20.1-coverage - PIP: 20.1 + - TOXENV: py27-pipprevious-coverage + PIP: previous - TOXENV: py27-piplatest-coverage PIP: latest - - TOXENV: py35-pip20.1 - PIP: 20.1 + - TOXENV: py35-pipprevious + PIP: previous - TOXENV: py35-piplatest PIP: latest - - TOXENV: py36-pip20.1 - PIP: 20.1 + - TOXENV: py36-pipprevious + PIP: previous - TOXENV: py36-piplatest PIP: latest - - TOXENV: py37-pip20.1 - PIP: 20.1 + - TOXENV: py37-pipprevious + PIP: previous - TOXENV: py37-piplatest PIP: latest - - TOXENV: py38-pip20.1-coverage - PIP: 20.1 + - TOXENV: py38-pipprevious-coverage + PIP: previous - TOXENV: py38-piplatest-coverage PIP: latest diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 468375c63..f6da09b60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: - 3.7 pip-version: - "latest" - - "20.1" + - "previous" include: - os: Ubuntu python-version: 3.9-dev diff --git a/.travis.yml b/.travis.yml index 44ab4a13d..747e259b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ python: env: # NOTE: keep this in sync with envlist in tox.ini for tox-travis. - PIP=latest - - PIP=20.1 + - PIP=previous cache: false install: diff --git a/tox.ini b/tox.ini index da3c82742..8dde0a1c5 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = # NOTE: keep this in sync with the env list in .travis.yml for tox-travis. - py{27,35,36,37,38,39,py,py3}-pip{20.1,20.2,latest,master}-coverage + py{27,35,36,37,38,39,py,py3}-pip{20.1,20.2,20.3,previous,latest,master}-coverage checkqa readme skip_missing_interpreters = True @@ -11,14 +11,21 @@ extras = testing coverage: coverage deps = + pipprevious: pip==20.2.* + # TODO: change to `pip` after pip-20.3 being released + piplatest: -e git+https://github.com/pypa/pip.git@master#egg=pip pipmaster: -e git+https://github.com/pypa/pip.git@master#egg=pip pip20.1: pip==20.1.* pip20.2: pip==20.2.* + # TODO: change to `pip==20.3.*` after pip-20.3 being released + pip20.3: -e git+https://github.com/pypa/pip.git@master#egg=pip setenv = + pipprevious: PIP=previous piplatest: PIP=latest pipmaster: PIP=master pip20.1: PIP==20.1 pip20.2: PIP==20.2 + pip20.3: PIP==20.3 coverage: PYTEST_ADDOPTS=--strict --doctest-modules --cov --cov-report=term-missing --cov-report=xml {env:PYTEST_ADDOPTS:} commands_pre = @@ -44,5 +51,7 @@ commands = twine check {distdir}/* PIP = 20.1: pip20.1 20.2: pip20.2 + 20.3: pip20.3 + previous: pipprevious latest: piplatest master: pipmaster From bb2cea786fd0f008d465f3ece9fb23e82a762a9f Mon Sep 17 00:00:00 2001 From: Andy Kluger Date: Wed, 28 Oct 2020 23:49:04 -0400 Subject: [PATCH 4/7] don't use wheel_download_dir if pip is >=20.3 See https://github.com/pypa/pip/commit/6887b0795b3567ac2a85578e5509dd8cfcc2b284 --- piptools/repositories/pypi.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/piptools/repositories/pypi.py b/piptools/repositories/pypi.py index 0a2cea10d..3c273e512 100644 --- a/piptools/repositories/pypi.py +++ b/piptools/repositories/pypi.py @@ -85,7 +85,8 @@ def __init__(self, pip_args, cache_dir): self.freshen_build_caches() self._cache_dir = normalize_path(cache_dir) self._download_dir = fs_str(os.path.join(self._cache_dir, "pkgs")) - self._wheel_download_dir = fs_str(os.path.join(self._cache_dir, "wheels")) + if PIP_VERSION[:2] <= (20, 2): + self._wheel_download_dir = fs_str(os.path.join(self._cache_dir, "wheels")) self._setup_logging() @@ -107,7 +108,8 @@ def source_dir(self): def clear_caches(self): rmtree(self._download_dir, ignore_errors=True) - rmtree(self._wheel_download_dir, ignore_errors=True) + if PIP_VERSION[:2] <= (20, 2): + rmtree(self._wheel_download_dir, ignore_errors=True) def find_all_candidates(self, req_name): if req_name not in self._available_candidates_cache: @@ -153,7 +155,7 @@ def resolve_reqs(self, download_dir, ireq, wheel_cache): with get_requirement_tracker() as req_tracker, TempDirectory( kind="resolver" ) as temp_dir, indent_log(): - preparer = self.command.make_requirement_preparer( + preparer_kwargs = dict( temp_build_dir=temp_dir, options=self.options, req_tracker=req_tracker, @@ -161,8 +163,10 @@ def resolve_reqs(self, download_dir, ireq, wheel_cache): finder=self.finder, use_user_site=False, download_dir=download_dir, - wheel_download_dir=self._wheel_download_dir, ) + if PIP_VERSION[:2] <= (20, 2): + preparer_kwargs["wheel_download_dir"] = self._wheel_download_dir + preparer = self.command.make_requirement_preparer(**preparer_kwargs) reqset = RequirementSet() if PIP_VERSION[:2] <= (20, 1): @@ -222,7 +226,9 @@ def get_dependencies(self, ireq): download_dir = self._get_download_path(ireq) if not os.path.isdir(download_dir): os.makedirs(download_dir) - if not os.path.isdir(self._wheel_download_dir): + if PIP_VERSION[:2] <= (20, 2) and not os.path.isdir( + self._wheel_download_dir + ): os.makedirs(self._wheel_download_dir) with global_tempdir_manager(): From a1e34a79d61679b287cff686807938da5160c2e8 Mon Sep 17 00:00:00 2001 From: Albert Tugushev Date: Thu, 19 Nov 2020 23:28:52 +0700 Subject: [PATCH 5/7] Use legacy resolver --- piptools/repositories/pypi.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/piptools/repositories/pypi.py b/piptools/repositories/pypi.py index 3c273e512..e1c4e913c 100644 --- a/piptools/repositories/pypi.py +++ b/piptools/repositories/pypi.py @@ -58,7 +58,12 @@ def __init__(self, pip_args, cache_dir): # General options (find_links, index_url, extra_index_url, trusted_host, # and pre) are deferred to pip. self.command = create_command("install") - self.options, _ = self.command.parse_args(pip_args) + extra_pip_args = ( + [] + if PIP_VERSION[:2] <= (20, 2) + else ["--use-deprecated", "legacy-resolver"] + ) + self.options, _ = self.command.parse_args(pip_args + extra_pip_args) if self.options.cache_dir: self.options.cache_dir = normalize_path(self.options.cache_dir) From 6bfd08fcdf27d4febeb6cda09fff108f42769500 Mon Sep 17 00:00:00 2001 From: Albert Tugushev Date: Thu, 19 Nov 2020 23:41:24 +0700 Subject: [PATCH 6/7] Temporarily disable deadsnakes --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6da09b60..a59553442 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,10 +29,11 @@ jobs: pip-version: - "latest" - "previous" - include: - - os: Ubuntu - python-version: 3.9-dev - pip-version: latest +# FIXME temporarily disabled, see https://github.com/jazzband/pip-tools/pull/1216/checks?check_run_id=1425393700 +# include: +# - os: Ubuntu +# python-version: 3.9-dev +# pip-version: latest env: PY_COLORS: 1 From 88b4ff2566d48838d9b9c310e133072c75047b71 Mon Sep 17 00:00:00 2001 From: Albert Tugushev Date: Fri, 20 Nov 2020 01:29:11 +0700 Subject: [PATCH 7/7] Upgrade deadsnakes action See https://github.com/deadsnakes/issues/issues/135 --- .github/workflows/ci.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a59553442..e7bf5ad4d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,11 +29,10 @@ jobs: pip-version: - "latest" - "previous" -# FIXME temporarily disabled, see https://github.com/jazzband/pip-tools/pull/1216/checks?check_run_id=1425393700 -# include: -# - os: Ubuntu -# python-version: 3.9-dev -# pip-version: latest + include: + - os: Ubuntu + python-version: 3.9-dev + pip-version: latest env: PY_COLORS: 1 @@ -48,7 +47,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }} from deadsnakes if: endsWith(matrix.python-version, '-dev') - uses: deadsnakes/action@v1.0.0 + uses: deadsnakes/action@v2.0.1 with: python-version: ${{ matrix.python-version }} - name: Log python version info (${{ matrix.python-version }})