Modernize python package setup - #331
Conversation
3a02cec to
549244d
Compare
|
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. |
973251f to
fccb68b
Compare
|
@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. |
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>
fccb68b to
1cfb4fa
Compare
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>
1cfb4fa to
76b9c4d
Compare
|
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! |
|
@Alicipy Providing better backwards compatibility is a good idea 😁 the rather oldschool pdoc3 is docs only… not really relevant to me. |
|
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. |
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.