Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Greetings,
this PR showcases a more strict following of a
src
layout and a modernization of the used tooling. This setup works for a flat-layout as well. While technically this is a PR, I'm aware and agree that too much is going on in here. But I felt creating a bunch of different PRs wouldn't serve the purpose of a bundled communication about the topic.Motivation
The usage of a
setup.py
file is deprecated sincesetuptools>58.2.0
andsetup.cfg
will be too. Therefore when setting up a new project it would be more future proof to use apyproject.toml
file instead.Changes
setup.py
withpyproject.toml
(including all dynamic parts)__init__.py
import to work properly in src-layoutbuild
dependency todev
optional dependencies for local building. E.g.python -m build .
will build your wheel and tar.gz files. The usage ofbuild
is encouraged[1][2].Breaking changes:
Running tests requires installing the package locally.
While this is an additional (potentially annoying) step,
it ensures we're testing exactly the package as it will be
delivered to users.
Warning:
Automatic discovery of modules is a BETA-feature of
pyproject.toml
.https://setuptools.pypa.io/en/latest/userguide/package_discovery.html