You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for pyproject.toml manifest files in the Java client library,
enabling analysis of Python projects using Poetry, uv, or PEP 621-compliant
tools.
- New PythonPyprojectProvider that parses TOML dependency sections and
generates temporary requirements.txt for dependency tree resolution
- Refactor shared Python infrastructure into PythonProvider base class
- Support PEP 621 [project.dependencies] and Poetry
[tool.poetry.dependencies] (production deps only)
- Convert Poetry version operators (^ and ~) to PEP 440 ranges
- Handle bare versions, pre-release suffixes, and ignore patterns
- Add license resolution and identification support
- Update README with pyproject.toml documentation
- Comprehensive unit tests for parsing, conversion, and edge cases
Jira-Issue: TC-3851
Assisted-by: Claude Code
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
<em>Python pip</em> users can add in requirement text a comment with #trustify-da-ignore(or # trustify-da-ignore) to the right of the same artifact to be ignored, for example:
267
+
<em>Python pip</em> users can add in <code>requirements.txt</code> a comment with #trustify-da-ignore(or # trustify-da-ignore) to the right of the same artifact to be ignored, for example:
268
268
269
269
```properties
270
270
anyio==3.6.2
@@ -297,6 +297,20 @@ zipp==3.6.0
297
297
```
298
298
</li>
299
299
300
+
<li>
301
+
<em>Python pyproject.toml</em> users can add a comment with #trustify-da-ignore next to a dependency in <code>pyproject.toml</code>:
302
+
303
+
```toml
304
+
[project]
305
+
name = "my-project"
306
+
dependencies = [
307
+
"requests>=2.28.1",
308
+
"flask>=2.0", # trustify-da-ignore
309
+
"click>=8.0",
310
+
]
311
+
```
312
+
</li>
313
+
300
314
<li>
301
315
<em>Gradle</em> users can add in build.gradle a comment with //trustify-da-ignore next to the package to be ignored:
In Python pip and in golang go modules package managers ( especially in Python pip) , There is a big chance that for a certain manifest and a given package inside it, the client machine environment has different version installed/resolved
541
-
for that package, which can lead to perform the analysis on the installed packages' versions , instead on the declared versions ( in manifests - that is requirements.txt/go.mod ), and this
555
+
for that package, which can lead to perform the analysis on the installed packages' versions , instead on the declared versions ( in manifests - that is requirements.txt/pyproject.toml/go.mod ), and this
542
556
can cause a confusion for the user in the client consuming the API and leads to inconsistent output ( in THE manifest there is version X For a given Package `A` , and in the analysis report there is another version for the same package `A` - Y).
Python support works with both `requirements.txt` and `pyproject.toml` manifest files. The `pyproject.toml` provider scans production dependencies from PEP 621 `[project.dependencies]` and Poetry `[tool.poetry.dependencies]` sections. Optional dependencies (`[project.optional-dependencies]`) and Poetry group dependencies (`[tool.poetry.group.*.dependencies]`) are intentionally excluded to focus on runtime dependencies.
597
+
582
598
By default, Python support assumes that the package is installed using the pip/pip3 binary on the system PATH, or of the customized
583
599
Binaries passed to environment variables. If the package is not installed , then an error will be thrown.
584
600
585
-
There is an experimental feature of installing the requirement.txt on a virtual env(only python3 or later is supported for this feature) - in this case,
601
+
There is an experimental feature of installing the dependencies on a virtual env(only python3 or later is supported for this feature) - in this case,
586
602
it's important to pass in a path to python3 binary as `TRUSTIFY_DA_PYTHON3_PATH` or instead make sure that python3 is on the system path.
587
-
in such case, You can use that feature by setting environment variable `TRUSTIFY_DA_PYTHON_VIRTUAL_ENV` to true
603
+
in such case, You can use that feature by setting environment variable `TRUSTIFY_DA_PYTHON_VIRTUAL_ENV` to true
588
604
589
605
##### "Best Efforts Installation"
590
606
Since Python pip packages are very sensitive/picky regarding python version changes( every small range of versions is only tailored for a certain python version), I'm introducing this feature, that
591
-
tries to install all packages in requirements.txt onto created virtual environment while **disregarding** versions declared for packages in requirements.txt
607
+
tries to install all packages in the manifest onto created virtual environment while **disregarding** versions declared for packages
592
608
This increasing the chances and the probability a lot that the automatic installation will succeed.
0 commit comments