641 Commits

Author SHA1 Message Date
Liaiss Merzougue
31168422c4 Fix RUF059 rule
This rule detects the presence of unused variables in unpacked assignments.
See: https://docs.astral.sh/ruff/rules/unused-unpacked-variable/

Fixed automatically with : 'ruff check --select RUF059 --unsafe-fixes --fix' + one
manual fix in tests/test_e3/anod/context_test.py

Ref: it/org/software-supply-chain/production-pipeline/issues#204
2026-02-06 10:23:02 +00:00
Liaiss Merzougue
ac8a9fa48f Fix UP012 Rule.
This rule requests to remove the use encode (utf-8) as it is the default
python encoding. See https://docs.astral.sh/ruff/rules/unnecessary-encode-utf8/

Automatically fixed using 'ruff check --select UP012 --fix'

Ref: it/org/software-supply-chain/production-pipeline/issues#204
2026-02-06 09:05:46 +00:00
Liaiss Merzougue
f3a1f0d04d Fix LOG015 rule
Using the root logger causes the messages to have no source information,
making them less useful for debugging.

for details see: https://docs.astral.sh/ruff/rules/root-logger-call/

The fix was done manually

Ref: it/org/software-supply-chain/production-pipeline/issues#204
2026-02-04 14:56:34 +01:00
Liaiss Merzougue
574af8e16b Fix ARG005 Rule
This rule detects for the presence of unused arguments in lambda expression definitions.

for details see: https://docs.astral.sh/ruff/rules/unused-lambda-argument/

The fix was done manually

Ref: it/org/software-supply-chain/production-pipeline/issues#204
2026-02-04 10:45:19 +00:00
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
6de145995c Fix UP034 rule
This was automatically fixed (using "ruff check --select UP034 --fix"), this
rule fix useless extraenous parathensis
(https://docs.astral.sh/ruff/rules/extraneous-parentheses/)

Ref:   it/org/software-supply-chain/production-pipeline/issues#193
2026-01-27 16:00:37 +01:00
Liaiss Merzougue
90e19fb58d Fix D403 rule
This was automatically fixed, this rule fix the docString capitalization
(https://docs.astral.sh/ruff/rules/first-word-uncapitalized/)

ref:  it/org/software-supply-chain/production-pipeline/issues#193
2026-01-22 16:19:43 +00: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
6704fc784c Fix UP032 rule
This commit fix the Ruff rule UP032: https://docs.astral.sh/ruff/rules/f-string/

This is done automatically through ruff check --select UP032 --fix

Ref:  it/org/software-supply-chain/production-pipeline/issues#193
2026-01-21 16:04:26 +00:00
Liaiss Merzougue
4214dcd194 Fix ANN204 rule
This commit fix the Ruff rule ANN204: https://docs.astral.sh/ruff/rules/missing-return-type-special-method/
This done automatically for all file but 2 files needs manual action : tests/tests_e3/conftest.py and  tests/tests_e3/json_test.py

Ref: it/org/software-supply-chain/production-pipeline/issues#193
2026-01-20 17:42:53 +01:00
Léo Cardao
24f7a62408 BuildInfo.__init__: Rename build_id parameter to id 2026-01-20 16:17:01 +00:00
Liaiss Merzougue
c04851eab1 Fix RET505 rule
Ruff avoid return in the else of a condition, if we have a return in the if

Ref:  it/org/software-supply-chain/production-pipeline/issues#193
2026-01-20 15:08:19 +01:00
Liaiss Merzougue
d5511cca15 Fix ANN202 rule
This rule expect the return fonction type annotation for private
function

Ref:   it/org/software-supply-chain/production-pipeline/issues#193
2026-01-20 14:30:04 +01:00
Liaiss Merzougue
a9cec74a1c Fix UP031 rules
This check replace string format using % by format using {}, fixed automatically by ruff

Ref: it/org/software-supply-chain/production-pipeline/issues#193
2026-01-20 11:55:34 +01:00
Liaiss Merzougue
4b4a55fd75 Fix INP001 rules
We need to explicit add __init__.py for src/e3 package

Ref:   it/org/software-supply-chain/production-pipeline/issues#193
2026-01-19 17:57:11 +01:00
Liaiss Merzougue
a5fd3393ae Correct PIE808 ruff rules
This rules is to detect use of unnecessary start argument of range fonction, fixed automatically by ruff

Ref:  it/org/software-supply-chain/production-pipeline/issues#193
2026-01-19 13:01:04 +00: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
1529659ced Removes the temporary fix of test_component_metadata
Due to the previous commits, that change how we get the latest inserted
element, this fix is not needed anymore and so, we are removing it.
2026-01-08 16:31:45 +00:00
Léo Cardao
67bfdde01b e3.anod.store.LocalStore: Add testing, fix some bugs and improve coverage 2026-01-08 16:31:45 +00:00
Léo Cardao
3ef076b1b7 Removes 'vary' headers from the cache
With Python 3.14 and the new zstd support, the 'vary' header causes an
issue when looking at a response from our 'testing' cache (used only for
testing purposes).

Due to this new behavior, our
tests/tests_e3/cve/cve_test.py::test_nvd_cve_search was failing and tried
to make a real request instead of using the cache as expected
2026-01-07 18:12:19 +01:00
Léo Cardao
c7390600d5 Remove e3.weakref module and updates/deletes other files that use it
This commit removes `e3.weakref` and updates the other files accordingly.

On e3.npm, the `WeakSession` has been replaced by a regular session if not
provided by the user.

The `e3.npm.link.NPMLink.last_modified` property has been totally removed.

it/e3-core#69
2025-12-22 15:07:51 +01:00
Léo Cardao
608b41b3e5 Rename and deprecate BuildInfo.to_dict
This method has been replaced by `BuildInfo.as_dict`. The method still
exists, but will emit a deprecation warning if used and will be removed in
future versions of `e3-core`.

The renaming/deprecation is done for coherence purposes; other classes in
`e3.anod.store.*` uses `as_dict`.

it/e3-core#74
2025-12-11 17:15:53 +00:00
Léo Cardao
1b81f9e0e0 Apply 1 suggestion(s) to 1 file(s)
Co-authored-by: Frederic Leger <leger@adacore.com>
2025-10-31 13:47:53 +00:00
Léo Cardao
071678ae15 Fix tests_e3:anod:store:component_test:py--test_component_metadata
The `creation_date` field, used to retrieve the latest component, has a
precision of seconds.

When two consecutive component pushes are done too quickly, it may result
in two components with the same `creation_date` field.

To avoid this error and make a better fix, we will simply sleep for one
second between two pushes.

it/e3-core#62
2025-10-31 14:29:23 +01:00
Léo Cardao
56393c4a73 Add way to retrieve the last modification date
The last modification date can come from two different places, depending
on the registry used:

- Directly from the registry metadata
    - This method is not always supported; For example, the Gitlab NPM
      registry will not provide this information.
- From the Last-Modified HTTP headers
    - Retrieving the Last-Modified header generates a HEAD HTTP request.

This commit also adds a `session` parameter at several relevant places.
This is useful for multithreading purposes, but not mandatory: If no
session is provided, the code will create its own session instead.

Note: On multithreading, letting the code create a `session` instead of
providing a session may result in an `OSError`
'too many file descriptors open'.

it/package-registry#47
2025-10-29 10:21:24 +01:00