-
-
Notifications
You must be signed in to change notification settings - Fork 214
Add functionality to handle poetryV2 installation #1865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
ambuj-1211
wants to merge
5
commits into
CycloneDX:master
Choose a base branch
from
ambuj-1211:Refactor-poetry-install-command
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
17aff60
Add functionality to handle poetryV2
ambuj-1211 e6507cf
Merge branch 'CycloneDX:master' into Refactor-poetry-install-command
ambuj-1211 ce26c47
Modify utils.js and its test code
ambuj-1211 e2cd176
Merge branch 'Refactor-poetry-install-command' of https://github.com/…
ambuj-1211 017cba3
Refactor utils.js and utils.test.js
ambuj-1211 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,12 +11,10 @@ import { | |
findLicenseId, | ||
getCratesMetadata, | ||
getDartMetadata, | ||
getGoPkgLicense, | ||
getLicenses, | ||
getMvnMetadata, | ||
getNugetMetadata, | ||
getPyMetadata, | ||
getRepoLicense, | ||
guessPypiMatchingVersion, | ||
hasAnyProjectType, | ||
isPackageManagerAllowed, | ||
|
@@ -4979,6 +4977,38 @@ test("parse pyproject.toml", () => { | |
}); | ||
}); | ||
|
||
test("parse pyproject.toml with poetryv2 requirement", () => { | ||
const retMap = parsePyProjectTomlFile("./test/data/pyproject_poetryv2.toml"); | ||
expect(retMap.parentComponent).toEqual({ | ||
name: "blint", | ||
version: "2.4.2", | ||
description: "Linter and SBOM generator for binary files.", | ||
license: "MIT", | ||
authors: [{ name: "Team AppThreat", email: "[email protected]" }], | ||
homepage: { url: "https://github.com/owasp-dep-scan/blint" }, | ||
repository: { url: "https://github.com/owasp-dep-scan/blint" }, | ||
tags: ["binary", "linter", "sast", "security"], | ||
properties: [{ name: "cdx:pypi:requiresPython", value: ">=3.10,<3.14" }], | ||
type: "application", | ||
"bom-ref": "pkg:pypi/[email protected]", | ||
purl: "pkg:pypi/[email protected]", | ||
evidence: { | ||
identity: { | ||
field: "purl", | ||
confidence: 1, | ||
methods: [ | ||
{ | ||
technique: "manifest-analysis", | ||
confidence: 1, | ||
value: "./test/data/pyproject_poetryv2.toml", | ||
}, | ||
], | ||
}, | ||
}, | ||
}); | ||
expect(retMap.poetryV2Mode).toBeTruthy(); | ||
}); | ||
|
||
test("parse pyproject.toml with custom poetry source", () => { | ||
const retMap = parsePyProjectTomlFile( | ||
"./test/data/pyproject_with_custom_poetry_source.toml", | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
[project] | ||
name = "blint" | ||
version = "2.4.2" | ||
description = "Linter and SBOM generator for binary files." | ||
authors = [ | ||
{name= "Team AppThreat", email = "[email protected]"}, | ||
] | ||
dependencies = [ | ||
"lief>=0.16.6", | ||
"rich>=14.0.0", | ||
"PyYAML>=6.0.2", | ||
"defusedxml>=0.7.1", | ||
"pydantic[email]>=2.11.3", | ||
"orjson>=3.10.16", | ||
"symbolic==10.2.1", | ||
"ar>=1.0.0", | ||
"custom-json-diff>=2.1.6", | ||
"appdirs>=1.4.4", | ||
"apsw>=3.49.1.0", | ||
"packageurl-python>=0.16.0", | ||
"oras>=0.2.28", | ||
] | ||
license = "MIT" | ||
readme = "README.md" | ||
homepage = "https://github.com/owasp-dep-scan/blint" | ||
repository = "https://github.com/owasp-dep-scan/blint" | ||
keywords = ["linter", "binary", "security", "sast"] | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: System Administrators", | ||
"Topic :: Utilities", | ||
"Topic :: Security", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: 3.13", | ||
"Operating System :: OS Independent", | ||
] | ||
requires-python = ">=3.10,<3.14" | ||
include = ["blint/data/*.yml"] | ||
|
||
[project.urls] | ||
"CI" = "https://github.com/owasp-dep-scan/blint/actions" | ||
|
||
[project.scripts] | ||
blint = 'blint.cli:main' | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"pytest>=8.3.5", | ||
"black>=25.1.0", | ||
"flake8>=7.2.0", | ||
"pylint>=3.3.6", | ||
"pytest-cov>=6.1.1", | ||
"pyinstaller>=6.12.0" | ||
] | ||
|
||
[tool.black] | ||
line-length = 99 | ||
|
||
[build-system] | ||
requires = ["poetry-core>=2.0.0"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.pytest.ini_options] | ||
addopts = "--verbose --cov-append --cov-report term --cov blint" | ||
|
||
[tool.pylint] | ||
generated-members = ["lief", "orjson"] | ||
ignore-paths = ["blint/cyclonedx/*", "tests/*"] | ||
# Let's not fuss about long strings | ||
ignore-long-lines = "[r|f]\"" | ||
disable = ["missing-module-docstring", "logging-fstring-interpolation"] | ||
|
||
[tool.pylint.format] | ||
max-line-length = 99 | ||
|
||
[tool.pylint.design] | ||
max-args = 6 | ||
max-nested-blocks = 6 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was
pnpm lint
doing these rearrangements?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it was due to pnpm lint I guess I just ran devenv prepare for pr task not pnpm directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not happening in my devenv setup. The existing sort order is unchanged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prabhu Did all the changes as reviewed by you just this one is remaining. Should I do something or could it be managed at your end more easily?