question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add "Quickstart" + "Move from setup.py" section to build's docs

See original GitHub issue

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"

Suggested Overview

(I will update as discussion suggests etc.)

(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.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
henryiiicommented, Feb 7, 2022

I’d rather have (better?) links to packaging.python.org, I don’t think we need to explain how to set up a package. Some updates could be made there (I’ve been really hoping for a PEP 621 update, but that’s waiting on setuptools, which is happening at some point). Those docs could take some of the ideas, though - I’d really like to see better pipx run usage, personally, which skips most of the messy environment handling.

If we have the same docs in many places, we have to maintain more, versions go out of date, etc. Build is not tied to a specific backend, either - maybe link to some popular backend docs (setuptools, flit)?

A few notes:

setup.py is not deprecated. It’s the only way to do non-metadata related tasks, like setting up extension compiling, etc. It’s just recommended to statically define metadata. And I believe setup.cfg will be deprecated for pyproject.toml & PEP 621 config (very long term, but happening in a PR now).

[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

is a minimum pyproject.toml. Though I’d probably recommend flit & PEP 621 config over setup tools for non-compiled projects.

1reaction
laydaycommented, Feb 7, 2022

How about:

build is a standards-based tool for generating Python package distributions. If you have a setuptools project and would like to start using build, create a pyproject.toml with: <snip>. If you are interested in exploring alternative backends which can be used with build, see <scikit-hep/cookie>. If you are new to Python packaging, see <PUG guide>.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Quickstart - setuptools 65.6.3.post20221220 documentation
This section declares what are your build system dependencies, and which library will be used to actually do the packaging. In addition to...
Read more >
Getting Started With setuptools and setup.py - PythonHosted.org
This tutorial will focus on the bare minimum basics you need to get setuptools running so you can: Register your package on pypi....
Read more >
Packaging Python Projects
This tutorial walks you through how to package a simple Python project. It will show you how to add the necessary files and...
Read more >
Quickstart — wheel 0.38.4 documentation - Read the Docs
python -m pip install build python -m build --wheel ... universal (Python 2/3 compatible, pure Python) wheels, add the following section to your...
Read more >
setuptools Quickstart — Python documentation
All python package must provide a pyproject.toml and specify the backend (build system) it wants to use. The distribution can then be generated...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found