Skip to content

Commit

Permalink
Merge pull request #540 from voyages-sncf-technologies/master
Browse files Browse the repository at this point in the history
Fixing OutputWriter._iter_lines for pip 8.1.1 or below
  • Loading branch information
vphilippon authored Jul 31, 2017
2 parents 8748865 + df35e55 commit f7b0549
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
8 changes: 6 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@ environment:

matrix:
- TOXENV: py27-pip8
- TOXENV: py27-pip8.1.1
- TOXENV: py27-pip9
- TOXENV: py27-piplatest
- TOXENV: py34-pip8
- TOXENV: py34-pip8.1.1
- TOXENV: py34-pip9
- TOXENV: py34-piplatest
- TOXENV: py35-pip9
- TOXENV: py35-pip8
- TOXENV: py35-pip8.1.1
- TOXENV: py35-pip9
- TOXENV: py35-piplatest
- TOXENV: py36-pip9
- TOXENV: py36-pip8
- TOXENV: py36-pip8.1.1
- TOXENV: py36-pip9
- TOXENV: py36-piplatest

install:
Expand Down
6 changes: 3 additions & 3 deletions piptools/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from .click import unstyle
from .io import AtomicSaver
from .logging import log
from .utils import comment, format_requirement, dedup, UNSAFE_PACKAGES
from .utils import comment, dedup, format_requirement, key_from_req, UNSAFE_PACKAGES


class OutputWriter(object):
Expand Down Expand Up @@ -96,7 +96,7 @@ def _iter_lines(self, results, unsafe_requirements, reverse_dependencies,
for ireq in packages:
line = self._format_requirement(
ireq, reverse_dependencies, primary_packages,
markers.get(ireq.req.name), hashes=hashes)
markers.get(key_from_req(ireq.req)), hashes=hashes)
yield line

if unsafe_requirements:
Expand All @@ -108,7 +108,7 @@ def _iter_lines(self, results, unsafe_requirements, reverse_dependencies,
req = self._format_requirement(ireq,
reverse_dependencies,
primary_packages,
marker=markers.get(ireq.req.name),
marker=markers.get(key_from_req(ireq.req)),
hashes=hashes)
if not allow_unsafe:
yield comment('# {}'.format(req))
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[tox]
envlist = py{27,34,35,36,py}-pip{8,9,latest},flake8
envlist = py{27,34,35,36,py}-pip{8,8.1.1,9,latest},flake8

[testenv]
deps =
piplatest: pip
pip8.1.1: pip==8.1.1
pip8: pip~=8.0
pip9: pip~=9.0
coverage
Expand Down

0 comments on commit f7b0549

Please sign in to comment.