我有一个名为clana( Github , PyPI ) 的包,其结构如下:
.
├── clana
│ ├── cli.py
│ ├── config.yaml
│ ├── __init__.py
│ ├── utils.py
│ └── visualize_predictions.py
├── docs/
├── setup.cfg
├── setup.py
├── tests/
└── tox.ini
setup.py 看起来像这样:
from setuptools import find_packages
from setuptools import setup
requires_tests = [...]
install_requires = [...]
config = {
"name": "clana",
"version": "0.3.6",
"author": "Martin Thoma",
"author_email": "info@martin-thoma.de",
"maintainer": "Martin Thoma",
"maintainer_email": "info@martin-thoma.de",
"packages": find_packages(),
"entry_points": {"console_scripts": ["clana=clana.cli:entry_point"]},
"install_requires": install_requires,
"tests_require": requires_tests,
"package_data": {"clana": ["clana/config.yaml"]},
"include_package_data": True,
"zip_safe": False,
}
setup(**config)
如何检查它没有工作
快的
python3 setup.py sdist
open dist/clana-0.3.8.tar.gz # config.yaml is not in this file
真正的检查
我认为这将确保它与安装软件包时config.yaml位于同一目录中。cli.py但是当我尝试这个时:
virtualenv venv
source venv/bin/activate
pip install clana
cd venv/lib/python3.6/site-packages/clana
ls
我得到:
cli.py __init__.py __pycache__ utils.py visualize_predictions.py
我将它上传到 PyPI 的方式:
python3 setup.py sdist bdist_wheel && twine upload dist/*
所以config.yaml缺少了。我怎样才能确定它在那里?
九州编程
弑天下
蛊毒传说
相关分类