11 Commits

Author SHA1 Message Date
Liaiss Merzougue
6850119c0e Fix RUF005 rule
This rule requests to consider {expression} instead of concatenation, for
details see https://docs.astral.sh/ruff/rules/collection-literal-concatenation/

These fix was automatically made by ruff with the command:

  'ruff check --select RUF005 --unsafe-fixes --fix'

but a manual change on src/e3/anod/store/__init__.py was needed to fix C409
flake8 rules

Ref: it/org/software-supply-chain/production-pipeline/issues#204
2026-02-03 17:17:57 +01:00
Liaiss Merzougue
b226b05728 Fix PT006 rule
The argnames argument of pytest.mark.parametrize takes a string or a sequence of strings.
This MR fix case when multiple parameters are not passed using a tuple. These
fixes was made automatically by ruff.

See: https://docs.astral.sh/ruff/rules/pytest-parametrize-names-wrong-type/

Ref: it/org/software-supply-chain/production-pipeline/issues#193
2026-01-21 18:04:23 +01:00
Liaiss Merzougue
fe760273a8 Correct ANN201 ruff rules
This rules is to detect function without return annotation, most of
them was fixed automatically by ruff, 19 was done manually

Ref: it/org/software-supply-chain/production-pipeline/issues#193
2026-01-19 09:52:37 +00:00
Léo Cardao
e2b079d2b2 Remove dead code: PyPIClosure.cache_file parameter is never used
Found while working on it/package-registry#27
2025-02-12 13:48:11 +01:00
Olivier Ramonat
49844e88dc Fix tests using pip wheel without network access
To workaround the fact that we don't have network access when running
`pip wheel` we can pass the argument `--no-build-isolation` and have
`the tool retrieve the build dependency from the current environment.

It's a good idea to also pass `--no-index` to ensure that the tests
won't try to access the PyPI server.

for it/e3-core#15
2024-10-14 13:10:25 +00:00
Nicolas Roche
1796a7bbcf Improve pypi closure computation by using a complete resolver
Previous approach was using a naive algorithm that was failing to
resolve complex constraints, mainly because of the absence of
backtracking. In order to solve properly the issue, the new
implementation drags the generic constraint solver used by pip
(resolvelib) and instantiate it.

Note also that the package now only depends on the standard
PyPI simple API rather than the release obsolete one.
2024-08-05 15:50:30 +02:00
Léo Cardao
62ba3bf4c5 Add e3-pypi-closure yanked tests
Related to #671
2024-01-29 10:51:49 +01:00
Léo Cardao
649bedcd3d Implement pypi simulator
The pypi simulator is used to simulate the interactions between our code
and the real pypi.

Addresses are mocked, and for the moment it only simulates requests in
https://pypi.org/pypi/<YOUR PACKAGE>/json format.

Test json metadata must be downloaded in advance and placed in
tests/tests_e3/pypi_data/json.

Related to #671
2024-01-29 10:51:45 +01:00
Jérémy Morosi
e41bfab17e Use Specifier class to check version constraints
Package.add_constraint implements its own way to check for
version constraints, while packaging.specifiers.Specifier can
be used
2023-09-22 11:41:35 +02:00
Pierre Trespeuch
b0f813e88d Handle star ending requirements in pypi add_constraint
Some packages like google-api-client can have requirements that discard
all micro versions of a package for a given major and minor version.
This is the case of the google-api-client package (v 2.97) which for
example requires google-api-core!=2.1.*.
2023-09-06 09:38:05 +02:00
Nicolas Roche
66d43dc8fa Add script to generate a Python package closure based on a config file 2023-03-09 10:19:05 +01:00