Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/2848
Browse files Browse the repository at this point in the history
  • Loading branch information
techalchemy committed Nov 3, 2018
2 parents 714ff65 + 4a49dfa commit dbad4eb
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
.AppleDouble
.LSOverride

# PyCharm
.idea/

# VSCode
.vscode

Expand Down
3 changes: 3 additions & 0 deletions docs/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ Example::
API access throttling based on overall usage rather than individual
client usage.

You can also use your own safety API key by setting the
environment variable ``PIPENV_PYUP_API_KEY``.


☤ Community Integrations
------------------------
Expand Down
2 changes: 2 additions & 0 deletions news/2825.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Added environment variable `PIPENV_PYUP_API_KEY` to add ability
to override the bundled pyup.io API key.
1 change: 1 addition & 0 deletions news/3151.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix project path hashing logic in purpose to prevent collisions of virtual environments.
7 changes: 4 additions & 3 deletions pipenv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
PIPENV_DONT_USE_PYENV,
SESSION_IS_INTERACTIVE,
PIPENV_CACHE_DIR,
PIPENV_PYUP_API_KEY,
)
from ._compat import fix_utf8
from . import exceptions
Expand Down Expand Up @@ -2452,15 +2453,15 @@ def do_check(
else:
ignored = ""
c = delegator.run(
'"{0}" {1} check --json --key=1ab8d58f-5122e025-83674263-bc1e79e0 {2}'.format(
python, escape_grouped_arguments(path), ignored
'"{0}" {1} check --json --key={2} {3}'.format(
python, escape_grouped_arguments(path), PIPENV_PYUP_API_KEY, ignored
)
)
try:
results = simplejson.loads(c.out)
except ValueError:
click.echo("An error occurred:", err=True)
click.echo(c.err, err=True)
click.echo(c.err if len(c.err) > 0 else c.out, err=True)
sys.exit(1)
for (package, resolved, installed, description, vuln) in results:
click.echo(
Expand Down
1 change: 1 addition & 0 deletions pipenv/environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
if interactive.
"""

PIPENV_PYUP_API_KEY = os.environ.get("PIPENV_PYUP_API_KEY", "1ab8d58f-5122e025-83674263-bc1e79e0")

# Internal, support running in a different Python from sys.executable.
PIPENV_PYTHON = os.environ.get("PIPENV_PYTHON")
Expand Down
2 changes: 1 addition & 1 deletion pipenv/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ def get_name(name, location):
# In-project venv
# "Proper" path casing (on non-case-sensitive filesystems).
if (
fnmatch.fnmatch("A", "a")
not fnmatch.fnmatch("A", "a")
or self.is_venv_in_project()
or get_workon_home().joinpath(venv_name).exists()
):
Expand Down

0 comments on commit dbad4eb

Please sign in to comment.