mdshw5 / pyfaidx

Efficient pythonic random access to fasta subsequences
https://pypi.python.org/pypi/pyfaidx
Other
449 stars 75 forks source link

Switch to pyproject.toml #200

Closed marcelm closed 1 year ago

marcelm commented 1 year ago

This was suggested in #186.

This converts pyfaidx to the "modern" way of setting metadata for Python projects (see PEP 621: Storing project metadata in pyproject.toml for details).

setuptools has introduced support for this in version 61, and it appears to be stable now.

Some tutorials that were helpful:

Also, the setuptools-scm configuration needed to be converted from how it’s done in setup.py, but this is documented well at https://github.com/pypa/setuptools_scm/.

Since this removes setup.py, the README was updated to no longer recommend python setup.py install. Similarly, python setup.py sdist no longer works. Instead, the build tool needs to be used. This can be done with pip install build && python -m build (or "pipx run build" if pipx is available, as on the GitHub runners).

Note that build produces both an sdist and a wheel file where previously only an sdist was generated. The pypa/gh-action-pypi-publish action will then publish both to PyPI.

My original motivation for submitting this PR is actually mainly this last bit: I noticed that when installing WhatsHap via pip install, pyfaidx (which we have as a direct dependency) is the only package that does not provide a wheel, which makes the installation a tiny bit slower than it could be.

Additional changes:

Closes #186

marcelm commented 1 year ago

Test failures should be fixed by merging #199.

mdshw5 commented 1 year ago

Thank you for dragging me into the modern python packaging ecosystem 😄! I'll merge these changes ASAP.