-
Notifications
You must be signed in to change notification settings - Fork 12
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
Start using hatch for Python project management #241
Conversation
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.
Hey, sorry for taking so long. Been quite busy with other projects.
This looks ok to me. Though I can't help but wince at just how many different ways there are to do something like this 😅
I can't say I know how this improves things either, but I'm happy to take your word for it. Frankly I have no horse in this race.
Part of me would like to have kept an historical record of what the clean setuptools version was in case we had to roll back for whatever reason, instead of changing tooling and resulting package in one go. It's too minor though, up to you.
Need a small update to my packaging I guess, no impact beyond that.
No worries at all!
I know!
The main thing for me is reducing the number of tools for building/uploading, with fewer sharp edges, maybe using it to replace the
Yeah, I also felt a bit like too much at once, but it's non-zero effort to convert to pyproject.toml with setuptools. Maybe I'll have another look at that, but if it's too much trouble, I'll just merge this.
What's that, out of curiosity? |
Yup, sounds good!
Here, Nothing special... I know someone else has installed the package at some point because I got a complaint it was out of date once, but not too popular yet 😅 |
This will be helpful for comparing the package build results in the subsequent changes, as some tools sort the PKG-INFO no matter what.
Switch to a more standards compliant license short identifier: https://spdx.org/licenses/BSD-2-Clause.
Prefer pyproject.toml over setup.cfg for packaging. The changes in the build results are minimal, only PKG-INFO changes: -Home-page: https://github.com/jnikula/hawkmoth -Author: Jani Nikula -Author-email: [email protected] +Author-email: Jani Nikula <[email protected]> License: BSD-2-Clause +Project-URL: Homepage, https://github.com/jnikula/hawkmoth Flake8 configuration remains in setup.cfg.
Start using hatch [1] for the project management. Due to hatch defaults, we'll need to add explicit include/exclude rules for some files, e.g. include setup.py and exclude Makefiles. Due to setuptools defaults [2], we've included some files from test/ as well as the generated hawkmoth.egg-info in the source tarball. Drop them. [1] https://hatch.pypa.io/latest/ [2] https://setuptools.pypa.io/en/latest/userguide/miscellaneous.html
Use hatch build and publish, remove old build-tools target, remove old .gitignore and distclean files. The build and upload targets could perhaps be removed in the future in favour of using hatch directly, but keep them for now.
Wasn't too bad actually, and I compared the build results after each commit.
Heh, though I did mean what changes are required due to this? |
Oh, don't know. But I expect I need to tweak the PKGBUILD a bit. So (e.g.) in the official release package change the build and install lines I guess. |
I think it should actually work as-is.
tells |
Hmm, even better then! I saw |
@BrunoMSantos Pushed, please let me know if you hit any issues with packaging! |
@BrunoMSantos Oh, might as well ask here about one thing. What to do?
|
Had to read up on this a bit.
Of the 3, I think this is the one. There might be other 3rd party tools that don't yet support the toml one and we might need to extend it before we get rid of it.
I'm fine with this as a 2nd best option.
Please, no 😅 But here's another option just in case: use pyflakes, pycodestyle and mccabe directly. Pycodestyle supports the toml file and I don't think we will be configuring pyflakes or mccabe away from any default, but they may support the toml file too 🤷♂️ Honestly, I never use the flake8 wrapper in my own projects, so I'd switch in a heartbeat. I even had to hack my configs for those few projects I work on that use flake8. And now you know xD |
I don't think pycodestyle supports pyproject.toml, though: https://pycodestyle.pycqa.org/en/latest/intro.html#configuration Also has the same maintainer as flake8, so would be suprising if it did.
👀 |
Hmm, could have sworn it was supported. Maybe the project I saw it in was using some other tool to bridge the gap like the one you pointed out for flake8, maybe I just remember wrong. Sorry for the misdirection then :/
Can't say I blame him either way, I did mention the wincing 😅 |
No problem. And thanks for the discussion. I think I'm just going to do nothing about this. |
Hatch seems more user-friendly than setuptools and twine, and offer more stuff like environments (which could replace the
venv
thing in the future).I don't think this should make a difference to contributors or users.