-
Notifications
You must be signed in to change notification settings - Fork 517
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
Migrate config files into pyproject.toml #3328
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3328 +/- ##
=======================================
Coverage 95.17% 95.17%
=======================================
Files 83 83
Lines 18571 18571
=======================================
Hits 17675 17675
Misses 896 896 |
Without claiming to know much about this, the brief history seems to be
So "pyproject.toml is a Poetry-specific thing" is only the case to the extent of "pyproject.toml is a non-setuptools thing", as I understand. See also the setuptools issue titled "Eventually deprecate Things move slowly in the packaging world, but |
@akaszynski should also weigh in here I think. |
I'd like to completely migrate to Personally, I used to prefer I think |
I don't know if I'm on board with this... you and I may have to chat offline, so I understand all of this better. As of right now, All of this is new territory for me, so I'm happy to embrace what others think is best here. But I do want to move as many configs into a single file as possible. Should I change this PR to move everything into |
Preferably. I can show what we've done for pyansys. There's a team of ~7 people dedicated to figuring out python packaging and I think we've done our homework in this regard. I too agree that
Agreed. Whatever conclusion we come to I'll post it here and the rest of the core team can weigh in. |
Sounds good, I will update this PR to use pyproject.toml and we'll chat whenever |
Switched to |
Merking as ready for review to get some fresh eyes on this so we can go ahead and wrap it up |
According to its readme
(emphasis mine). I haven't checked but that package doesn't ring a bell. |
That package is installed locally for me but codespell doesn't register the pyproject.toml still |
This looks good to me in general. It looks like we have to wait for a new codespell version to be released to implement this, or semi-dangerously move to a git dev-branch based install. I think we need to add tomli to the pre-commit hook install too: pyvista/.pre-commit-config.yaml Lines 22 to 29 in bf82d18
I'm not really sure how the pre-commit hooks decide on dependencies, but pip based install could use |
Codespell v2.2.2 was released and this should be good to go. Admittedly, I don't use pre-commit very often so someone should probably doubly check that everything is working as expected. |
I fixed codespell, but I'm not sure flake8 supports pyproject.toml. see https://flake8.pycqa.org/en/latest/user/configuration.html#configuration-locations and this package https://github.com/john-hen/Flake8-pyproject. I know nothing about this later package other than it claims to fix this issue. |
Doing a bit more digging, it looks like the maintainer(s) of The tools that wrap flake8 to support it seem flaky in that they require various patching techniques and/or merging upstream changes. I would unfortunately recommend removing flake8 entirely from this PR. |
One of the greater objections seemed to have been the lack of an stdlib toml parser. I wonder if they'll reconsider in light of https://docs.python.org/3.11/library/tomllib.html#module-tomllib new in 3.11. Actually, the last comment addresses this PyCQA/flake8#234 (comment). Tl;dr waiting for pip to change behaviour (which is unlikely to happen). |
I've moved the Flake8 config back to it's own I belive this PR is ready to merge as of now... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good to go. I'd like for us to move fully to away from setup.py
and to pyproject.toml
.
Another move I'd like to make is the move of pyvista
into the src
directory. This would eliminate issues like testing the "local" directory instead of the installed library.
Ooo... I don't know about this one... we'll have to chat or open an issue with a detailed justification |
There are a lot of files at the root level of the repository. I thought it'd be nice to embrace
setup.cfg
(and try to move away frompyproject.toml
) to combine many of these files into a single configuration. Unfortunately, Black has a very harsh stance on not supportingsetup.cfg
(see psf/black#683 (comment) and previous comments.... I guess harsh opinions are what you get when you use an "uncompromising code formatted")This paired with #3327 should clean up the root level of the repository a bit
Note: I wish we could drop
pyproject.toml
altogether as it leads to a lot of headaches and I think conflicts withsetup.cfg
(isn'tpyproject.toml
a Poetry-specifc thing? I don't really know anything about this...)