100 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
Kian-Meng Ang 810fb745ae Fix typos
Found via `codespell -S ./peeps,./pipenv/patched,./pipenv/vendor,./pipenv/pipenv.1,./get-pipenv.py,./tests/test_artifacts`
2023-07-23 21:55:03 +08:00
Matt Davis 2350346866 Insulate this test from side-effects with other tests using six 2023-07-11 20:23:42 +02:00
Christian Clauss 44e8aebc41 ruff --select=FLY,UP --target-version=py37 --fix . 2023-06-30 08:36:14 +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 b1e3128e15 Drop cerberus, it seems it's not used anywhere (#5699)
* Drop cerberus, it seems it's not used anywhere.
2023-05-21 06:52:27 -04:00
Matt Davis 99800ec7a2 Requirementslib==2.3.0 (#5672)
* Bump requirementslib that drops vistir.

* Add news fragment

* Add missing file

* Remove vistir entirely

* fix circular import

* revert issue that may be causing circular import issue

* Hackaround current pythonfinder version importlib usage.

* PR Feedback

* fix lint
2023-04-29 19:22:28 +02:00
Matt Davis 52f180eb91 Split apart core.py (#5616)
* Split apart core using pycharm refactor move methods.
2023-02-25 00:25:00 +01:00
Oz Tiram b862b7ffaf Add test for funktools 2023-02-18 16:21:02 +01: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
Micah Smith 93ca107599 Fix behavior of VENV_IN_PROJECT setting 2022-11-01 21:15:58 -04:00
Micah Smith d1adb504be Add default kwarg to get_from_env 2022-10-25 10:56:09 -04:00
jerempy 5f548d05dd update vendored lib
update to vendored tomlkit everywhere

tests were breaking primarily due to the vendored tomlkit classes do not equal the non vendored
2022-10-09 14:55:58 -04:00
Oz N Tiram 4709420951 Remove test for PipfileParser
Testing and development of plette parser will be done upstream.
2022-09-13 15:00:39 +02:00
Matt Davis 5e7aee3a77 Actually load the dot env file before virtualenv creation. 2022-09-07 19:23:41 -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
Matt Davis 9eb1e7b6d9 Fix test of find_windows_executable and expand coverage. 2022-02-15 20:27:55 -05: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 ff32a68771 Remove some usages of vistir.compat 2021-11-08 23:49:40 +08:00
Frost Ming 9dbf157f8b delete useless tests 2021-11-04 16:06:59 +08:00
Frost Ming 904f0a3b86 capture outputs written in subprocesses 2021-08-03 10:41:19 +08:00
Frost Ming 46ea38fcca Isolate environment variables 2021-08-03 10:41:17 +08:00
Frost Ming 6a221cf732 Don't share project objects but create own 2021-07-30 12:31:43 +08:00
Frost Ming ca5d931f1f Update to py36 plus syntax 2021-07-28 10:59:00 +08:00
Dan Ryan 362a730fac Fix environment comparison code and add tests
Signed-off-by: Dan Ryan <dan.ryan@canonical.com>
2020-05-09 00:41:49 -04:00
Tomas Orsava de5cdf5949 Mark unit tests requiring network connection 2020-05-06 16:26:21 +02:00
Dan Ryan d0181e3ab9 Update patched test
Signed-off-by: Dan Ryan <dan.ryan@canonical.com>
2020-04-27 17:48:57 -04:00
Dan Ryan 88fe850482 Fix monkeypatch warnings on python 2.7
Signed-off-by: Dan Ryan <dan.ryan@canonical.com>
2020-04-10 17:45:13 -04:00
Dan Ryan f90e183064 Fix failing test
Signed-off-by: Dan Ryan <dan.ryan@canonical.com>
2020-04-10 12:14:09 -04:00
Dan Ryan e911c9ac71 Use monkeypatch instead of mock for setting dotenv test attributes
Signed-off-by: Dan Ryan <dan.ryan@canonical.com>
2020-04-10 12:14:08 -04: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