我在设置python包时遇到了一些麻烦。设置python包
我试图通过使用PYPI通过pip进行安装。
这是我的项目结构是什么样子:
|-scum
\
| LICENSE
| MANIFEST
| README.md
| README.rst
| scum
| scum.py
| setup.py
|
|- |modules
| \
| | __init__.py
| | browse.py
| | popup.py
| | term.py
|
|- |resources
| \
| | config.txt
| | help.txt
| | start_up.txt
| | tabs.dat
我需要能够导入modules
的文件,我需要我的主文件scum.py
能够访问resources
这是我的setup.py:
import sys
from distutils.core import setup
from pkgutil import walk_packages
import modules
import resources
if sys.version_info[0] < 3:
sys.exit("Scum requires Python 3.")
VERSION = '0.2'
setup_kwargs = {
"version": VERSION,
"description": 'Scum text editor',
"author": 'Christian Careaga',
"author_email": '[email protected]',
"url": 'https://github.com/CCareaga/scum',
"download_url": "https://github.com/CCareaga/scum/zipball/" + VERSION,
"classifiers": [
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
"Topic :: Utilities",
"Topic :: Text Editors",
],
"data_files": [("", ['README.rst']),
("resources", ['config.txt', 'help.txt', 'start_up.txt', 'tabs.dat'])]
}
if __name__ == '__main__':
setup(
name='scum',
py_modules=['scum'],
scripts=['scum'],
packages = ['modules'],
include_package_data=True,
long_description=open('README.rst').read(),
**setup_kwargs
)
这setup.py文件不能正常工作,我改变了一些东西,因为我测试,但我无法弄清楚如何上传新版本的软件包,而无需创建全新的标签和版本号。
任何帮助将不胜感激,我很难找到很好的文档,这不是非常基本的软件包。
你会得到什么错误?并从哪里? – RichArt
@RichArt那么,我可以注册并上传它,但是当我尝试安装时,我收到一个错误消息,说没有模块资源,所以我把它当作了课程。现在我尝试重新上传,点子告诉我没有与我要求的版本匹配(v0.2),但它在pypi网站上。我基本上需要通过这个指导,因为我似乎无法弄清楚...... – Serial