structuring python project

Last edited time
Last updated October 18, 2022
the most basic files you need:
├── pyproject.toml # and/or setup.cfg/ (depending on the configuration method) | # README.rst or (a nice description of your package) | # LICENCE (properly chosen license information, e.g. MIT, BSD-3, GPL-3, MPL-2, etc...) └── mypackage ├── └── ... (other Python files)
[build-system] requires = ["setuptools"] build-backend = "setuptools.build_meta" [project] name = "mypackage" version = "0.0.1" [tool.setuptools.packages.find] include = ["mypackage"]
from setuptools import setup setup()
setuptool suggests to use pyproject.toml
New projects are advised to avoid  configurations (beyond the minimal stub) when custom scripting during the build is not necessary. Examples are kept in this document to help people interested in maintaining or contributing to existing packages that use . Note that you can still keep most of configuration declarative in setup.cfg  or pyproject.toml  and use only for the parts not supported in those files (e.g. C extensions).

templates and references

Configuring setuptools using pyproject.toml files - setuptools 65.4.1.post20220930 documentation (1) Configuring setuptools using setup.cfg files - setuptools 65.4.1.post20220930 documentation (1) Understanding, setup.cfg and pyproject.toml in Python – SomeBeans (1) Publishing (Perfect) Python Packages on PyPi - YouTube (1) Python Package Structure: Dead Simple Python: Project Structure and Imports - DEV Community 👩‍💻👨‍💻 (1) Where to put your custom code? — Python Topics 1.0.0 documentation (1) python - Reference requirements.txt for the install_requires kwarg in setuptools file - Stack Overflow (1) Quickstart - setuptools 65.4.1.post20220930 documentation (1)