Commit Graph

419 Commits

Author SHA1 Message Date
Dan Ryan 02fc52b8da Leverage pip to access installed packages
- Use `get_installed_distributions` from pip
- This cascades to `pkg_resources.working_set` which relies on
  `sys.path` to uncover packages
- Consequently I implemented `temp_path()` as a contextmanager in the
  style of `temp_environ()`
- This requires us to know the environment's `sys.path`, so
  `load_path(python)` will do a `json.dumps` of `sys.path` to stdout
  which then gets loaded and returned
- Allows us to avoid trying to hack around `pip freeze` output to parse
  out names from comments etc
- Provides other potential uses

Signed-off-by: Dan Ryan <dan@danryan.co>
2018-07-23 01:06:55 -04:00
Tzu-ping Chung a5a9583c2d Un-vendor Pew 2018-07-05 16:43:11 +08:00
Tzu-ping Chung c171eb32a6 Remove pew.lsenvs usage from project 2018-07-05 00:18:30 +08:00
kennethreitz 6314586c9f black 2018-07-03 09:54:46 -04:00
Tzu-ping Chung f998d017e6 Comment and format 2018-07-01 19:20:36 +08:00
Dan Ryan 9f71a1bfbe Reimplement get_workon_home to save import
- Pew import is super expensive
- Fixes #2843

Signed-off-by: Dan Ryan <dan@danryan.co>
2018-06-30 22:33:38 -04:00
Dan Ryan 9f59811704 Improve import times and runtimes
- Lazily import requirementslib

Signed-off-by: Dan Ryan <dan@danryan.co>
2018-06-30 22:33:38 -04:00
Dan Ryan ec3b47ac3d Merge branch 'master' of github.com:pypa/pipenv
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-06-29 03:17:19 -04:00
Dan Ryan 8ab6008e9a Fix resolver imports
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-06-29 03:16:26 -04:00
Dan Ryan 832bc8ee49 Merge branch 'master' into bugfix/1901 2018-06-28 20:46:23 -04:00
Dan Ryan 7a014feb0d Fix utils
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-06-27 22:36:26 -04:00
Dan Ryan 24743f77d3 Switch to using pathlib2 for python<3.5
- Fixes #2438

Signed-off-by: Dan Ryan <dan@danryan.co>
2018-06-27 21:15:43 -04:00
frostming 698c9be64e add tests 2018-06-27 13:12:41 +08:00
Tzu-ping Chung d382842dd8 Remove unused utility function
All get_converted_relative_path usages are now pushed into
requirementslib.
2018-06-24 15:55:06 +08:00
Dan Ryan 6c62d94c3b Fix pip cahce dir argument
Signed-off-by: Dan Ryan <dan@danryan.co>

Add snaptime sdist

Signed-off-by: Dan Ryan <dan@danryan.co>

Update core.py encoding and add gitattributes

Signed-off-by: Dan Ryan <dan@danryan.co>

Fix deploy test

Signed-off-by: Dan Ryan <dan@danryan.co>

Add pytest things

Signed-off-by: Dan Ryan <dan@danryan.co>

Add py sdist

Signed-off-by: Dan Ryan <dan@danryan.co>
2018-06-22 15:36:39 -04:00
Dan Ryan 32a89d9342 explicitly turn possible InlineTableElement to dict
Signed-off-by: Dan Ryan <dan@danryan.co>

Add updated regex dependency

Signed-off-by: Dan Ryan <dan@danryan.co>
2018-06-22 15:36:39 -04:00
Dan Ryan c31a311dc7 Minor code cleanup
Signed-off-by: Dan Ryan <dan@danryan.co>

Add pytz and certifi updates

Signed-off-by: Dan Ryan <dan@danryan.co>

Fix nondeterministic resolution bug

- Update dependencies
- Fix some issues with test logic
- Update piptools patch

Signed-off-by: Dan Ryan <dan@danryan.co>

Update more packages

Signed-off-by: Dan Ryan <dan@danryan.co>

Update tests and utils

Signed-off-by: Dan Ryan <dan@danryan.co>

Still need to tackle last few failures

- this will seriously help with resolution issues

Add alembic new version

Signed-off-by: Dan Ryan <dan@danryan.co>
2018-06-22 15:36:39 -04:00
Dan Ryan 9f58768ead Exclude dependencies with failing markers from lock
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-06-22 15:36:39 -04:00
Dan Ryan 5dc77a9419 Fix duplicate import
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-06-14 03:58:49 -04:00
Dan Ryan 18530dfb46 Fix VCS resolution
- Iterate over VCS dependencies from pipfile instead of
  iterating over those found in `pip freeze` output
- Only pass editable dependencies to pip-tools for resolution
- Normalize names and ensure that we update lockfile entries accordingly

Signed-off-by: Dan Ryan <dan@danryan.co>
2018-06-14 03:58:49 -04:00
Dan Ryan caf09662d6 Use constraint lines to update requirements
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-06-12 03:05:01 -04:00
Dan Ryan d519718e55 Improved named requirement handling
- Use requirement.requirement.line objects when generating constraints
  for pip

