Commit Graph

153 Commits

Author SHA1 Message Date
Damian Shaw 68529081c2
Enforce f-strings via Ruff (#12393) 2023-11-07 09:14:56 +00:00
hauntsaninja 666be3544b Avoid use of 2020-resolver and legacy-resolver 2023-09-23 13:34:06 -07:00
q0w 110a26f0ed Merge branch 'main' into per-req-config-settings 2023-04-09 18:12:41 +03:00
Stéphane Bidoul 849dcbd6a8 Remove more traces of setup.py install 2023-03-31 09:47:09 +02:00
q0w 13459a809b
Merge branch 'main' into per-req-config-settings 2023-03-30 11:18:31 +03:00
Stéphane Bidoul 3fd8fde14b Remove with_wheel fixture
We install wheel by default in our test env.
2023-03-27 11:55:20 +01:00
Stéphane Bidoul 053b890e84 Update a few tests for removal of setup.py install
We now look for "Building wheel" instead of "running setup.py install"
2023-03-27 11:55:20 +01:00
q0w a878d7f093 dont propagate flag 2023-03-20 07:34:21 +03:00
q0w 69cfd23c17 Merge branch 'main' into per-req-config-settings 2023-03-20 07:26:21 +03:00
Stéphane Bidoul a04748db8e Remove support for the deprecated --install-options 2023-03-18 11:20:51 +01:00
q0w 8dabf3316a Test all edge cases 2022-12-21 23:23:20 +03:00
q0w 9c8e74bad9 Test deps with config-settings 2022-12-19 18:59:51 +03:00
q0w be21f0dd10 Add more tests 2022-12-15 04:22:47 +03:00
q0w 92730f6f63 Add more tests 2022-12-15 03:17:30 +03:00
Tzu-ping Chung 50e194f107 Selectively enable user site
The modern virtual environment structure does not allow us to enable
"fake user site" while disabling the global site, so we need to do more
fine-grained configuration to correctly set up test environments for
each test case.

With this done, we can also properly support the stdlib venv ad the test
environment backend, since it basically works identically with modern
virtualenv. The incompatible_with_test_venv is thus removed.
2022-10-28 01:51:13 +08:00
Stéphane Bidoul 51c78b4b83
Add tests for --xxx-options warnings and deprecation 2022-09-25 11:21:36 +02:00
Tzu-ping Chung 42359a9605 Migrate tests to use pathlib.Path
The pip-specific Path implementation has been removed, and all its
usages replaced by pathlib.Path. The tmpdir and tmpdir_factory fixtures
are also removed, and all usages are replaced by tmp_path and
tmp_path_factory, which use pathlib.Path.

The pip() function now also accepts pathlib.Path so we don't need to put
str() everywhere. Path arguments are coerced with os.fspath() into str.
2022-06-08 19:58:46 +08:00
Pradyun Gedam 57198c6688
Use `logger.warning` instead of `warnings.warn`
This is more in line with the rest of our output presentation logic.
2022-01-25 01:38:22 +00:00
Jon Dufresne c71cf88049 Complete type annotations of tests/functional/ directory 2021-11-18 18:26:17 -08:00
Tzu-ping Chung 12cb745985 Remove xfail from a weird but passing test 2021-09-30 15:59:58 +08:00
Jon Dufresne fa0804b98c Use @pytest.mark.usefixture("with_wheel") in tests
The with_wheel fixture doesn't have a value and isn't ever referenced
within a test function.

To avoid typing it every test function, change tests to use
pytest.mark.usefixture. It will no longer appear as an argument.

https://docs.pytest.org/en/latest/how-to/fixtures.html#use-fixtures-in-classes-and-modules-with-usefixtures
2021-09-20 21:44:29 -07:00
Jon Dufresne 8c5d3556bd Fix failing test due to removed setuptools feature, use_2to3
setuptools removed use_2to3 in version v58.0.1 (2021-09-06). Some tests
install the anyjson package which uses this feature and so those tests
result in a command failure. The failure appeared as:

    error in anyjson setup command: use_2to3 is invalid.

As anyjson package is no longer maintained (last release was 2012),
change the tests to use a package that is healthy.

For details on the setuptools change, see the history at:

https://setuptools.readthedocs.io/en/latest/history.html#v58-0-2
2021-09-08 05:37:55 -07:00
Pradyun Gedam 585037a80a
Cleanup implicit string concatenation 2021-08-20 13:37:52 +01:00
Pradyun Gedam 94999255d5
Reformat the codebase, with black 2021-08-20 13:37:49 +01:00
Jon Dufresne 6a6561c2cb Move many type comments to annotations
Use the tool com2ann to automatically convert most type comments to type
annotations. Some type comments continue to exist where any work beyond
the automatic conversion was required (for example, additional
formatting or circular references).

For additional information on the com2ann tool, see:
https://github.com/ilevkivskyi/com2ann
2021-08-10 07:12:32 -07:00
Tzu-ping Chung 2da77e97a2 Smarter (and looser) link equivalency logic 2021-07-22 15:27:10 +08:00
Max W Chase 4c69ab2a2c Support URL constraints in the new resolver
Fixes #8253
2021-04-17 07:59:57 -04:00
Tzu-ping Chung 917ecadd77 Show constraint in error message 2021-02-23 02:08:19 +08:00
Andrey Bienkowski 39d2fd131b Oops 2021-02-18 11:39:30 +03:00
Andrey Bienkowski 6045ade9a9 Apply review suggestions 2021-02-18 11:32:41 +03:00
Andrey Bienkowski 9b2cb894ba Convert more str.format() calls to f-strings 2021-02-13 09:27:17 +03:00
Pradyun Gedam 86afa89043
Merge pull request #9361 from jdufresne/f-strings
Use f-strings for simple string formatting
2020-12-26 10:24:18 +00:00
Jon Dufresne cdcf74fb8e Use f-strings for simple string formatting
Use pyupgrade to convert simple string formatting to use f-string
syntax. pyupgrade is intentionally timid and will not create an f-string
if it would make the expression longer or if the substitution parameters
are anything but simple names or dotted names.
2020-12-25 16:21:20 -08:00
Jon Dufresne 09b3d3a50b Remove object from class definitions
Unnecessary since dropping Python 2 support. In Python 3, all classes
are new style classes.
2020-12-25 15:48:11 -08:00
Tzu-ping Chung 0f6750c98c Modify old tests to accomodate restriction removal 2020-11-21 22:14:24 +08:00
Pradyun Gedam 64ff484c76
Skip tests that fail on Python 2 2020-10-30 23:09:00 +05:30
Pradyun Gedam 8a5656f7b1
Fix a flaky test 2020-10-30 23:08:59 +05:30
Pradyun Gedam a56fefc764
Add debugging information to CI 2020-10-30 23:08:59 +05:30
Pradyun Gedam 53db14b188
Mark test about install order as an xfail 2020-10-30 23:08:51 +05:30
Pradyun Gedam 5cba61e118
Switch to resolver variants in the test suite 2020-10-30 07:16:19 +05:30
Nguyễn Gia Phong c84ef7a67c Mark tests using remote svn and hg as xfail
The source repositories for testing is no longer available.
2020-08-24 09:43:50 +07:00
Stéphane Bidoul ccdfa74d79
Reduce reliance on .egg-info directories in test suite
Make more tests run with with_wheel and test
that a .dist-info directory is created.
2020-07-25 13:02:20 +02:00
Chris Hunt 89572a7d40 Throw CommandError on any location-related install options 2020-07-07 19:11:11 -04:00
Chris Hunt b46d8ab01a Refactor overriding test to not use disallowed option
Similar to our previous test refactoring, this removes the usage of
`--home` from the test command.

"Overriding" in the original test meant "placed after" in the
command-line arguments, which makes sense because setuptools will use
the last argument passed.
2020-07-07 19:11:02 -04:00
Chris Hunt 50d7b930d3 Create more robust test for isolated --install-option
The current test depends on passing `--home` to `--install-option`.
Since we would like that to fail, we need to use another argument. None
of the other possible arguments have a visible side-effect, so we just
write the provided arguments to a file and check that in the test.
2020-07-07 19:10:27 -04:00
Pradyun Gedam 28592d4c31
Allow for the deprecation warning in tests 2020-07-05 01:01:02 +05:30
Tzu-ping Chung 95477931b2 Mark new resolver test failure on extra union 2020-06-23 20:45:41 +08:00
Pradyun Gedam 445711c533
Merge pull request #8349 from uranusjr/new-resolver-reject-unsupported-wheel 2020-06-11 20:03:44 +05:30
Paul Moore bf2b63dd68 Modify tests to check unsupported forms of constraint in the new resolver 2020-06-11 11:41:07 +01:00
Tzu-ping Chung 03c59c50db Make failing tests fail 2020-06-10 20:57:23 +08:00