Commit Graph

2727 Commits

Author SHA1 Message Date
Dan Ryan be6ffb554f Differentiate urls and paths when generating reqs 2018-02-04 22:25:44 -05:00
Dan Ryan b9feb06f59 Properly parse urls as Link objects
- Fixes #1121
- Adds a bunch of tests for pipenv.utils.get_requirement()
2018-02-04 22:25:42 -05:00
kennethreitz 8378a1b104 Merge pull request #1397 from pypa/speed
lazy load pip; refactor cli
2018-02-04 16:06:47 -05:00
kennethreitz 3cf44caf4d improvements
Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
2018-02-04 14:53:34 -05:00
kennethreitz 35629babb0 fix legacy tests
Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
2018-02-04 14:23:05 -05:00
kennethreitz 9c4482649b fix tests
Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
2018-02-04 14:19:07 -05:00
kennethreitz 4c83c9ea2b declare an encoding
Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
2018-02-04 14:16:53 -05:00
kennethreitz f21897770a futher cleanup of refactor
Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
2018-02-04 14:14:28 -05:00
kennethreitz 8d3a34d45e cleanup refactor
Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
2018-02-04 14:12:06 -05:00
kennethreitz 63a2cfc542 refactor
Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
2018-02-04 14:09:32 -05:00
kennethreitz c67f0cd6bf lazy load utils pip too
Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
2018-02-04 11:12:31 -05:00
kennethreitz 48a020b6d5 lazy load pip
Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
2018-02-04 10:54:53 -05:00
kennethreitz 765c4205b4 Merge pull request #1390 from charlax/patch-2
Add CMD to example Dockerfile usage
2018-02-04 10:18:53 -05:00
Charles-Axel Dein a8185d91a2 Add CMD to example Dockerfile usage
This makes it clearer that you don't have to do `pipenv run python3 main.py` for instance.
2018-02-02 11:39:08 +01:00
Dan Ryan 4f2295a1db Merge pull request #1384 from charlax/ca/link-to-pipfile-spec
Add link to Pipfile specification
2018-02-01 13:48:13 -05:00
Charles-Axel Dein e8a7be3b03 Add link to Pipfile specification
This is useful for people using Pipenv and looking for more information related to specifying VCS dependencies.
2018-02-01 12:19:40 +01:00
Nate Prewitt ad7229b754 Merge pull request #1362 from berkerpeksag/update-python-versions
Update Python 3.3 and 3.6 versions
2018-01-27 21:44:34 -08:00
Nate Prewitt d6f08de1a6 Merge pull request #1367 from pypa/hotfix/post_901_minor
Post 9.0.1 minor merges
2018-01-27 21:44:00 -08:00
Dan Ryan 1db269847f Fix capitalization 2018-01-27 20:43:41 -05:00
Berker Peksag 4d788d10d1 Update Python 3.3 and 3.6 versions
* 3.3.7 was released on 2017-09-19
* 3.6.4 was released on 2017-12-19
2018-01-28 04:22:23 +03:00
Nate Prewitt 72081cca22 Merge pull request #1363 from pypa/hotfix/1097_remerge
#1097 remerge
2018-01-27 16:51:13 -08:00
Nate Prewitt daa4d6ab85 Merge pull request #1366 from pypa/hotfix/windows_drive_recase
Windows Drive Case Normalization
2018-01-27 16:50:26 -08:00
Nate Prewitt 2051cbe408 Merge pull request #1368 from pypa/hotfix/documentation_prs
Post 9.0.1 Documentation PRs
2018-01-27 16:45:09 -08:00
Anthony Shaw c96de3ccee add reference to plugin 2018-01-27 15:44:42 -05:00
Nick Coghlan ed620ecc17 Link to OWASP Top 10 from docs (#1269)
* Link to OWASP Top 10 from docs
2018-01-27 15:44:42 -05:00
cclauss cea46f18c7 missing comma in __all__ tuple? 2018-01-27 15:41:30 -05:00
emmanuel valette e8253feda4 replace netloc by hostname when adding trusted-host arg to pip 2018-01-27 15:41:30 -05:00
Markus Kaiserswerth a94018f837 pipenv update fails if freeze output contains comments
If the output of ``pip freeze`` contains comments (e. g. a line like ``## !! Could not determine repository location``), then the ``pipenv update`` command fails when it tries to parse the requirements:

``python
(project-cIS5-zzV) bash-3.2$ pipenv update -d
Updating all dependencies from Pipfile…
Traceback (most recent call last):
  File "/.local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/cli.py", line 2559, in update
    do_purge()
  File "/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/cli.py", line 1230, in do_purge
    dep = convert_deps_from_pip(package)
  File "/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/utils.py", line 624, in convert_deps_from_pip
    req = get_requirement(dep)
  File "/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/utils.py", line 311, in get_requirement
    req = [r for r in requirements.parse(dep)][0]
IndexError: list index out of range
``

It tries to make sense of the ``##`` "requirement", which fails.

This commit adds a simple fix to ignore comments in the ``pip freeze`` output.
2018-01-27 15:41:30 -05:00
Dan Ryan 9532637293 Skip search for requirements.txt when provided
- Fixes #1197
2018-01-27 15:41:30 -05:00
Dan Ryan 9e8d03970a Update test assertions for proper path casing
- Aligns tests with #1221 on windows
2018-01-27 13:08:34 -05:00
Dan Ryan 9ff4ca1c20 Fix drive normalization to only parse strings
- Fixes bug with handling non-existant pipfile locations on windows
2018-01-27 03:20:37 -05:00
Tzu-ping Chung e73d2bfa17 Force Windows local drive names to uppercase
Windows generally use upper cased drive names, but allow (without
normalizing) lower cased names in cmd.exe, which results in
inconsistencies when hashing the full path (to get the name of the
project's virtualenv). Python does not provide a good solution[*], so we
need to roll our own.

[*]: Python does have os.path.normcase(), but it always converts the
     whole paths to lowercase. This would break virtually *all* existing
     virtualenvs for Windows users.

UNC host names (which Python also treats as drives), on the other hand,
can actually be either cased. I am not sure if they are case-sensitive,
or should be coerced to what case, so this patch keeps with the existing
behaviour, and does not try to coerce them.
2018-01-27 03:20:35 -05:00
Dan Ryan c92693c14f Undo all the cleanup, fix tests 2018-01-27 02:32:15 -05:00
Dan Ryan 5084accb67 Fix click formatting 2018-01-27 02:12:57 -05:00
Dan Ryan 61a0cf9c05 Scrub needless system flag additions 2018-01-27 02:12:57 -05:00
Dan Ryan cd0351c145 Add system flag to all resolve_deps calls
- Add --system Flag to all CLI functions that interact with python
environments
- Add 'envvar' parameter to click options to parse into system flag if
we miss it in environments.py
2018-01-27 02:12:57 -05:00
Dan Ryan 0d622b219d Test --system flag 2018-01-27 02:12:56 -05:00
Dan Ryan 16708a4da5 Pass 'allow_global' to resolve_deps
- Fixes #1002
2018-01-27 02:12:56 -05:00
Dan Ryan 5191a8e6b1 Merge pull request #1361 from pypa/revised_master
Revised master
2018-01-27 00:46:53 -05:00
Nate Prewitt b9b29df062 cast exception as string for printing 2018-01-26 02:48:52 -08:00
Nate Prewitt 3170b122b2 fix bad variable assignment 2018-01-26 02:48:17 -08:00
dragon788 4c78c1908d Fixed broken links to fancy install methods (#1258)
* Fixed broken links to fancy install methods

Outside of the TOC blocks it was referring to install.html instead of /install/ and resulted in broken links.
2018-01-26 02:48:07 -08:00
Josh Friend e21e5e1194 Update default python for 3.6.x 2018-01-26 02:47:59 -08:00
Dan Ryan a86a6fe49d Add docker pin to test to fix resolver error 2018-01-26 02:47:47 -08:00
kennethreitz cb6f539e59 Update README.rst 2018-01-26 02:47:40 -08:00
kennethreitz f3b11b10e7 Update install.rst 2018-01-26 02:47:31 -08:00
John Carter b9c3f4f635 missing support for ~= in check?
also fixed comment typo
2018-01-26 02:47:12 -08:00
Yehuda Deutsch 35a0533e1a Pass clear flag to lock when updating 2018-01-26 02:46:52 -08:00
Dan Ryan 0f04e5708c Fix backup resolver
- Backup resolver was broken when hash resolution was split out into two
functions
- This PR returns the resolver to the caller function
- This is for edge cases where the PyPI json API and the pip resolver
don't return the same authoritative result for a package lookup (a name
can be resolved in one source but not the other)
- Added test to prevent future regression
- Fixes #1195
2018-01-26 02:46:30 -08:00
Nikita Sobolev fc48184b9a Updates cli.py with proper requirements filename
In some systems `Requirements.txt` != `requirements.txt` and this line could possibly bring confusion to users.
Since we are only searching for actual `requirements.txt` in `find_requirements()`: https://github.com/pypa/pipenv/blob/cbcc89bee73e5af2e34252deb686ad7578e14c61/pipenv/utils.py#L1121
2018-01-26 02:23:11 -08:00