podman-py
podman-py copied to clipboard
[wip] Migrate the project to pyproject.toml
This is a WIP pr. before getting merged I expect a lot of changes and reviews. The automation, release process and gating will need to be tested as well before going.
Changes introduced by this PR:
- package definition and dependencies are incorporated in pyproject.toml.
package management is now done by hatch as suggested by the python docs.
- building rpms will be handled via hatch
- where not possible to use hatch (such as Centos Stream 8) it will use flit
- things like testing requirements are now handled a bit differently. the testing packages are now specified in a dev environment which is now entirely managed by hatch.
a big advantage of that is how the requirements are defined. now, it is sufficient to do
hatch shellto get to the dev environment and have all the necessary tools in the virtual shell (the ones defined in test-requirements.txt). the environment where tests run is also better defined this way. with this PR, only the packages needed for testing are pulled. packages such as linting tools and pre-commit are not included in the testing env. setup.py,setup.cfg,*requirements.txtare no longer needed.
- pre-commit is now used to run black, isort, pylint. all these checks are incorporated in one tool: ruff. the single pre-commit hook will check linting and formatting in the same environment, limiting the opinionated issues that happen from here and there and alolowing to drop more dependencies that cause issues from time to time.
- Consequently, cirrus does not require lint checks anymore since they are delegated to a separate check in pre-commit which is run in a gh workflow
- no more tox. this hurts but the way tox was used is to run lint, black, and coverage steps. as noted above, lint and black are now handled specifically. now, tox is used to handle virtual environments only and to run coverage tests. this is perfectly implemented in hatch, so since we are switching the build backend why don't use it's builtin testing capabilities too? this also have some performances improvement, but I'd need to do some more research on that.
- Packages that can be dropped
- setuptools
- sphinx (not really dropped but more like split in the [docs] package
- wheel
- black
- pylint
- tox
- Packages that are added
- hatch (build backend, replaces setuptools/wheel)
- pre-commit (already used in many projects and pulled separately online)
- ruff (pulled by pre-commit, replaces black, isort, pylint)
- Packages that can be dropped
- drop python 3.6 and 3.8 from UPSTREAM. reasons:
- we are not testing it anyway with tox which dropped the support in 2021
- python 3.8 will stop the support of the security features in 2 months from writing this comment, so we could remove it already in my opinion
Important missing parts that I am still figuring out how to wire up:
- Package RPM upstream
- requests-mock is limited by a version that is not released in fedora. This forbids from using a dependency check in the specfile. At the present time, this issue has a workaround which removes the minimum requirements. It worked locally but let's see how it behaves on GH
- Package RPM for CentOS 8
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: inknos
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [inknos]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Closing in favor of this issue which will track all the steps one by one. https://github.com/containers/podman-py/issues/474
Too many steps in a single PR