How to
Structure of project folder
mypkg/
├── pyproject.toml
├── setup.py
├── README.md
├── mypkg/
│ ├── __init__.py
│ └── core.py
└── tests
Run editable install
cd mypkg
pip install -e .
Then
Use the following import anywhere.
from mypkg.core import my_function
pyproject.toml
Replace all the *** and mypkg.
[build-system]
requires = ["setuptools==80.9.0", "wheel==0.46.1"]
build-backend = "setuptools.build_meta"
[project]
name = "***"
version = "***"
description = "****"
readme = "README.md"
authors = [
{ name = "***", email = "***" }
]
requires-python = "***"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
dependencies = []
[project.urls]
Homepage = "***"
Repository = "***"
[tool.setuptools.packages.find]
where = ["."]
include = ["mypkg*"]
setup.py
from setuptools import setup
setup()
ps
Revert the above, if needed.
pip uninstall mypkg