在src(mlm)目录下忽略python文件。我在where
中包含了mlm
目录,用于查找包。
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "arichuvadi"
version = "0.0.3"
authors = [
{ name="vanangamudi", email="sgfrecfs@gmail.com" },
]
description = "a basic set of tools to work with Tamil text"
readme = "YENNAI_PADI.txt"
license = { file="LICENSE" }
requires-python = ">=3.5"
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
]
[project.urls]
[tool.setuptools]
include-package-data = true
[tool.setuptools.packages.find]
where = ["src"] # ["."] by default
include = ["*.py"] # ["*"] by default
exclude = [] # empty by default
namespaces = true # true by default
这是项目的目录布局
(arichuvadi)$ tree
.
├── LICENSE
├── MANIFEST.in
├── src
│ ├── arichuvadi.py
│ ├── orunguri-tha.py
│ ├── tharavu
│ │ ├── adaiyalamitta-ari.txt
│ │ ├── ari.txt
│ │ └── ari-uni.txt
│ └── valam.py
├── pyproject.toml
├── README.org -> YENNAI_PADI.txt
├── setup.py
└── YENNAI_PADI.txt
2条答案
按热度按时间mklgxw1f1#
由于缺少
__init__.py
,您的src
目录根本不包含python包(或模块)。你应该得到这样的结果:如果您想在包中包含txt文件,还应该确保设置package_data配置。
ttygqcqt2#
或者,您可以在不更改目录树的情况下执行此操作:
如果你有PyProject。toml,你不一定需要www.example www.example.com 更多