Description
Howdy,
I decided to catch up on the PyPA packaging world on all my projects today and feel there is room for a section in build's docs to describe the ways to start a new project and/or move from traditional setup.py
project to a build
project.
If this is not the goal of builds docs and it's somewhere else, how can we make it easier to find? It's very hard to find and answer "How should I build a new Python prokject in 2022" ... I know there is lots of legacy etc. here but making this easier to find and link to should help new projects adopt these things. I did see pip makes mention from googling
I also got recommendations that are not mention in the docs (unless I'm blind which there is a chance). My example here was adding a section to pyproject.toml - So I feel we should mention that somewhere. My suggestion was:
[build-system]
# setuptools 43 includes pyproject.toml
requires = ["setuptools>=43"]
build-backend = "setuptools.build_meta"
- I guess we could link to pip: https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/
Suggested Overview
(I will update as discussion suggests etc.)
- Quickstart:
- Create a setup.cfg (link to https://setuptools.pypa.io/en/latest/userguide/declarative_config.html)
- Give a small example
- Note that
setup.py
is supported today but is deprecated
- Get
build
installed into your [virtual] environment- Remove build dependencies from you CI / main environment due to builds dedicated venv creation
- Create a
pyproject.toml
- Show minimum example toml file
- Link to detail explanation of the toml options for build: https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/
- How to test build succeeded
python -m build
- See a sdist + wheel
- Install in a venv
- Create a setup.cfg (link to https://setuptools.pypa.io/en/latest/userguide/declarative_config.html)
- Extra:
- Maybe add a flow diagram of build's process
(Totally up for reasoning - Thus the issue before the PR)
Side Questions
- Is the metadata in setup.py's long term goal to be in setup.cfg?
Please lets focus on the quick start and open other issues for other docs enhancements that come from this discussion, if they do.