Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check the pip version is compatible ASAP #429

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Installation
============

```console
$ pip install --upgrade pip # pip-tools needs pip==6.1 or higher (!)
$ pip install --upgrade pip # pip-tools needs pip==8 or higher (!)
$ pip install pip-tools
```

Expand Down
11 changes: 6 additions & 5 deletions piptools/scripts/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@
import tempfile

import pip

# Make sure we're using a compatible version of pip
from ..utils import assert_compatible_pip_version
assert_compatible_pip_version()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is still a possibility of error if an ImportError is thrown in utils.py, but the fix for that is more destructive, and would mean moving this function into its own file. I don’t mind doing that, but I’ll wait to see if reviewers think that would be necessary.


from pip.req import InstallRequirement, parse_requirements

from .. import click
from ..exceptions import PipToolsError
from ..logging import log
from ..repositories import LocalRequirementsRepository, PyPIRepository
from ..resolver import Resolver
from ..utils import (assert_compatible_pip_version, is_pinned_requirement,
key_from_req)
from ..utils import is_pinned_requirement, key_from_req
from ..writer import OutputWriter

# Make sure we're using a compatible version of pip
assert_compatible_pip_version()

DEFAULT_REQUIREMENTS_FILE = 'requirements.in'


Expand Down
9 changes: 5 additions & 4 deletions piptools/scripts/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@

import pip

# Make sure we're using a compatible version of pip
from ..utils import assert_compatible_pip_version
assert_compatible_pip_version()

from .. import click, sync
from ..exceptions import PipToolsError
from ..logging import log
from ..utils import assert_compatible_pip_version, flat_map

# Make sure we're using a compatible version of pip
assert_compatible_pip_version()
from ..utils import flat_map

DEFAULT_REQUIREMENTS_FILE = 'requirements.txt'

Expand Down