Skip to content

Use poetry instead of setuptools

Elsie Hupp requested to merge elsiehupp/pyxdg:poetry into master

Poetry is a PEP-517-compliant alternative to setuptools and is consequently a preferred build-management system for PyPI. Poetry also simplifies and consolidates the files involved in packaging for PyPI, specifically.

Because README is rendered from Markdown or reStructuredText on the front page of a project on both PyPI and Gitlab, I converted the README to use Markdown. PyPI does not render README from by default (though it's possible to use a custom function to include it dynamically), while Poetry does not require any additional code to include the README (among other bits of metadata). This should fix the missing description area on the pyxdg PyPI page and improve the general searchability of the package. It also seems to be common practice to include short code example snippets in the README on PyPI, but that can wait for the time being.

Additionally, I moved COPYING into the package folder and replaced the copy in the top-level directory with a symbolic link to the copy in the package folder, so that COPYING remains part of the package when it is installed (and doesn't need to be included separately).

I haven't figured out running unit tests through Poetry, but I didn't change any of the source files themselves. It would probably be most useful to test an installed version of the package rather than just the source code itself, but I'm not quite sure how to do that. It would probably also be useful to upload this to the PyPI test server and test the version installed from there, as well, but I would rather figure out local tests before I try and test a version installed through pip.

Merge request reports