Signed-off-by: Dan Ryan <dan@danryan.co>
2018-06-11 23:49:57 -04:00
Erin O'Connell 0f59c74ac0 try except for first time run of lock 2018-06-11 18:30:04 -06:00
Dan Ryan d86fe41497 Return all sources for Requirement generation
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-06-11 00:06:49 -04:00
Dan Ryan 5b12b2cd9e Update Requirementslib calls with new API
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-06-11 00:06:49 -04:00
Dan Ryan be75afb2a9 Add a space for markers that we transform
- Cleanup stale comments
- Deterministic ordering for locking

Signed-off-by: Dan Ryan <dan@danryan.co>
2018-06-08 17:08:57 -04:00
Dan Ryan 0eb9c4c165 Typo... we want the key, not the whole entry
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-06-08 17:08:57 -04:00
Dan Ryan 168c93cfc1 Check marker key before generating string
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-06-08 17:08:57 -04:00
Dan Ryan 469db93005 Put a space between marker name and value
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-06-08 17:08:57 -04:00
Dan Ryan 025f66899b Refactor and cleanup some locking code
- This has been driving me mad.

Signed-off-by: Dan Ryan <dan@danryan.co>
2018-06-08 17:08:55 -04:00
Jacob Henner af91eb68bb Add support for PyPI mirrors
Adds support for the --pypi-mirror command line parameter and the
PIPENV_PYPI_MIRROR environment variable for most pipenv operations.
This permits pipenv to function without pypi.org, which is necessary for
users:

    1. behind restrictive networks
    2. facing strict artifact sourcing policies
    3. experiencing poor performance connecting to pypi.org
    4. who've configured a local cache for performance reasons

When specified, the value of this parameter replaces all instances of
pypi.org and pypi.python.org within pipenv operations without modifying
or requring the modification of Pipfiles.

- Resolves #2075
2018-06-07 18:24:18 -04:00
Dan Ryan 92286b57a7 Merge branch 'master' into tweak-resolver 2018-06-07 17:20:24 -04:00
Dan Ryan 157ebb1a60 Create temp src dir if not using environment
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-06-05 23:57:09 -04:00
Grey Baker 39ca6b272a Fix typo (actually_resolve_reps -> actually_resolve_deps) 2018-06-05 14:56:14 +01:00
Dan Ryan 54dd40473c Disable json resolver and tweak vcs resolution
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-06-05 01:05:44 -04:00
Tzu-ping Chung d48e97e1a8 Respect PATHEXT when looking for Win executable
... as idiomatic in Windows programming.
2018-06-03 15:51:37 +08:00
Tzu-ping Chung a5e69e4a61 Comments 2018-05-28 13:37:34 +09:00
Dan Ryan 824f822bc7 Don't shell escape posix-style paths
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-05-27 14:34:21 -04:00
Dan Ryan 311c90d191 Fix lockfile filename parsing
- convert to string properly
2018-05-27 14:26:30 -04:00
Dan Ryan e993ee874d Use filesystem compatible encodings for strings
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-05-27 13:52:39 -04:00
Dan Ryan cc68b365e0 formatting cleanup and posix style paths
- fix for windows vcs urls

Signed-off-by: Dan Ryan <dan@danryan.co>
2018-05-27 13:35:25 -04:00
Dan Ryan 9e661519e0 Probably write unicode strings...
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-05-27 02:27:58 -04:00
Dan Ryan 892be4650e Merge branch 'feature/better-resolver' of github.com:pypa/pipenv into feature/better-resolver 2018-05-27 02:19:57 -04:00
Dan Ryan 1d54a32dc5 Add sources and caches to pip calls
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-05-27 02:19:32 -04:00
Tzu-ping Chung f91371aa55 Code clean up
This shouldn't affect any functionalities, only clean up some generator
usages to reduce repeated looping through requirements.
2018-05-27 14:02:00 +09:00
Dan Ryan f532b2eb86 Use pipenv cache dir for caching wheels
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-05-26 23:39:34 -04:00
Dan Ryan 84c0b09193 Fix marker parsing bug
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-05-26 21:03:34 -04:00
Dan Ryan bba2f38d91 Patch piptools to use current environment python
- Fixes #2088, #2234, #1901
- Fully leverage piptools' compile functionality by using constraints
  in the same `RequirementSet` during resolution
- Use `PIP_PYTHON_PATH` for compatibility check to filter out
  `requires_python` markers
- Fix vcs resolution
- Update JSON API endpoints
- Enhance resolution for editable dependencies
- Minor fix for adding packages to pipfiles

Signed-off-by: Dan Ryan <dan@danryan.co>
2018-05-26 21:03:34 -04:00
Dan Ryan 7abc2fd3a1 Use piptools constraints files more properly
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-05-26 21:02:51 -04:00
Dan Ryan fddde1cce3 Fix requirements cleanup
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-05-23 22:16:19 -04:00