Last active
March 11, 2025 07:43
-
-
Save hotohoto/4c2e34d62528cdf495df8044bfd48f39 to your computer and use it in GitHub Desktop.
A minimum python project setting to support for src layout without considering distribution.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this file into the root folder of your project | |
# Specify dependencies in requirements.txt and install dependencies with `pip install -e .` | |
# Then, you don't need to specify the `src` directory within PYTHONPATH when you run a python module in your project. | |
# This is an exeperimental/opinionated setting. So any comments are welcome. | |
# references: | |
# - https://stackoverflow.com/a/73600610/1874690 | |
# - https://packaging.python.org/en/latest/guides/writing-pyproject-toml/ | |
[project] | |
name = "my-project-name" | |
dynamic = ["dependencies"] | |
version = "0.1.0" | |
[tool.setuptools.packages.find] | |
where = ["src"] | |
[tool.setuptools.dynamic] | |
dependencies = {file = ["requirements.txt"]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment