52 Commits

Author SHA1 Message Date
Matt Davis 10be5b9c16 Include the package name in the information to the resolver (#5930)
* Include the package name in the information to the resolver

* Fix unit tests

* fix unit tests
2023-09-11 11:13:27 +02:00
Christian Clauss e23890e105 Performance: ruff rules C4 and PERF 2023-08-25 22:51:25 +02:00
Matt Davis 6ac1451ec8 stop using requirementslib models (#5793)
* Move away from requirementslib models

* Revise test since PEP-440 does not support wildcard versions but does support equivalent compatible release specifiers.

* simplify and remove dead code

* Ensure the os_name marker is AND with the other markers.

* Move what we still need from requirementslib into the pipenv utils and stop vendoring it.

* Remove requirementslib.

* force upgrade of virtualenv for python 3.12

* remove virtualenv-clone

* Update vcs specifiers documentation; infer name from specific pip line formats where possible.

* Provide helpful text and error for recently removed commands

* Set the right log levels and verbosity to show users the errors generated by pip resolver when supplying -v flag

* Fix the collection of all matching package hashes for non-pypi indexes.  Plus lesson from testing torch which contains local identifiers.
2023-08-19 16:36:52 -04:00
Matt Davis 2350346866 Insulate this test from side-effects with other tests using six 2023-07-11 20:23:42 +02:00
Matt Davis 7458b32e34 Bump requirements lib to v3.0.0 (#5679)
* Port over latest requirementslib sample changes to pydantic.

* fix import

* port over more changes from other attempt.

* port over more changes from other attempt.

* Iterate

* fix some tests

* fix markers tests

* Spot check changes back towards what was passing in pipenv prior.

* Parity with latest requirementslib changes

* latest changes that work for both pipenv and requirementslib.

* Hack for cross-test contamination looking for version of six that isn't in the private pypi.

* Differences between reqlib3 and prototype branch

* corrrect re-written imports that were wrong.
2023-06-26 23:54:47 +02:00
Oz Tiram 30be476801 Fix broken test 2022-11-18 23:09:57 +01:00
Oz Tiram ec27ab5652 Fix broken tests because of repository deletion
The repo https://github.com/Rapptz/discord.py was removed by the owner.
In order for this test to work, we need a package which has a setup
with version and extras in it.
2022-11-18 20:33:43 +01:00
Micah Smith 258d82f21d Fix is_env_truthy 2022-11-02 11:58:29 -04:00
Matt Davis 9848862927 Convert test runner to use pypiserver package as standalone process (#5284)
* Check point progress on moving tests to pypiserver.

* Allow other indexes to mimic the pypi json API for package hashes.

* Fix these tests that run on lower python versions only.

* Try adding the pypiserver to the github actions to only run once.

* Expand the scope of fixtures for pypiserver.

* try to accomedate microsoft runner.

* Windows networking troubles.

* Remove running as a background job.

* Try to condtionally invoke different start pypi-server commands

* Try to condtionally invoke different start pypi-server commands

* Try to condtionally invoke different start pypi-server commands

* Try to condtionally invoke different start pypi-server commands

* Try to condtionally invoke different start pypi-server commands

* Try to condtionally invoke different start pypi-server commands

* Try to condtionally invoke different start pypi-server commands

* Try to introduce pypi as the root index because setuptools-scm is not in our pypi artifacts.

* see if the windows tests run faster (and the other tests) by supplying waitress.

* Only use waitress on windows because the others are fast on the default.  Fix requests pollution.

* Supply a suitable Pipfile instead for these two failing tests.

* More requests resolver cross test contamination cleanup.

* remove problematic tests because even on my version of python 3.8.12 this does not work due to AttributeError: 'HTMLParser' object has no attribute 'unescape'

* fix mirror install test.

* Fix Pipfile.

* Fix Pipfile for real

* Fix tests

* Cleanup test naming and more test enhancements.

* Save this optimization for a subsequent PR.

* Cleanup the TemporaryDirectory between tests.

* resolve merge conflict.

* Cleanup path initalization -- it hsould always be a TemporaryDirectory for tests that gets cleanedup.

* Cleanup path initalization -- it hsould always be a TemporaryDirectory for tests that gets cleanedup.

* tableflip on those requests tests that read the setup metadata in reqlib from other tests.

* Update developer documentation for running tests.

* add news fragment.

* Try gunicorn perfoormance for linux/mac

* Only use gunicorn on linux based on the results of last run.
2022-09-05 10:19:12 -04:00
Matt Davis bac7b68e4a Try to address these sproadic test failures without skipping the test. 2022-08-29 08:36:05 +02:00
Albert Hopkins 44edfd4883 Fix: try python3 before python in install --system (#5296)
Fix a regression from commit dbea3f5 where `pip install --system` tries
to install using the `python` executable first which, on some systems
may point to Python 2.  Instead try `python3` first.
2022-08-27 22:28:10 +02:00
Matt Davis e4cc8f2550 Vendor in requirementslib==2.0.0 & drop pip-shims & revert sysconfig patch w/ safer setuptools usage (#5228)
* Vendor in requirementslib 2.0.0

* Drop sysconfig default patch.

* Remove setuptools import usages in pipenv.

* Add news fragment.
2022-08-24 14:09:17 -04:00
Dương Quốc Khánh 640612d0d7 Issue 5273 constraints are not recognized (#5274)
* Add more test for get_constraints_from_deps
* Use pip's check_invalid_constraint_type.
2022-08-18 19:52:23 -04:00
Matt Davis 6ad1c1c8f4 Mark these tests as flaky. 2022-08-13 08:46:41 -04:00
Dương Quốc Khánh e9dc3247dc Issue 4371 incorrect dependencies when install dev packages (#5234)
* Add test, ensure dev lock use default packages as constraints.

* Use default packages as constraints when locking develop packages.

* Add test, ensure installing dev-packages use default packages as constraints. (#4371) (#2987)

* Use default packages as constraints when installing provided dev packages.

* change vistir.path.normalize_path to pipenv.utils.shell.normalize_path

* Add function that get contraints from packages.

* Add test for get_constraints_from_deps function

* Use get_constraints_from_deps to get constraints

* Use @cached_property instead of @property

* Use standalone utility to write constraints file

* prepare_constraint_file use precomputed constraints.

* Add news fragment.
2022-08-13 05:17:09 -04:00
Matt Davis c6e0dd4ae7 Remove commented out line. 2022-08-07 22:53:26 +02:00
Matt Davis 374b670afb Remove other spots that did not use the internal pip version to exectue pipenv commands. 2022-08-07 22:53:26 +02:00
Matt Davis 66e1256018 Convert this test off pip-shims, it became flakey recently. 2022-08-07 00:06:20 +02:00
Matt Davis cd5a9683be Rename notpip to pip. Vendor in pip-22.2.1 and latest requirementslib and vistir. 2022-07-28 11:58:10 +02:00
Matt Davis 3387881a6d Code reorg utils into utils module reduces complexity (#4990)
* Split apart the massive utils.py into a utils module
2022-03-29 20:27:33 -04:00
Matt Davis 506b9b40b9 Remove remaining references to git:// 2022-03-16 21:53:11 -04:00
Milo Minderbinder 167909839a fix TLS validation for requirements.txt
Previously, due to a probable typo in the code for importing a
requirements file to create a new pipenv project, SSL/TLS validation was
disabled by default for any package index servers specified in the
requirements file with the `--index-url` or `--extra-index-url` options.

In addition, `--trusted-host` options in the requirements file would not
work as intended, because any host or host:port pair provided with these
options was incorrectly being matched against the full URLs of the
configured index server(s) (i.e. including the scheme, path, etc.),
instead of extracting and comparing with the host and port parts only,
as intended.

This PR fixes both of these issues, flipping the existing behavior to
require SSL/TLS validation by default, and optionally allowing TLS
validation to be disabled explicitly for specific host:port with the
`--trusted-host` option if provided.
2022-01-08 22:17:49 +08:00
Frost Ming 3d678257b7 Fix the index parsing 2021-12-23 10:49:17 +08:00
Frost Ming ca5d931f1f Update to py36 plus syntax 2021-07-28 10:59:00 +08:00
Tomas Orsava de5cdf5949 Mark unit tests requiring network connection 2020-05-06 16:26:21 +02:00
Dan Ryan e03878d7c7 Add news entry and fix lockfile
- Drop pytest-tap
- Update azure pipelines config
- Borrow ramdisk configuration from pip
- Fix pyinstaller ref for python 2
- Add 0-minute timeout and add github workflow
- Add skip for pywin32
- Scale down to `-n auto` to reduce race conditions on windows
- Skip pywin32 on python 3.8 as the relevant dependencies aren't
  compatible
- Use default pip exists action = ignore to work around VCS race
  condition
- Create local temp directory to avoid crossing drive letter boundary on
  azure during CI runs
- Monkeypatch click windows console detection to return False in CI

Signed-off-by: Dan Ryan <dan.ryan@canonical.com>
2020-04-10 12:14:06 -04:00
Dan Ryan 6aa9d66549 Update test url for discord link in tests
- Point at ref that actually exists

Signed-off-by: Dan Ryan <dan.ryan@canonical.com>
2020-04-10 12:14:04 -04:00
Sumana Harihareswara 603a20bf45 Update links in documentation
The canonical Pipenv documentation is now at pipenv.pypa.io.
Also, the canonical GitHub repositories for Pipenv and
Requests have changed, and some other communications links
(Twitter, mailing list, "thank you") were no longer
operational. This commit updates those and clarifies that
Pipenv is a project maintained by the PyPA.

Fixes #4137.

Signed-off-by: Sumana Harihareswara <sh@changeset.nyc>
2020-03-05 20:55:28 -05:00
frostming 7d36f3fbda Reformat codes 2019-09-06 18:06:05 +08:00
Dan Ryan dcfce70817 Fix python path discovery if not called python
- Begin a refactor of `delegator.run` invocation to ensure we capture
  and handle failures with our own exception wrappers
- Additoinally capture output and error logging and command information
  when running in verbose mode (should avoid significant repitition in
  the codebase)
- Refactor `which` and `system_which` to fallback to pythonfinder's
implementation
- Abstract `is_python_command` to identify whether we are looking for
  python, this enables us to rely on `pythonfinder.Finder.find_all_python_versions()`
  to ensure we aren't skipping python versions
- Fixes #2783

Signed-off-by: Dan Ryan <dan@danryan.co>
2019-03-16 15:10:40 -04:00
Dan Ryan 62a45e3323 Merge branch 'master' into bugfix/3502-trusted-host-custom-port 2019-03-06 19:09:01 -05:00
Lee Bontecou c05066cfe3 add unittests 2019-02-22 12:21:27 -06:00
Dan Ryan ef682bd58f Fix tuple bug in resolver
Signed-off-by: Dan Ryan <dan@danryan.co>
2019-02-15 02:04:51 -05:00
Dan Ryan 19f2ee61e9 Update resolver to handle all resolution in venv
- Resolve all VCS and non-piptools-resolveable deps in venv
- Implement pep517 for resolution of non-setuptools builds
- Add full support for the new dependency link format
- Fix breakages from pip 19* rollout and subsequent setuptools breakage

Signed-off-by: Dan Ryan <dan.ryan@xyleminc.com>
2019-02-11 00:48:35 -05:00
Adam Goldschmidt 3b4c592f30 add test to invalid prepare_pip_source_args and change error to be more descriptive. (+1 squashed commit)
Squashed commits:
[b00fb5ba] fixed test getting empty URL in source
2019-01-17 14:10:41 +02:00
jxltom 85e64b86be Resort imports for tests 2018-12-01 17:26:32 +08:00
Dan Ryan f9b97dacc7 Get rid of split file test
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-11-13 19:07:06 -05:00
Dan Ryan 4dac167657 Vendor boltons
Signed-off-by: Dan Ryan <dan@danryan.co>

Update vendored dependencies

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

Fix file handle leaks

- Fix #3020
- Fix #3088
- Patch delegator
- Add weakref finalizer for tempfiles

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

Fix spinner handlers on windows

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

Fix spinner output and encoding issue

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

fix encoding

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

Fix unicode output on windows, fix tomlkit imports

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

Unvendor boltons, fix compatibility, update merge functionalities

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

Update pythonfinder, vistir version, requirementslib version

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

Fix vendoring script

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

Silence pip version checks

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

Add debugging to locking

Signed-off-by: Dan Ryan <dan@danryan.co>
2018-10-30 01:07:07 -04:00
Dan Ryan bd7b6004fe Update requirementslib and re-patch piptools
- Fix attempted hashing of `ssh://` urls
- Fix URL parsing and conversions of `git` and `git+ssh` style vcs urls
- Fixes #2653
- Fixes #2446
- Update lockfile
- Vendor typing
- Add typing to setup.py
- Add click completion patch and update vendoring task
- Fix vendoring script
- Vendor enum34
- Update requirementslib and cleanup vcs check functionality
- Move enum and adjust patched click completion
- Update click completion
- Bump requirementslib again
- Move typing to backports, update tests
- Update tomlkit imports and backport typing module

Signed-off-by: Dan Ryan <dan@danryan.co>
2018-08-27 15:59:36 -04:00
Michael Hoang 0969a9ee67 Properly handle the first source having user/pass 2018-07-31 22:58:54 -04:00
kennethreitz a31f3427a0 fix failing tests 2018-07-03 18:12:04 -04: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 60e108cb17 Move requirements tests to requirement library
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-05-23 22:03:31 -04:00
Dan Ryan eb4423b208 Fix test references to old requirements parser
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-05-23 21:59:50 -04:00
Dan Ryan 3167285286 Update tests for new requirements format
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-05-23 21:59:50 -04:00
Dan Ryan 8abb764ce8 Update pypi urls
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-05-17 14:43:09 -04:00
Dan Ryan f6cff554f4 update tests to remove False key during comparison
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-05-05 00:43:08 -04:00
Dan Ryan 08f61e7684 Switch to checks for Mapping type and proper bool
Signed-off-by: Dan Ryan <dan@danryan.co>
2018-05-04 15:55:52 -04:00
Dan Ryan fcfebaf1cc Only use -e for install when editable=True
- Fixes #2121
- Add tests for regressions

Signed-off-by: Dan Ryan <dan@danryan.co>
2018-05-04 15:55:52 -04:00
Dan Ryan f0c33367fa Parse and include extras from vcs and non-vcs urls
- Include extras when rebuilding urls from pipfiles
- Fixes #1997, #2128

Signed-off-by: Dan Ryan <dan@danryan.co>
2018-05-03 22:43:30 -04:00