Skip to content

Modernize python package setup - #331

Open
Alicipy wants to merge 7 commits into
OWASP:masterfrom
Alicipy:modernize-python-package-setup
Open

Modernize python package setup#331
Alicipy wants to merge 7 commits into
OWASP:masterfrom
Alicipy:modernize-python-package-setup

Conversation

@Alicipy

@Alicipy Alicipy commented May 17, 2026

Copy link
Copy Markdown
Contributor

While starting with pytm, I saw a few things regarding package management that could use improvement, especially as the Python folks use pure pip or uv currently, and maybe wondering why the commands don't work.

This PR includes migration to the default pyproject.toml keys which poetry in version 2 also understands, so nothing breaks. As pip can handle these as well, we can remove a few other files which existed for compatibility reasons (?) as well.

@Alicipy
Alicipy requested a review from izar as a code owner May 17, 2026 15:17
@izar

izar commented May 21, 2026

Copy link
Copy Markdown
Collaborator

Hi and thanks for the PR! Can you work with @fkromer on #305 ? Otherwise I believe we'll have some conflicts here.

@Alicipy
Alicipy force-pushed the modernize-python-package-setup branch from 3a02cec to 549244d Compare May 24, 2026 15:06
@Alicipy

Alicipy commented May 24, 2026

Copy link
Copy Markdown
Contributor Author

Yes of course, I would love to! How do you suggest to proceed? Shall we merge this and redo the other one, or vice versa? This change does work in both, poetry and uv; as it depends only on PEP-specified behaviour right now.
I am also happy to close this one, and support on the other one fully.

@Alicipy
Alicipy force-pushed the modernize-python-package-setup branch 2 times, most recently from 973251f to fccb68b Compare May 24, 2026 15:11
@fkromer

fkromer commented May 31, 2026

Copy link
Copy Markdown
Contributor

@Alicipy You missed the github ci related changes I guess. Some other notes: gitbook support seems to be deprecated. Using a docs dir is the defacto standard compatible with mkdocs and other Python ecosystem static documentation generators. I‘d recommmend to have a look into https://github.com/OWASP/pytm/pull/305/changes#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711 (and the overall PR) which addresses those topics already.

Alicipy added 4 commits August 2, 2026 15:41
Lets any packaging tool read the metadata, not just Poetry.
The lock file is refreshed because the dependencies moved.

Signed-off-by: Stefan Kraus <dev@stefankraus.org>
[dependency-groups] is the standard table for these now, so
uv and pip --group can install them without Poetry.

Signed-off-by: Stefan Kraus <dev@stefankraus.org>
hatchling is the PyPA-maintained build backend; building a wheel
no longer needs Poetry installed. Poetry stays for the workflow.

Signed-off-by: Stefan Kraus <dev@stefankraus.org>
This is done automatically as it's part of pytm package,
both backends ship the images and the threat library.

Signed-off-by: Stefan Kraus <dev@stefankraus.org>
@Alicipy
Alicipy force-pushed the modernize-python-package-setup branch from fccb68b to 1cfb4fa Compare August 2, 2026 13:45
Alicipy added 2 commits August 2, 2026 15:48
Poetry 1.x rejects a pyproject.toml without [tool.poetry], and 2.0
skips the PEP 735 dev group, leaving the test job without pytest.

Signed-off-by: Stefan Kraus <dev@stefankraus.org>
Installing, locking and building all changed with the metadata,
so the contributing guide spells the commands out.

Signed-off-by: Stefan Kraus <dev@stefankraus.org>
@Alicipy
Alicipy force-pushed the modernize-python-package-setup branch from 1cfb4fa to 76b9c4d Compare August 2, 2026 13:48
@Alicipy

Alicipy commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

I have split the docs out, and integrated the CI work from @fkromer.

I kept it tool agnostic for now. While I personally also like uv, I do not want to break any workflow that is preferable by the maintainers currently, but would help migrating further if wanted :)

Thanks for the work on pytm so far!

@fkromer

fkromer commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@Alicipy Providing better backwards compatibility is a good idea 😁 the rather oldschool pdoc3 is docs only… not really relevant to me.

@izar

izar commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Just a thought - I think it would make sense to remove the poetry stuff from CONTRIBUTING.md - we don't need to give instructions for another package that may diverge over time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants