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 PEP 621 compliant pyproject.toml #38

Merged
merged 1 commit into from
Jan 26, 2025

Conversation

andreasgerstmayr
Copy link
Contributor

  • Use PEP 621 compliant pyproject.toml
  • Update README to add instructions how to generate the example reports

'scipy >= 1.13.1',
'beanprice >= 1.2.1',
'pandas-stubs >= 2.2.2.240514',
'matplotlib-stubs >= 0.2.0',

Choose a reason for hiding this comment

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

pandas-stubs and matplotlib-stubs are required only for type checking, not at runtime, therefore it is not necessary for users to install them. I'll leave these out or I'll add them to a dev extra dependencies group. My preference would be to leave them out as other development dependencies are not listed.

Copy link
Member

Choose a reason for hiding this comment

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

SGTM @dnicolodi I'll merge this quick and try it out though, can be done later

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, I overlooked this when I converted it from poetry to PEP 621.
I've created a follow-up PR #39 to fix this and also added ruff and mypy to the dev dependencies.

@blais blais merged commit 9021218 into beancount:master Jan 26, 2025
@blais
Copy link
Member

blais commented Jan 26, 2025

Still doesn't work with uv, I think the problem is my pypi auth token.
This is why I never bother with packaging
Now I have to chase down another token problem

@dnicolodi
Copy link

That's why I do all releases from CI 🙂 Trusted Publishers remove the need to care about access credentials to PyPI. I recently updated benagulp and beancount to use that.

@blais
Copy link
Member

blais commented Jan 26, 2025

I don't know it feels every time I have to use PyPI I have problems

@blais
Copy link
Member

blais commented Jan 26, 2025

Found it. Token was buried deep elsewhere.
But now it's unhappy about license-file usage, and we don't use it.
(Why does packaging universally sucks so bad?)

  Caused by: Upload failed with status code 400 Bad Request. Server says: 400 license-file introduced in metadata version 2.4, not 2.2. See https://packaging.python.org/specifications/core-metadata for more information.

@blais
Copy link
Member

blais commented Jan 26, 2025

Here's the problem
astral-sh/uv#9513

Somehow @dnicolodi you're mentioned on the root cause issue
pypa/setuptools#4759

Anyhow, I used the workaround.
Managed to cut a release.

@dnicolodi
Copy link

It is a setuptools bug pypa/setuptools#4759.

Very recent twine releases have a work around for it. It is however not a bad idea to have setuptools generate valid metadata: add this to pyproject.toml:

[tool.setuptools]
license-files = []

@dnicolodi
Copy link

Somehow @dnicolodi you're mentioned on the root cause issue

I hope they are saying good things 😄 I've been doing some work on the packaging tools recently

@andreasgerstmayr
Copy link
Contributor Author

Thank you both! 💯

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