-
Notifications
You must be signed in to change notification settings - Fork 277
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
build: add PEP-517 build config with Poetry #557
Conversation
Hello, thanks for tackling this! The use of Poetry doesn't seem mandatory: could we use something minimal, even if files are not automatically generated? (For example @DimitriPapadopoulos mentioned keeping Also I see some problems, e.g. inconsistencies in Python version dependencies (3.6+ vs. 3.7+), no more command to build documentation, the duplication of the yamllint version in multiple files. Finally, the impact of this to distro packaging (.rpm, .deb, etc.) should be kept as fluent as possible. |
I tried in this PR to make a minimal change to be compliant with new PEP-517. But you have all valid points. About setuptools.. It is possible to keep, but did not understand, why do you want to keep it? About duplicated version.. New packages only use pyproject.toml to control the version. I did not remove it from init file for a simple reason that you still support python 3.7. From 3.8 it is just add importlib-metadata and you are good to go with version. There is also a backport for python 3.7 but all projects I work on already dropped 3.7 since it is 2 months for EOL https://endoflife.date/python For documentation build I am not sure how you want to go. I usually just add a simple requirements.txt on my docs folder and build from there on github actions. You can also see as example any of my python repos. I did not dig yet how you are doing other packages. Do you have any suggestions regarding the changes I did regarding that topic? |
I also dislike poetry and use setuptools-scm instead, I could probably make a PR that make uses of it. |
1c9e1de
to
492518f
Compare
@adrienverge just in case I addressed in this PR the issue regarding docs build and version management (now it is only part of pyproject.toml as recommneded - it will only install importlib_metadata as dependency for Python <3.8). This is basically how it is working in all projects I am currently maintainer. If setuptools is must then |
I am under the impression that setuptools is not considered more standard than poetry nowadays. Yet, I would prefer setuptools too, together with setuptools_scm to extract the version. |
Actually I don't understand the preference on continuing to use Pros of poetry for me:
I don't really have cons. |
Speaking for myself, I guess I am getting tired of the continuous changes and instability around Python. As if the necessary Python 2 to Python 3 migration was not enough, I now have to spend excessively much time adapting to continuous changes in the Python development and packaging environment. It is a complete mess – although I understand this is an effort to move from the current mess to a better future. As a result, I think I have a strong personal bias against such continuous breaking changes, and arguments in favour of such changes. That said, changes do happen nevertheless out there, I cannot ignore them for ever 😄
|
Hello, and thanks for these valuable inputs! I have more or less the same fears as @DimitriPapadopoulos (but maybe I'm wrong): Poetry is actively maintained, but what about in 10 years? I prefer stability over features. Yamllint dependencies are kept simple on purpose (just PyYAML + pathspec, always the last version): could a fully-featured dependency management tool like Poetry be overkill? In any case, the next packaging system should:
Would setuptools + setuptools_scm allow lighter configuration? |
Flake8 config is the only one that cannot be moved, mainly because current maintainer did not want to add support for it. Anyway, I think that flake8 days are numbered, as ruff is getting traction at huge speed. I started using it few days ago and I was amazed. I will be using it in parallel with flake8 for at least two months before removing flake8. Anyway, that is bit diverging from the subject but I imagined that you could find the information useful. And, yep, that one uses |
@ssbarnea good to know, thanks 👍 I just tried it but it doesn't support configuration in |
Also interesting for me.. i will keep an eye on ruff. UPDATE @adrienverge I fixed errors on CI/CD of missing dependency and also a replace. |
f611d5e
to
da0cd83
Compare
Thanks for the updated code @staticdev 👍 It looks like tests still won't start. In the meantime, I'll work on a setuptools version of |
Using `setup.py` is deprecated and the new recommanded way is to declare a `pyproject.toml` file (see PEP 517 [^1]). This commit proposes to use setuptools to achieve that, because setuptools is already used by yamllint, is standard and referenced by the official Python packaging documentation [^2], and seems to be the most lightweight solution. An alternative could have been to use Poetry, see the dedicated pull request and discussion [^3]. For some period, the `setup.py` file will be kept (although almost empty), to allow old tools versions to keep working. Closes #509. [^1]: https://peps.python.org/pep-0517/ [^2]: https://packaging.python.org/en/latest/tutorials/installing-packages/ [^3]: #557
I opened #565 and #566 to upgrade from First of all, thanks for this Poetry version @staticdev, I appreciate the work done. But after testing with setuptools, I see multiple reasons to use the latter:
You can see how it looks here: #566. |
da0cd83
to
b654154
Compare
b654154
to
10cc81a
Compare
@adrienverge I have rebased based on your changes. Could you run CI again? |
10cc81a
to
fb8b01c
Compare
fb8b01c
to
cb37f04
Compare
cb37f04
to
b23f673
Compare
I think when you remove setup.py from your PR you will also need coverage[toml] otherwise it will not fetch config @adrienverge |
Using `setup.py` is deprecated and the new recommanded way is to declare a `pyproject.toml` file (see PEP 517 [^1]). This commit proposes to use setuptools to achieve that, because setuptools is already used by yamllint, is standard and referenced by the official Python packaging documentation [^2], and seems to be the most lightweight solution. An alternative could have been to use Poetry, see the dedicated pull request and discussion [^3]. For some period, the `setup.py` file will be kept (although almost empty), to allow old tools versions to keep working. Closes #509. [^1]: https://peps.python.org/pep-0517/ [^2]: https://packaging.python.org/en/latest/tutorials/installing-packages/ [^3]: #557
Closes #509