Skip to content

Commit

Permalink
Merge branch 'master' into appveyor_update
Browse files Browse the repository at this point in the history
  • Loading branch information
techalchemy committed Jun 27, 2018
2 parents b6ab274 + 8203d38 commit 091c73f
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ semver==2.7.8
six==1.10.0
snowballstemmer==1.2.1
Sphinx==1.6.3
sphinx-click==1.0.3
sphinx-click==1.2.0
sphinxcontrib-websupport==1.0.1
urllib3==1.22
virtualenv==15.1.0
Expand Down
1 change: 1 addition & 0 deletions news/2433.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed an issue reading package names from ``setup.py`` files in projects which imported utilities such as ``versioneer``.
1 change: 1 addition & 0 deletions news/2433.vendor
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed an issue reading package names from ``setup.py`` files in projects which imported utilities such as ``versioneer``.
3 changes: 1 addition & 2 deletions pipenv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2127,8 +2127,7 @@ def do_uninstall(
bold=True,
)
)
package_names = project.parsed_pipfile['dev-packages']
package_names = package_names.keys()
package_names = project.dev_packages.keys()
if package_name is False and not all_dev:
click.echo(crayons.red('No package provided!'), err=True)
sys.exit(1)
Expand Down
5 changes: 4 additions & 1 deletion pipenv/patched/prettytoml/elements/abstracttable.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ def _enumerate_items(self):
"""
non_metadata = self._enumerate_non_metadata_sub_elements()
while True:
yield next(non_metadata), next(non_metadata)
try:
yield next(non_metadata), next(non_metadata)
except StopIteration:
return

def items(self):
for (key_i, key), (value_i, value) in self._enumerate_items():
Expand Down
2 changes: 1 addition & 1 deletion pipenv/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ def write_toml(self, data, path=None):
formatted_data = contoml.dumps(data).rstrip()
except Exception:
for section in ('packages', 'dev-packages'):
for package in data[section]:
for package in data.get(section, {}):
# Convert things to inline tables — fancy :)
if hasattr(data[section][package], 'keys'):
_data = data[section][package]
Expand Down
2 changes: 1 addition & 1 deletion pipenv/vendor/requirementslib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding=utf-8 -*-
__version__ = "1.0.6"
__version__ = "1.0.7"


from .exceptions import RequirementError
Expand Down
6 changes: 5 additions & 1 deletion pipenv/vendor/requirementslib/models/requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,14 @@ def get_name(self):
):
from distutils.core import run_setup

old_curdir = os.path.abspath(os.getcwd())
try:
os.chdir(str(self.setup_path.parent))
dist = run_setup(self.setup_path.as_posix(), stop_after="init")
name = dist.get_name()
except (FileNotFoundError, IOError) as e:
dist = None
except (NameError, RuntimeError) as e:
except Exception as e:
from .._compat import InstallRequirement, make_abstract_dist

try:
Expand All @@ -257,6 +259,8 @@ def get_name(self):
name = dist.project_name
except (TypeError, ValueError, AttributeError) as e:
dist = None
finally:
os.chdir(old_curdir)
hashed_loc = hashlib.sha256(loc.encode("utf-8")).hexdigest()
hashed_name = hashed_loc[-7:]
if not name or name == "UNKNOWN":
Expand Down
4 changes: 2 additions & 2 deletions pipenv/vendor/vendor.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ requests==2.19.1
idna==2.7
urllib3==1.23
certifi==2018.4.16
requirementslib==1.0.6
requirementslib==1.0.7
attrs==18.1.0
distlib==0.2.7
packaging==17.1
pyparsing==2.2.0
pytoml==0.1.16
requirements-parser==0.2.0
shellingham==1.0.0dev1
shellingham==1.1.0dev0
six==1.11.0
semver==2.8.0
shutilwhich==1.1.0
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/test_install_markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@


py3_only = pytest.mark.skipif(sys.version_info < (3, 0), reason="requires Python3")
skip_py37 = pytest.mark.skipif(sys.version_info >= (3, 7), reason="Skip for python 3.7")


@pytest.mark.markers
Expand Down Expand Up @@ -127,6 +128,7 @@ def test_global_overrides_environment_markers(PipenvInstance, pypi):
@pytest.mark.complex
@flaky
@py3_only
@skip_py37
def test_resolver_unique_markers(PipenvInstance, pypi):
"""vcrpy has a dependency on `yarl` which comes with a marker
of 'python version in "3.4, 3.5, 3.6" - this marker duplicates itself:
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_install_uri.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ def test_install_local_vcs_not_in_lockfile(PipenvInstance, pip_src_dir):
# This is the hash of ./six
assert six_key in p.pipfile['packages']
assert six_key in p.lockfile['default']
# Make sure we didn't put six in the lockfile by accident as a vcs ref
assert 'six' not in p.lockfile['default']
# The hash isn't a hash anymore, its actually the name of the package (we now resolve this)
assert 'six' in p.pipfile['packages']


@pytest.mark.vcs
Expand Down

0 comments on commit 091c73f

Please sign in to comment.