From 25cdaae8a620dd67b886745dd834c29c2b65f38a Mon Sep 17 00:00:00 2001 From: Jon Banafato Date: Tue, 20 Dec 2016 14:56:33 -0500 Subject: [PATCH 01/27] Fix the usage of ireq keys for comparison purposes Per [PEP 426](https://www.python.org/dev/peps/pep-0426/): > All comparisons of distribution names MUST be case insensitive, and > MUST consider hyphens and underscores to be equivalent. Without this normalization, dependencies can become unintentionally upgraded if the existing pinned `requirements.txt` contains a package specified in a different style from another packages `setup.py`. Example of the current behavior without this change: `requirements.in` aiohttp==1.0.1 `requirements.txt` (before running `pip-compile`) # # This file is autogenerated by pip-compile # To update, run: # # pip-compile --output-file requirements.txt requirements.in # aiohttp==1.0.1 async-timeout==1.0.0 # via aiohttp chardet==2.3.0 # via aiohttp multidict==2.1.4 # via aiohttp `requirements.txt` (after running `pip-compile`) # # This file is autogenerated by pip-compile # To update, run: # # pip-compile --output-file requirements.txt requirements.in # aiohttp==1.0.1 async-timeout==1.1.0 # via aiohttp chardet==2.3.0 # via aiohttp multidict==2.1.4 # via aiohttp Desired behavior: `async-timeout` is pinned here and should not be automatically upgraded, as `aiohttp` does not place a minimum version requirement on `async-timeout` in the `1.0.1` release (https://github.com/KeepSafe/aiohttp/blob/v1.0.1/setup.py#L57). --- piptools/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/piptools/utils.py b/piptools/utils.py index fb7587bdf..34ca4f730 100644 --- a/piptools/utils.py +++ b/piptools/utils.py @@ -35,10 +35,12 @@ def key_from_req(req): """Get an all-lowercase version of the requirement's name.""" if hasattr(req, 'key'): # pip 8.1.1 or below, using pkg_resources - return req.key + key = req.key else: # pip 8.1.2 or above, using packaging - return req.name.lower() + key = req.name.lower() + key = key.replace('_', '-') + return key def name_from_req(req): From b52b31b853a911dc6f14062061392da5e5f856d9 Mon Sep 17 00:00:00 2001 From: Bas van den Heuvel Date: Fri, 3 Feb 2017 15:15:50 +0100 Subject: [PATCH 02/27] Remove code that is never executed The code removed is within an if-statement that only returns True when no upgrades are selected. This means that upgrade_pgks_by_key is always empty here. --- piptools/scripts/compile.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/piptools/scripts/compile.py b/piptools/scripts/compile.py index a10a6bb95..24d6c5a86 100755 --- a/piptools/scripts/compile.py +++ b/piptools/scripts/compile.py @@ -129,8 +129,6 @@ def cli(verbose, dry_run, pre, rebuild, find_links, index_url, extra_index_url, # over the stuff in the requirements files upgrade_packages = [InstallRequirement.from_line(pkg) for pkg in upgrade_packages] - upgrade_pkgs_by_key = {key_from_req(ireq.req): ireq - for ireq in upgrade_packages} # Proxy with a LocalRequirementsRepository if --upgrade is not specified # (= default invocation) @@ -140,12 +138,6 @@ def cli(verbose, dry_run, pre, rebuild, find_links, index_url, extra_index_url, for ireq in ireqs: key = key_from_req(ireq.req) - # Packages explicitly listed on the command line should not remain - # pinned by whatever is in the dst_file (the command line argument - # overwrites the current pins) - if key in upgrade_pkgs_by_key: - ireq = upgrade_pkgs_by_key[key] - if is_pinned_requirement(ireq): existing_pins[key] = ireq repository = LocalRequirementsRepository(existing_pins, repository) From 4b1268c0a4fd47d8cf7acf557eaba2c3145ec8d8 Mon Sep 17 00:00:00 2001 From: Bas van den Heuvel Date: Thu, 9 Feb 2017 09:03:08 +0100 Subject: [PATCH 03/27] Always output lowercase to requirements file --- piptools/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/piptools/utils.py b/piptools/utils.py index fb7587bdf..0fa8e309b 100644 --- a/piptools/utils.py +++ b/piptools/utils.py @@ -73,9 +73,9 @@ def format_requirement(ireq, include_specifier=True): if ireq.editable: line = '-e {}'.format(ireq.link) elif include_specifier: - line = str(ireq.req) + line = str(ireq.req).lower() else: - line = name_from_req(ireq.req) + line = name_from_req(ireq.req).lower() return line From fb30121c9142ce19bcee4a0d3f03116844c94133 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Fri, 17 Feb 2017 09:36:22 +0100 Subject: [PATCH 04/27] Prep for the move to Jazzband --- CONTRIBUTING.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..c3fec94d9 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,5 @@ +[![Jazzband](https://jazzband.co/static/img/jazzband.svg)](https://jazzband.co/) + +This is a [Jazzband](https://jazzband.co/) project. By contributing you agree +to abide by the [Contributor Code of Conduct](https://jazzband.co/about/conduct) +and follow the [guidelines](https://jazzband.co/about/guidelines). From 04e22bb3370ffdd8964f264a4c1854bf0a7eefbd Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Fri, 17 Feb 2017 09:44:49 +0100 Subject: [PATCH 05/27] Fix all links in the docs --- README.md | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2736ce4cf..c21399403 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build status](https://secure.travis-ci.org/nvie/pip-tools.png?branch=master)](https://secure.travis-ci.org/nvie/pip-tools) +[![Build status](https://secure.travis-ci.org/jazzband/pip-tools.png?branch=master)](https://secure.travis-ci.org/jazzband/pip-tools) pip-tools = pip-compile + pip-sync ================================== diff --git a/setup.py b/setup.py index 1212a1204..2cca3a7e9 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name='pip-tools', version='1.8.1dev0', - url='https://github.com/nvie/pip-tools/', + url='https://github.com/jazzband/pip-tools/', license='BSD', author='Vincent Driessen', author_email='me@nvie.com', From 409059e4359145a42b77a13f9d2f117b65928900 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Fri, 17 Feb 2017 09:46:17 +0100 Subject: [PATCH 06/27] Add the Jazzband badge to the README file --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c21399403..bb6e18c72 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ [![Build status](https://secure.travis-ci.org/jazzband/pip-tools.png?branch=master)](https://secure.travis-ci.org/jazzband/pip-tools) +[![Jazzband](https://jazzband.co/static/img/badge.svg)](https://jazzband.co/) + pip-tools = pip-compile + pip-sync ================================== From 747f0437b3da8ae6820dba540d93455b54ab9e9c Mon Sep 17 00:00:00 2001 From: David Genest Date: Mon, 20 Feb 2017 09:11:18 -0500 Subject: [PATCH 07/27] Added environment specification in issue template --- .github/ISSUE_TEMPLATE.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 366038c58..13704c6ea 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,5 +1,12 @@ Describe the issue briefly here. +##### Environment Versions + +1. OS Type +1. Python version: `$ python -V` +1. pip version: `$ pip --version` +1. pip-tools version: `$ pip-compile --version` + ##### Steps to replicate 1. ... From a0f01d810daf4b97f008e2d49913f84803107900 Mon Sep 17 00:00:00 2001 From: David Genest Date: Mon, 20 Feb 2017 09:24:20 -0500 Subject: [PATCH 08/27] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 390b0995d..7c70748bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # 1.8.1 - Recalculate secondary dependencies between rounds (#378) +- Calculated dependencies could be left with wrong candidates when + toplevel requirements happen to be also pinned in sub-dependencies (#450) # 1.8.0 From 1be48c9c7b29f0fe812734f9cbd5185ba246d8f7 Mon Sep 17 00:00:00 2001 From: David Genest Date: Mon, 20 Feb 2017 10:39:12 -0500 Subject: [PATCH 09/27] Added pep 503 compliance to package normalizing --- piptools/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/piptools/utils.py b/piptools/utils.py index 34ca4f730..6c6752509 100644 --- a/piptools/utils.py +++ b/piptools/utils.py @@ -4,6 +4,7 @@ import sys from itertools import chain, groupby +import re import pip from pip.req import InstallRequirement @@ -38,8 +39,9 @@ def key_from_req(req): key = req.key else: # pip 8.1.2 or above, using packaging - key = req.name.lower() - key = key.replace('_', '-') + key = req.name + # https://www.python.org/dev/peps/pep-0503/#normalized-names + key = re.sub(r'[-_.]+', '-', key).lower() return key From 7cdb33ad0a583441a301ba6d0dee3b6f114a6cb5 Mon Sep 17 00:00:00 2001 From: David Genest Date: Mon, 20 Feb 2017 11:11:42 -0500 Subject: [PATCH 10/27] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c70748bc..0dec7e590 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - Recalculate secondary dependencies between rounds (#378) - Calculated dependencies could be left with wrong candidates when toplevel requirements happen to be also pinned in sub-dependencies (#450) +- Fix duplicate entries that could happen in generated requirements.txt (#427) # 1.8.0 From 74567f77a803eeaf45bf43f4762658db7256cef5 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Tue, 21 Feb 2017 09:48:42 +0100 Subject: [PATCH 11/27] Use tox-travis for Travis/Tox integration --- .travis.yml | 29 ++++++----------------------- tox.ini | 7 ++++++- 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/.travis.yml b/.travis.yml index 995d6a654..5f5dd3ed0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,27 +1,10 @@ sudo: false language: python - -# Run tox with python 3.5, but let _it_ build the envs for the various Python -# versions (instead of Travis) -python: 3.5 - -env: - matrix: - - TOXENV=py27-piplatest - - TOXENV=py34-piplatest - - TOXENV=py35-piplatest - - TOXENV=py27-pip8 - - TOXENV=py34-pip8 - - TOXENV=py35-pip8 - - TOXENV=py27-pip9 - - TOXENV=py34-pip9 - - TOXENV=py35-pip9 - - TOXENV=flake8 - +python: + - "2.7" + - "3.4" + - "3.5" install: - - travis_retry pip install tox - +- travis_retry pip install tox-travis cache: pip - -script: - - tox +script: tox --travis-after diff --git a/tox.ini b/tox.ini index 9fb3b379d..08663e41f 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,7 @@ deps = coverage pytest commands = - python -c 'import pip; print("Using pip %s" % pip.__version__)' + pip --version python -m coverage run --source piptools -m pytest --strict {posargs:tests/} python -m coverage report -m python -m coverage html @@ -18,3 +18,8 @@ commands = basepython = python2.7 deps = flake8 commands = flake8 piptools tests --max-line-length=120 + +[travis] +python = + 2.7: py27, flake8 + From 2df97dad6e840e2b505e4c440610f1c30c837d46 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Tue, 21 Feb 2017 09:49:27 +0100 Subject: [PATCH 12/27] Add PyPI deploy using tox-travis' "after all" --- .travis.yml | 10 ++++++++++ tox.ini | 2 ++ 2 files changed, 12 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5f5dd3ed0..faa39a2d9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,3 +8,13 @@ install: - travis_retry pip install tox-travis cache: pip script: tox --travis-after +deploy: + provider: pypi + user: jazzband + distributions: sdist bdist_wheel + password: + secure: EswzTeyLEtslHlgrDwAz8sBdDJMzTPr761p7UoDW4jaL2RYyR4018oaGKeYESveKq5IMS1AxGXvXZVeln0YcXAwVOWp2S5SE9pkT0d/OdUcq5KHhFkS6UL/WVzG5L+eLQdwS5D3mVBcQGyShLs/uY1vjyQU1j6wfQrSsHOHHTEI= + on: + tags: true + repo: jazzband/pip-tools + python: 2.7 diff --git a/tox.ini b/tox.ini index 08663e41f..053a22810 100644 --- a/tox.ini +++ b/tox.ini @@ -23,3 +23,5 @@ commands = flake8 piptools tests --max-line-length=120 python = 2.7: py27, flake8 +[travis:after] +travis = python: 2.7 From 04144265f56df530fef43786c507711a10b5156b Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Tue, 21 Feb 2017 10:12:25 +0100 Subject: [PATCH 13/27] Update Travis badge --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index bb6e18c72..45f61361b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -[![Build status](https://secure.travis-ci.org/jazzband/pip-tools.png?branch=master)](https://secure.travis-ci.org/jazzband/pip-tools) - +[![Build Status](https://travis-ci.org/jazzband/pip-tools.svg?branch=master)](https://travis-ci.org/jazzband/pip-tools) [![Jazzband](https://jazzband.co/static/img/badge.svg)](https://jazzband.co/) pip-tools = pip-compile + pip-sync From b7bd083c1b2a744cc0b16431e3b3338d16541dc1 Mon Sep 17 00:00:00 2001 From: David Genest Date: Tue, 21 Feb 2017 08:57:33 -0500 Subject: [PATCH 14/27] relaxed package key_from_req normalization. This caused unwanted disapearance of "# via" lines in output requirements. --- piptools/utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/piptools/utils.py b/piptools/utils.py index 6c6752509..019e77fa4 100644 --- a/piptools/utils.py +++ b/piptools/utils.py @@ -4,7 +4,6 @@ import sys from itertools import chain, groupby -import re import pip from pip.req import InstallRequirement @@ -40,8 +39,8 @@ def key_from_req(req): else: # pip 8.1.2 or above, using packaging key = req.name - # https://www.python.org/dev/peps/pep-0503/#normalized-names - key = re.sub(r'[-_.]+', '-', key).lower() + + key = key.replace('_', '-').lower() return key From 804e4acf6170825f1a92156ff6bd1820690491d7 Mon Sep 17 00:00:00 2001 From: David Genest Date: Tue, 21 Feb 2017 13:49:41 -0500 Subject: [PATCH 15/27] Release candidate 1: bump version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2cca3a7e9..acf4f3afb 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name='pip-tools', - version='1.8.1dev0', + version='1.8.1rc1', url='https://github.com/jazzband/pip-tools/', license='BSD', author='Vincent Driessen', From e4e0334e03076b21c61ba2742b55b460e2ba60db Mon Sep 17 00:00:00 2001 From: Bas van den Heuvel Date: Tue, 21 Feb 2017 22:30:03 +0100 Subject: [PATCH 16/27] Update writer test to lowercase only --- tests/test_writer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_writer.py b/tests/test_writer.py index 0cccf2b86..2026746be 100644 --- a/tests/test_writer.py +++ b/tests/test_writer.py @@ -43,7 +43,7 @@ def test_format_requirement_annotation_case_sensitive(from_line, writer): assert (writer._format_requirement(ireq, reverse_dependencies, primary_packages=[]) == - 'Test==1.2 ' + comment('# via xyz')) + 'test==1.2 ' + comment('# via xyz')) def test_format_requirement_not_for_primary(from_line, writer): From 74484a0c7dad023c8c1193cd8c4335fb1e4668c2 Mon Sep 17 00:00:00 2001 From: Bas van den Heuvel Date: Thu, 23 Feb 2017 09:10:54 +0100 Subject: [PATCH 17/27] Rename writer test to better reflect what happens --- tests/test_writer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_writer.py b/tests/test_writer.py index 2026746be..6d127d7b1 100644 --- a/tests/test_writer.py +++ b/tests/test_writer.py @@ -36,7 +36,7 @@ def test_format_requirement_annotation(from_line, writer): 'test==1.2 ' + comment('# via xyz')) -def test_format_requirement_annotation_case_sensitive(from_line, writer): +def test_format_requirement_annotation_lower_case(from_line, writer): ireq = from_line('Test==1.2') reverse_dependencies = {'test': ['xyz']} From 315f04bfdeefd4f9cf49e21b71a50bc7f82167ee Mon Sep 17 00:00:00 2001 From: Derek Schaller Date: Sat, 25 Feb 2017 11:11:03 -0800 Subject: [PATCH 18/27] Fallback to sha256 hash on hashes import error --- 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 41dc853db..3944dc4e2 100644 --- a/piptools/repositories/pypi.py +++ b/piptools/repositories/pypi.py @@ -9,7 +9,10 @@ from pip.download import unpack_url from pip.index import PackageFinder from pip.req.req_set import RequirementSet -from pip.utils.hashes import FAVORITE_HASH +try: + from pip.utils.hashes import FAVORITE_HASH +except ImportError: + FAVORITE_HASH = 'sha256' from ..cache import CACHE_DIR from ..exceptions import NoCandidateFound From eca11c6355ed9486cf9996499d0c823a4d2dbb13 Mon Sep 17 00:00:00 2001 From: David Genest Date: Mon, 27 Feb 2017 16:14:27 -0500 Subject: [PATCH 19/27] Update CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dec7e590..c160f1729 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,10 @@ -# 1.8.1 +# 1.8.1 (unreleased) - Recalculate secondary dependencies between rounds (#378) - Calculated dependencies could be left with wrong candidates when toplevel requirements happen to be also pinned in sub-dependencies (#450) - Fix duplicate entries that could happen in generated requirements.txt (#427) - +- Gracefully report invalid pip version (#457) # 1.8.0 From a70231aa7ff98f301043251da6998f03ebf414e5 Mon Sep 17 00:00:00 2001 From: David Genest Date: Tue, 28 Feb 2017 11:51:31 -0500 Subject: [PATCH 20/27] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c160f1729..105dfd469 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ toplevel requirements happen to be also pinned in sub-dependencies (#450) - Fix duplicate entries that could happen in generated requirements.txt (#427) - Gracefully report invalid pip version (#457) +- Fix capitalization in the generated requirements.txt, packages will always be lowercased (#452) # 1.8.0 From 57aacb8a9cd1ce4d73a405b52b58c39608fb208f Mon Sep 17 00:00:00 2001 From: David Genest Date: Tue, 28 Feb 2017 09:15:08 -0500 Subject: [PATCH 21/27] Remove special casing of pip specifier attribute. The use of req.specs in the resolver causes the resolver to not stabilize. This happens on long lists of subdependency. The old conditionnal was introducing discrepancies in the comparison function, under pip < 8.1.2. This change removes the pip version dependant check and unconditionnally uses req.specifier. Now that pip-tools only supports pip > 8.0, and that this attribute is present in pip >= 8.0, the special case is not needed. --- piptools/resolver.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/piptools/resolver.py b/piptools/resolver.py index 4bc3d2d27..bdfb30a40 100644 --- a/piptools/resolver.py +++ b/piptools/resolver.py @@ -36,12 +36,7 @@ def __init__(self, req): self.req = req self.key = key_from_req(req) self.extras = str(sorted(req.extras)) - if hasattr(req, 'specs'): - # pip < 8.1.2 - self.specifier = str(req.specs) - else: - # pip >= 8.1.2 - self.specifier = str(req.specifier) + self.specifier = str(req.specifier) def __eq__(self, other): return str(self) == str(other) From 6345fcea01cd87991f060093773d79ba858078ea Mon Sep 17 00:00:00 2001 From: David Genest Date: Thu, 2 Mar 2017 09:20:05 -0500 Subject: [PATCH 22/27] Added integration test to validate resolver reliability This integration test makes a real compilation test with live dependencies. While not exact, it should help augment confidence on the resolver properly functioning. It starts by making a fake package wheel that has sub-dependencies and then compiles a requirements.in. The result should be stable. --- tests/fixtures/fake_package/setup.py | 22 ++++++++++++++++++++++ tests/test_cli.py | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 tests/fixtures/fake_package/setup.py diff --git a/tests/fixtures/fake_package/setup.py b/tests/fixtures/fake_package/setup.py new file mode 100644 index 000000000..9b224cdf1 --- /dev/null +++ b/tests/fixtures/fake_package/setup.py @@ -0,0 +1,22 @@ +from setuptools import setup + +setup( + name='fake_with_deps', + version=0.1, + install_requires=[ + "python-dateutil>=2.4.2,<2.5", + "colorama<0.4.0,>=0.3.7", + "cornice<1.1,>=1.0.0", + "enum34<1.1.7,>=1.0.4", + "six>1.5,<=1.8", + "futures<3.1,>=3.0.3", + "ipaddress<1.1,>=1.0.16", + "jsonschema<3.0,>=2.4.0", + "pyramid<1.6,>=1.5.7", + "pyzmq<14.8,>=14.7.0", + "simplejson>=3.5,!=3.8,>3.9", + "SQLAlchemy!=0.9.5,<2.0.0,>=0.7.8,>=1.0.0", + "python-memcached>=1.57,<2.0", + "xmltodict<=0.11,>=0.4.6", + ], +) diff --git a/tests/test_cli.py b/tests/test_cli.py index 5951bdbd0..d8a973c60 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,5 +1,6 @@ import os from textwrap import dedent +import subprocess from click.testing import CliRunner @@ -103,3 +104,24 @@ def test_trusted_host(pip_conf): print(out.output) assert ('--trusted-host example.com\n' '--trusted-host example2.com\n' in out.output) + + +def test_realistic_complex_sub_dependencies(tmpdir): + + # make a temporary wheel of a fake package + subprocess.check_output(['pip', 'wheel', + '--no-deps', + '-w', str(tmpdir), + os.path.join('.', 'tests', 'fixtures', 'fake_package', '.')]) + + runner = CliRunner() + with runner.isolated_filesystem(): + with open('requirements.in', 'w') as req_in: + req_in.write('fake_with_deps') # require fake package + + out = runner.invoke(cli, ['-v', + '-n', '--rebuild', + '-f', str(tmpdir)]) + + print(out.output) + assert out.exit_code == 0 From 93c6e25362785b0a55c275a0b5c3e2732eccb195 Mon Sep 17 00:00:00 2001 From: David Genest Date: Fri, 3 Mar 2017 10:08:03 -0500 Subject: [PATCH 23/27] 1.8.1rc2 2nd release candidate for 1.8.1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index acf4f3afb..bbb0d1e85 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name='pip-tools', - version='1.8.1rc1', + version='1.8.1rc2', url='https://github.com/jazzband/pip-tools/', license='BSD', author='Vincent Driessen', From 9ba3d6b5caf08658c7644fcd85c7e3cd0f4aaf88 Mon Sep 17 00:00:00 2001 From: David Genest Date: Fri, 3 Mar 2017 15:09:21 -0500 Subject: [PATCH 24/27] Remove other instance of req.specifier special case --- piptools/repositories/local.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/piptools/repositories/local.py b/piptools/repositories/local.py index 58e9d20f1..1454a0d07 100644 --- a/piptools/repositories/local.py +++ b/piptools/repositories/local.py @@ -11,14 +11,8 @@ def ireq_satisfied_by_existing_pin(ireq, existing_pin): Return True if the given InstallationRequirement is satisfied by the previously encountered version pin. """ - if hasattr(existing_pin.req, 'specs'): - # pip < 8.1.2 - version = existing_pin.req.specs[0][1] - return version in ireq.req - else: - # pip >= 8.1.2 - version = next(iter(existing_pin.req.specifier)).version - return version in ireq.req.specifier + version = next(iter(existing_pin.req.specifier)).version + return version in ireq.req.specifier class LocalRequirementsRepository(BaseRepository): From 7d86c8d3ecd1faa6be11c7ddc6b29a30ffd1dae3 Mon Sep 17 00:00:00 2001 From: David Genest Date: Fri, 3 Mar 2017 15:56:07 -0500 Subject: [PATCH 25/27] 1.8.1rc3 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index bbb0d1e85..6cebb10d9 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name='pip-tools', - version='1.8.1rc2', + version='1.8.1rc3', url='https://github.com/jazzband/pip-tools/', license='BSD', author='Vincent Driessen', From 22151e17022f4a4457dd000970c4ea830b6ea9c6 Mon Sep 17 00:00:00 2001 From: Tuomas Suutari Date: Sun, 5 Mar 2017 10:27:40 +0200 Subject: [PATCH 26/27] Revert "Add PyPI deploy using tox-travis' "after all"" This reverts commit 2df97dad6e840e2b505e4c440610f1c30c837d46. --- .travis.yml | 10 ---------- tox.ini | 2 -- 2 files changed, 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index faa39a2d9..5f5dd3ed0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,13 +8,3 @@ install: - travis_retry pip install tox-travis cache: pip script: tox --travis-after -deploy: - provider: pypi - user: jazzband - distributions: sdist bdist_wheel - password: - secure: EswzTeyLEtslHlgrDwAz8sBdDJMzTPr761p7UoDW4jaL2RYyR4018oaGKeYESveKq5IMS1AxGXvXZVeln0YcXAwVOWp2S5SE9pkT0d/OdUcq5KHhFkS6UL/WVzG5L+eLQdwS5D3mVBcQGyShLs/uY1vjyQU1j6wfQrSsHOHHTEI= - on: - tags: true - repo: jazzband/pip-tools - python: 2.7 diff --git a/tox.ini b/tox.ini index 053a22810..08663e41f 100644 --- a/tox.ini +++ b/tox.ini @@ -23,5 +23,3 @@ commands = flake8 piptools tests --max-line-length=120 python = 2.7: py27, flake8 -[travis:after] -travis = python: 2.7 From c061c76ca941506dfbb443f7808ed2239dc5c3bb Mon Sep 17 00:00:00 2001 From: Tuomas Suutari Date: Sun, 5 Mar 2017 10:27:59 +0200 Subject: [PATCH 27/27] Revert "Use tox-travis for Travis/Tox integration" This reverts commit 74567f77a803eeaf45bf43f4762658db7256cef5. --- .travis.yml | 29 +++++++++++++++++++++++------ tox.ini | 7 +------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5f5dd3ed0..995d6a654 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,27 @@ sudo: false language: python -python: - - "2.7" - - "3.4" - - "3.5" + +# Run tox with python 3.5, but let _it_ build the envs for the various Python +# versions (instead of Travis) +python: 3.5 + +env: + matrix: + - TOXENV=py27-piplatest + - TOXENV=py34-piplatest + - TOXENV=py35-piplatest + - TOXENV=py27-pip8 + - TOXENV=py34-pip8 + - TOXENV=py35-pip8 + - TOXENV=py27-pip9 + - TOXENV=py34-pip9 + - TOXENV=py35-pip9 + - TOXENV=flake8 + install: -- travis_retry pip install tox-travis + - travis_retry pip install tox + cache: pip -script: tox --travis-after + +script: + - tox diff --git a/tox.ini b/tox.ini index 08663e41f..9fb3b379d 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,7 @@ deps = coverage pytest commands = - pip --version + python -c 'import pip; print("Using pip %s" % pip.__version__)' python -m coverage run --source piptools -m pytest --strict {posargs:tests/} python -m coverage report -m python -m coverage html @@ -18,8 +18,3 @@ commands = basepython = python2.7 deps = flake8 commands = flake8 piptools tests --max-line-length=120 - -[travis] -python = - 2.7: py27, flake8 -