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

Update package metadata #2398

Closed
wants to merge 1 commit into from
Closed

Conversation

ofek
Copy link

@ofek ofek commented Mar 20, 2022

Background

Hello there! The Python packaging ecosystem has standardized on the interface for build backends (PEP 517/PEP 660) and the format for metadata declaration (PEP 621/PEP 631). As a result, the execution of setup.py files is now deprecated.

So, I'm spending my free time updating important projects so that they are modernized and set an example for others 😄

Summary of changes

This implements PEP 621, obviating the need for setup.py and MANIFEST.in. The build backend hatchling (of which I am a maintainer in the PyPA) is now used as that is the default in the official Python packaging tutorial. Hatchling is available on all the major distribution channels such as Debian, Fedora, Arch Linux, conda-forge, Nixpkgs, Alpine Linux, FreeBSD/OpenBSD, Gentoo Linux, MacPorts, OpenEmbedded, Spack, etc.

Notes

Version location

The version is now stored in web3/__init__.py, removing the need for pkg_resources and thus reducing import time of web3 by ~400ms for me locally.

Source distribution

The ones on PyPI are erroneously shipping a build artifact *.egg-info from pip install -e .:

sdist

Also, the old MANIFEST.in was trying to ship a requirements.txt but there is no such file, only requirements-docs.txt.

Both of these issues are now fixed.

Cute Animal Picture

Nala

@ofek ofek force-pushed the modernize-metadata branch 6 times, most recently from d228c21 to a7ab903 Compare March 20, 2022 21:12
@kclowes
Copy link
Collaborator

kclowes commented Mar 21, 2022

Thanks for this PR! We have a few other things that are higher on our priority list at the moment, so it may take us a bit to review this.

@ofek ofek force-pushed the modernize-metadata branch 3 times, most recently from 967df19 to 2420fd5 Compare August 21, 2022 15:37
@ofek
Copy link
Author

ofek commented Aug 21, 2022

@kclowes There was a conflict so I rebased 🙂

@ofek
Copy link
Author

ofek commented Aug 23, 2022

CI is passing btw

@ofek ofek force-pushed the modernize-metadata branch 2 times, most recently from 1d612d2 to d84bd20 Compare September 4, 2022 03:25
@ofek
Copy link
Author

ofek commented Sep 4, 2022

@kclowes Your PR #2622 caused many conflicts so I rebased again

@ofek ofek force-pushed the modernize-metadata branch from d84bd20 to 5849898 Compare September 11, 2022 03:09
@ofek
Copy link
Author

ofek commented Sep 11, 2022

@kclowes PR #2630 caused another conflict so I rebased again

@ofek
Copy link
Author

ofek commented Sep 11, 2022

cc @fselmo

@ofek
Copy link
Author

ofek commented Sep 11, 2022

same errors on master

@ofek ofek force-pushed the modernize-metadata branch from 5849898 to 49e6d7e Compare September 12, 2022 19:20
@ofek
Copy link
Author

ofek commented Sep 12, 2022

rebased, now passing

@kclowes
Copy link
Collaborator

kclowes commented Sep 12, 2022

Thanks @ofek. Once we get The Merge changes out the door across our libraries we'll take a look. Thanks for your patience!

@ofek ofek force-pushed the modernize-metadata branch from 49e6d7e to 4b48880 Compare September 17, 2022 13:16
@ofek
Copy link
Author

ofek commented Sep 17, 2022

@kclowes Good job with The Merge! I rebased to resolve the conflict with your PR #2623

@ofek ofek force-pushed the modernize-metadata branch from 4b48880 to 3796e60 Compare September 21, 2022 02:46
@ofek
Copy link
Author

ofek commented Sep 21, 2022

@kclowes I rebased to resolve the conflict with your commit to master 1be0745

@ofek ofek force-pushed the modernize-metadata branch from 3796e60 to 8e3806a Compare September 22, 2022 22:45
@ofek
Copy link
Author

ofek commented Sep 22, 2022

@kclowes @pacrob I rebased to resolve the conflict with this PR #2657

@ofek ofek force-pushed the modernize-metadata branch from 8e3806a to a5d6a78 Compare October 8, 2022 21:53
@ofek
Copy link
Author

ofek commented Oct 8, 2022

@kclowes @fselmo @pacrob I rebased to resolve the conflict with this commit to master 14cb121 and this PR #2671

I don't know how much longer I can keep doing this 😅

@ofek ofek force-pushed the modernize-metadata branch from a5d6a78 to b4e9798 Compare October 17, 2022 03:04
@ofek
Copy link
Author

ofek commented Oct 17, 2022

@kclowes @fselmo @pacrob I rebased to resolve the conflict with this PR #2666

@pacrob
Copy link
Contributor

pacrob commented Oct 19, 2022

Hi @ofek. I'm sorry we've been so long in getting back to you. We discussed your proposal today and decided that we are going to stick with our current process at this time. For future proposals, please open an issue first so we can discuss changes without putting so much work into it first.

@pacrob pacrob closed this Oct 19, 2022
@ofek
Copy link
Author

ofek commented Oct 19, 2022

Okay! Can you provide any details about why?

@pacrob
Copy link
Contributor

pacrob commented Oct 19, 2022

Yep. We know our current process and it works well. Hatchling does look good, but there's no compelling reason make the change.

@ofek
Copy link
Author

ofek commented Oct 19, 2022

What about setuptools + removing setup.py?

@ofek ofek deleted the modernize-metadata branch October 23, 2022 16:34
@pacrob
Copy link
Contributor

pacrob commented Oct 24, 2022

You are correct, we do have room for improvement. We have talked about removing setup.py and making more use of pyproject.toml, and plan to revisit our build process in the new year. But we have a dozen or so libraries that we want to standardize the process for, and right now we're focused on getting v6 out.

We do absolutely appreciate your contributions! Again, in order to allow us to fit things into our roadmap, please introduce ideas as Issues so they can be discussed first. Thank you!

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