Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pyproject.toml to allow building sdist, wheel
This allows anyone to `python -m build` an sdist or wheel for Hancho. In particular, if @aappleby decides to put hancho on PyPI, they should be able to use this config as-is. Rationale: Making Hancho available on PyPI allows anyone to install and update Hancho via `pip install` or whatever dependency management system they like. This is mainly for people who prefer to keep `hancho.py` in a separate location on their `PATH` separately from their own development tree, and have it updatable via `pip`. Having a PEP-517-conformant `pyproject.toml` also allows system package maintainers to package Hancho for their distribution with little modification. Design: To keep aligned to Hancho’s project mission, this particular `pyproject.toml` is specifically designed to let `hancho.py` remain an independent standalone script in the project root. In other words, users will still be able to pick just the `hancho.py` file and copy it into their project development tree as-is, without caring about `pyproject.toml` or anything else if they prefer so. Implementation note: In contrast to other build backends like setuptools, which would have required `hancho.py` to go in a subdirectory that matches the package name, poetry-core supports building a package from a single-file `*.py` module even if it lives in a project root directly, i.e. next to `pyproject.toml`. This is to make sure that `hancho.py` remains a portable, self-contained script that doesn’t require PyPI, pip, or anything else, and can be copied as-is anywhere you like. One real-life example of a working system package using the Poetry backend is the `hancho` AUR package. [1] [2] [3] Addresses aappleby#1. [4] [1]: https://aur.archlinux.org/packages/hancho [2]: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=hancho [3]: https://aur.archlinux.org/cgit/aur.git/tree/pyproject.toml.template?h=hancho [4]: aappleby#1
- Loading branch information