Commit Graph

87 Commits

Author SHA1 Message Date
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
Frank Lichtenheld 7085c79cdb utils.toml: Handle tomlkit OutOfOrderTableProxy (#5797)
We get this when we have subtables that do not
directly follow their parent table.

Fixes: #5794

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-07-18 23:05:59 -04:00
Matt Davis 49b78914b4 somehow this change got reverted 2023-07-11 20:23:42 +02:00
Matt Davis c715b11234 Finally get to the bottom of the test parallelism random failures is because click's CliRunner is not thread safe. 2023-07-11 20:23:42 +02:00
Matt Davis 47e4d355e0 Invoke the resolver in the same process as pipenv rather than utilzing subprocess. Restore accidentally commented out part of pip validations. 2023-07-11 20:23:42 +02:00
Sébastien Coavoux 2ca0ed4ca3 Ensure version match operator when building specifier from pipfile 2023-07-03 14:50:33 -04:00
Christian Clauss 44e8aebc41 ruff --select=FLY,UP --target-version=py37 --fix . 2023-06-30 08:36:14 +02:00
Matt Davis be046bfbb8 This pre pip install path should no longer be neccessary when adding packages. (#5700)
* This pre pip install path should no longer be neccessary when adding packages.

* Fix test -- not sure how this was ever correct.

* Address test edge case
2023-06-02 06:40:40 +02:00
Christian Clauss 9525db4623 feat: Replace flake8 and isort with ruff 2023-04-13 15:58:49 +02:00
Matt Davis 19b53014f4 Merge branch 'main' into named-categories 2022-10-05 23:30:54 -04:00
jerempy 3171333449 delete accidental dup test 2022-10-05 10:54:46 -04:00
jerempy 5bf9f1baac pipfile saves correctly
and news segment
2022-10-05 10:52:09 -04:00
jerempy 3fe3674949 test first - it fails
expected output doesn't match current output which is "python_version": "3.10"
2022-10-03 09:10:56 -04:00
Oz N Tiram 21b6eb732d Yank skipped test - pipenv no longer supports unnamed index 2022-09-15 14:53:16 +02:00
Oz N Tiram db743ea011 Disable test that break with plette
Unnamed sources will break with the following error:

pipenv.vendor.plette.models.base.ValidationError: {'url': 'https://pypi.org/simple', 'verify_ssl': True}
name: required field
2022-09-13 16:20:06 +02:00
Matt Davis 24c51eb3a2 Resolve environment variables expanding for the sources. 2022-09-11 10:16:52 -04:00
Matt Davis 0c8d4c371a Fix the tests. 2022-09-11 09:37:49 -04:00
Matt Davis f46212e0fe More test optimizations. 2022-09-07 16:21:35 +02:00
Matt Davis bcaae97caa More test optimizations. 2022-09-06 00:46:46 -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 7b9b1aeb1c Allow users to pass a string of extra arguments to pip (#5283)
* Allow users to pass a string of extra arguments to pip install
2022-09-04 16:20:59 -04:00
Matt Davis 7d80a7fea5 Use a different library since I could not figure out the six conflicts this caused with other tests. 2022-09-04 00:28:02 +02:00
Matt Davis d59ded7de5 Add test case that fails on main branch and covers example fix of the issue. 2022-09-04 00:28:02 +02:00
Matt Davis 0caed6906f Reduce the amount of calls to pip and the number of tempfiles in batch_install. (#5301)
* Reduce the amount of calls to pip and the number of temp files in batch_install.

* Add logic to read the progress of the install in realtime from pip and stop using progress bar.

* refactor based on PR feedback.
2022-08-31 19:51:29 -04:00
Matt Davis e44d797ae1 Add unit test for this. 2022-08-13 21:19:19 +02: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 771cee564a Remove tests that are old and permenently skipped, remove OS skips that seem to not make sense. 2022-07-29 15:28:18 +02:00
Matt Davis 949ee95d67 More granular control over PIPENV_VENV_IN_PROJECT variable. (#5026)
* Allow PIPENV_VENV_IN_PROJECT to be read in as None, and ensure if it is set to False that it does not use .venv directory.

* refactor based on PR feedback and add news fragment.

* Review unit test coverage and add new tests.  Remove unneccesary bits from other tests.
2022-04-06 21:10:05 +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 b60fa7f5e6 Fix the assumption that all sources are named. (#5004)
* Fix the assumption that all sources are named.

* Add test case

* Add news fragment
2022-03-23 14:04:13 +01: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 9b4eb98529 Remove unused patch files 2021-07-28 17:30:17 +08:00
Frost Ming a82bbb7b27 Try switching from delegator to subprocess 2021-07-28 16:39:36 +08:00
Frost Ming ca5d931f1f Update to py36 plus syntax 2021-07-28 10:59:00 +08:00
Frost Ming dcd06330e4 Update pythonfinder to 1.2.8 2021-07-27 15:11:29 +08:00
Frost Ming 7fc8fc8398 Create news entry 2020-09-01 14:09:39 +08:00
Dan Ryan ad7a514563 Fix test that has been broken for who knows how long...
Signed-off-by: Dan Ryan <dan.ryan@canonical.com>
2020-05-19 09:56:32 -04:00
frostming a77e329341 Use the version in mocked PyPI 2020-04-30 10:45:43 +08:00
frostming 8162a22bca add a test case 2020-04-30 09:49:13 +08: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 00bef5eac7 Fix outline table test to avoid pep517 builder
- Add poetry to test fixtures

Signed-off-by: Dan Ryan <dan.ryan@canonical.com>
2020-04-10 12:14:03 -04:00
Frost Ming f9cef97076 Remove tricky test case 2019-08-03 18:17:10 +08:00
Frost Ming 2dc8d0a070 use another version 2019-08-03 16:54:44 +08:00
Frost Ming c3b4c410fa change the version specifier 2019-08-03 11:42:07 +08:00
Frost Ming 7708cd8445 Pass lock options to outdated 2019-08-03 10:44:45 +08:00
John Vandenberg 2f5150ab29 test_install_without_dev: Replace pytz with tablib
pytz exists in the build environment, which will typically
be added to the PYTHONPATH when running the tests in rpmbuild.
The alternative is to create a virtualenv containing only the
pipenv dependencies, which is cumbersome to do when devendoring.
As the pytz library here is not critical to the logic of the
test method, replace it with tablib to reduce unintentionally
errors when packaging.

Continuation of https://github.com/pypa/pipenv/issues/3644
2019-07-11 13:33:02 +07:00
Dan Ryan 9c3ee2a72b Get rid of devpi
Signed-off-by: Dan Ryan <dan@danryan.co>
2019-07-05 02:55:47 -04:00
Dan Ryan 5ac676711a Fix editable VCS dependency resolution
- Fixes #3809

Signed-off-by: Dan Ryan <dan@danryan.co>
2019-07-05 02:06:43 -04:00
Dan Ryan 83868c8f1a Cut over to devpi for tests and improve logging
- Verbose logs will now write gracefully to the terminal even while the
  spinner is running (i.e. during locking)
- This PR also cuts over to Devpi for a backing cache rather than a
  hacked httpbin instance
- Inclues a refactor of `pip_install` to deduplicate logic
- Attempts to switch back to relying on native editable installs in pip
  as the current implementation is broken on master (i.e. nothing is
  installed in the virtualenv)
- Fixes #3809

Signed-off-by: Dan Ryan <dan@danryan.co>
2019-06-25 01:26:49 -04:00