Skip to content
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

use pyproject.toml #19

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

use pyproject.toml #19

wants to merge 4 commits into from

Conversation

sigma67
Copy link
Contributor

@sigma67 sigma67 commented Dec 4, 2024

A little modernization of the project root. To make CI installation work I used pdm to install the dev-dependencies (aka dependency-groups: https://peps.python.org/pep-0735/)

@madebr
Copy link
Owner

madebr commented Dec 4, 2024

Thanks for the suggestion, but the pdm.lock file is too complicated and contains version dependent information.
I also don't see what improvements pyproject.toml brings on top of setup.py/setup.cfg.

If you can explain me why pyproject is better, I'm okay with accepting that part.
Will the release.yml workflow still work with pyproject?

@sigma67
Copy link
Contributor Author

sigma67 commented Dec 4, 2024

pyproject.toml is the new standard for Python projects. All tools (pytest, pylint etc.) are migrating towards this as the configuration file.

It replaces setup.py and other methods of configuration: https://packaging.python.org/en/latest/guides/writing-pyproject-toml/

The content of the lockfile is not that important, it just pins specific versions of mypy and pytest for installation so everything stays the same even when new versions are released. It is possible to remove the lockfile, pdm will just create it on the fly then (see my second commit - no lockfile, pipeline green).

Originally I did not want to add pdm to keep it simple, but you need some kind of dev-tool to install dev-dependencies. Well-known alternatives are poetry, hatch, rye.

You're right about the release workflow - it needs a slight adjustment, I will fix it tomorrow.

@madebr
Copy link
Owner

madebr commented Dec 4, 2024

Thanks for the updates!

Can you remove the pdm related changes?
To be honest, me (and the project) does not care about pinning versions.
This project has not many dependencies and should run on both oldest and newest python.
For example, I don't really care whether the tests are run on pytest 8.3.4 or an older 7.x.

I think it's the job of applications, not libraries, to pin to exact versions (within reason)

@sigma67
Copy link
Contributor Author

sigma67 commented Dec 5, 2024

I can remove the lockfile but you will need some kind of tool to install the dev dependencies with

pip can't do it based on pyproject.toml (yet). Feel free to suggest something else

@madebr
Copy link
Owner

madebr commented Dec 5, 2024

I can remove the lockfile but you will need some kind of tool to install the dev dependencies with

pip can't do it based on pyproject.toml (yet). Feel free to suggest something else

Wouldn't it be better then to wait with merging this until pip has pyproject.toml support?
Does upstream have a bug ticket tracking this?

@sigma67
Copy link
Contributor Author

sigma67 commented Dec 6, 2024

pip supports pyproject.toml, but not installing specific groups only: pypa/pip#12963

@madebr
Copy link
Owner

madebr commented Dec 7, 2024

Would you be fine with waiting for merging this until pip gets support?
I'd like to keep the build process standard and simple.

@sigma67
Copy link
Contributor Author

sigma67 commented Dec 12, 2024

Sure, it's up to you. Be aware that the answer may well be never though - given pip maintainers' reluctance to allow users to install specific groups only

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.

2 participants