Commit Graph

112 Commits

Author SHA1 Message Date
Matt Davis b9e9885ac3 fix ruff 2024-11-05 16:42:35 +01:00
Matt Davis 95f3af13f4 fix my new test 2024-11-05 16:42:35 +01:00
Matt Davis 8b3a057da7 Add news fragment and test case 2024-11-05 16:42:35 +01:00
Matt Davis 7a7b3425d4 Fix the --system without --deploy flag bug (#6297)
* Fix the --system without --deploy flag bug
* add news fragment
2024-10-30 19:27:30 -04:00
Matt Davis 265ca2880e Replace the old Entry class with something simpler based on data-classes + pip session requests performance issue patch 2024-10-29 22:35:03 +01:00
Matt Davis 287d848f63 PR cleanup 2024-10-22 19:49:29 +02:00
Matt Davis 46c5db785e Actually that didn't fix that test 2024-10-22 19:49:26 +02:00
Matt Davis ef1f4e83a3 Fix edge case of test in CI by ensuring it raises DeployFailure (this test passed locally without this change for some reason) 2024-10-22 19:49:25 +02:00
Matt Davis fe5c4d1bae fix upgrade url/file dependencies 2024-10-22 19:49:22 +02:00
Matt Davis f79cd18c70 refactor the install routines further to provide clairty and meet the goal of not doing full lock resolution, which was intended as we moved to 2024.x release series. 2024-10-22 19:49:16 +02:00
Matt Davis cbcd06c4f9 Fix test on windows 2024-09-29 18:01:10 -04:00
Naofal-Helal 09e49168cc add assert 2024-09-20 12:08:59 +02:00
Naofal-Helal 7d777009cf add test case for #6171 2024-09-20 12:08:59 +02:00
Naofal-Helal 6db75e4517 format tests 2024-09-20 12:08:59 +02:00
Oz Tiram 99255a6b0b Fix tests for MacOSX and Windows
On these OS rich is insisting on breaking the location to
multiple lines.

To avoid this, we increase the terminal width temporarily,
(as soft_wrap=True seems to have no effect).

Also, a better regex to match the location across multiple lines
is added.

Signed-off-by: Oz Tiram <oz.tiram@gmail.com>
2024-07-13 23:18:35 +02:00
Oz Tiram 3403917948 tests: fix matching of venv_loc
The test failed with rich, since it is softwrapping long lines.
The fix matches the location of the venv using regular expressions.

Signed-off-by: Oz Tiram <oz.tiram@gmail.com>
2024-07-13 23:18:35 +02:00
Sangmin Yoon ad77f63105 Minor fix on testcode 2024-05-24 21:37:08 +09:00
Sangmin Yoon b2dafaa157 Handle unspecified python versioning on Pipfile 2024-05-24 21:34:59 +09:00
Matt Davis 8fd6dfc9cc Merge pull request #5965 from daveschaefer/sort-category-alphabetical
feat: Option to sort packages alphabetically inside each Pipfile category
2023-10-20 07:41:10 -04:00
Matt Davis 9d9baee3c3 Skip test because truststore is now included. 2023-10-19 14:50:27 +02:00
Dave Schaefer 966afee813 Add tests for sorting str and dict values
Currently these fail. Will be fixed shortly in the next patch.

Pipfiles can contain different formats for package specifications.
Current default behaivour is to sort packages into groups - all string values will be sorted first, followed by all dictionary values. e.g.

```
aa = "*"
bb = "*"
cc = "*"
aaa = {version = "*"}
bbb = {version = "*"}
ccc = {version = "*"}
```

This will have to be fixed.
2023-10-10 21:03:25 -06:00
Dave Schaefer 9bc4ffa506 Rename sorting directive
`sort_pipfile` , as requested in https://github.com/pypa/pipenv/pull/5965
2023-10-08 09:46:45 -06:00
Dave Schaefer 8e189035a3 Added new Pipenv option sort_alphabetical
Sort packages alphabetically inside each category.
Currently runs on `install`.
2023-10-07 11:01:53 -06:00
Dave Schaefer e87e2ceb05 Sort packages alphabetically inside each category
When installing any package, sort all package names alphabetically inside the category, for easier reading.

Unsure if this is the best place or way to implement.
Small prototype to add to discussion in https://github.com/pypa/pipenv/issues/5964

Tests:

before patch:

```
AssertionError: assert ['atomicwrite...ama', 'build'] == ['atomicwrite...', 'colorama']
  At index 1 diff: 'colorama' != 'build'
  Full diff:
  - ['atomicwrites', 'build', 'colorama']
  ?                  ---------
  + ['atomicwrites', 'colorama', 'build']
  ?                            +++++++++
```

after patch: pass.
2023-10-04 21:35:16 -06:00
Christian Clauss 22223f0084 ruff rules SIM 2023-08-30 14:51:20 +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
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