94 Commits

Author SHA1 Message Date
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
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