Skip to content

Convert to hatch and pyproject.toml #78

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

Merged
merged 1 commit into from
Aug 6, 2025
Merged

Conversation

nicoddemus
Copy link
Member

@nicoddemus nicoddemus commented Aug 5, 2025

  • Converted setup.py to pyproject.toml: used hatch new --init and manually added hatch-vcs configuration.

  • Updated hynek/build-and-inspect-python-package -- in the end this was the original problem.

  • Added dependabot.yml configuration to avoid this problem in the future.

Follow up to #77.

@RonnyPfannschmidt
Copy link
Member

Let's completely switch over something is getting confused

@nicoddemus
Copy link
Member Author

Does anybody know of a tool that can do that automatically? Not looking forward to it manually. 😁

@RonnyPfannschmidt
Copy link
Member

@RonnyPfannschmidt
Copy link
Member

imho this is fine to go to hatch :)

@RonnyPfannschmidt
Copy link
Member

@nicoddemus i can do it sometime tommorow if you dont get to it today

@Pierre-Sassoulas
Copy link
Member

Pierre-Sassoulas commented Aug 5, 2025

It's also possible to do a migration to setup.cfg first, then use an ini to toml conversion, it's two steps but historically it make sense. (I can do it too if you want)

@RonnyPfannschmidt
Copy link
Member

@Pierre-Sassoulas why do 2 step when 1 step tools are avaliable?

@nicoddemus
Copy link
Member Author

nicoddemus commented Aug 5, 2025

Thanks @RonnyPfannschmidt for the tip!

Hmmm still failing... weird, it worked just fine for me locally:

  • dist\pytest_reportlog-0.4.1.dev40+g3c5a7b2.d20250805.tar.gz
  • dist\pytest_reportlog-0.4.1.dev40+g3c5a7b2.d20250805-py3-none-any.whl

I used hatch build and python -m build, both generated commands generated releases 0.4.1.dev*.

@RonnyPfannschmidt
Copy link
Member

I suspect cache poisoning

@nicoddemus
Copy link
Member Author

nicoddemus commented Aug 5, 2025

Created another job which builds the package manually and it passes: https://github.com/pytest-dev/pytest-reportlog/actions/runs/16763542482/job/47464059761?pr=78

Seems related to hynek/build-and-inspect-python-package... updating it.

@nicoddemus
Copy link
Member Author

💥 it was just a matter of updating hynek/build-and-inspect-python-package then.

* Converted setup.py to pyproject.toml: used `hatch new --init` and manually added `hatch-vcs` configuration.

* Updated `hynek/build-and-inspect-python-package` -- in the end this was the original problem.

* Added `dependabot.yml` configuration to avoid this problem in the future.

Follow up to #77.
@nicoddemus nicoddemus changed the title Add pyproject.toml file Convert to hatch and pyproject.toml Aug 5, 2025
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It permits to not have to learn another tool if like me you already did multiple setup.cfg migration before :) (and hatch need some cleanup to reinstate something simple and stupid like setuptools at the end). Or we can keep hatch but the python packaging ecosystem would benefit from less choice imo.

@@ -0,0 +1,54 @@
[build-system]
requires = ["hatchling", "hatch-vcs"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have to keep hatch it was only for the migration, right ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually keeping it us nice for pure python its much nicer than setuptools

And its way easier to maintain

@nicoddemus nicoddemus merged commit 4509e68 into main Aug 6, 2025
12 checks passed
@nicoddemus nicoddemus deleted the add-pyproject.toml branch August 6, 2025 11:43
@nicoddemus
Copy link
Member Author

Thanks folks!

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.

3 participants