因此,在空闲时间进行了几周的编码之后,我决定将 我的第一个包发布到 PYPI。
我遵循了这个良好的指南我在Medium上找到了如何发布到PYPI并创建
setup.py
我遵循了官方文档上链接的示例脚本,但现在我正在尝试在一个品牌中测试该包新的 venv,我在安装时遇到问题。安装脚本出现以下错误:
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [10 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-n98_mli9/gisterical_9bbb85fbb9174141b0879737b7b585c1/setup.py", line 7, in <module>
long_description = (here / "readme.md").read_text(encoding="utf-8")
File "/usr/lib64/python3.10/pathlib.py", line 1134, in read_text
with self.open(mode='r', encoding=encoding, errors=errors) as f:
File "/usr/lib64/python3.10/pathlib.py", line 1119, in open
return self._accessor.open(self, mode, buffering, encoding, errors,
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-install-n98_mli9/gisterical_9bbb85fbb9174141b0879737b7b585c1/readme.md'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
我不完全确定我哪里出错了。这是我的
setup.py
from setuptools import setup, find_packages
import pathlib
here = pathlib.Path(__file__).parent.resolve()
long_description = (here / "readme.md").read_text(encoding="utf-8")
setup(
name='GISterical',
version='0.5.3',
license='MIT',
author="<my name>",
author_email='<my email>',
packages=find_packages('src'),
package_dir={'': 'src'},
url='https://github.com/pavelcherepan/gisterical',
long_description=long_description,
long_description_content_type="text/markdown",
keywords='example project',
classifiers=[
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3 :: Only",
],
python_requires=">=3.9, <4",
install_requires=[
'loguru',
'SQLAlchemy>=1.4',
'GeoAlchemy2>=0.12',
'exif',
'attrs',
'ImageHash',
'Pillow',
'psycopg2-binary>=2.8'
],
entry_points={
"console_scripts": [
"gisterical=gisterical:gisterical",
],
},
)
还有我的
setup.cfg
[metadata]
description-file=readme.md
license_files=LICENSE.rst
我不太明白
readme.md
的问题是什么,因为它在 PYPI 项目页面上正确显示。
您忘记添加
readme.md
作为数据文件。请注意,仅自动包含 README*
文件。将您的 readme.md
文件重命名为 README.md
或使用 MANIFEST.in
将其添加为数据文件。