https://setuptools.pypa.io/en/latest/us ... _mode.html и https://setuptools.pypa.io/en/latest /userguide/package_discovery.html#src-layout, в котором у меня есть проект, и я могу использовать его как редактируемую библиотеку.
В библиотеке есть это структура:
Код: Выделить всё
\library:
\Include
\Lib
\Scripts
\src:
\ry:
__init__.py (this is empty)
tests.py (this has one function)
pyproject.toml
pyvenv.cfg
README.md
Код: Выделить всё
[build-system]
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"
[tool.setuptools.packages.find]
where = ["src"]
[project]
name = "ry"
version = "0.0.1"
authors = [
{ name="Jorge", email="myname@emaildomain.com" },
]
description = "A small example package"
readme = "README.md"
requires-python = ">=3.11"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
[project.urls]
Код: Выделить всё
>python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --editable .
Код: Выделить всё
import ry
or
from ry import tests
Есть идеи, в чем дело?Спасибо
Подробнее здесь: https://stackoverflow.com/questions/791 ... -in-python
Мобильная версия