python - 正确构建python PIP包
问题描述
如何将我的应用程序正确构建到 PIP?我已经完成了文档中需要的所有操作并且它可以工作,但是在我进行更新并且我的脚本从一个更改为几个之后(从导入其他脚本的“ main .py”脚本开始)。
我的构建过程现在被打破了。我怎么能解决这个问题?
安装程序.py
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name='tests',
version='0.0.2',
scripts=['tests'] ,
author="Test",
author_email="test@test.com",
description="TEST",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://test.com",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: Unix"
],
)
其中“platops”是一个包含脚本的目录。
错误
错误:[Errno 21] 是一个目录:'tests'
如何正确构建这个?
解决方案
好像你不能在scripts=[]
. 你可以在这里阅读它。您可能需要指定每个的相对路径。
从文档:
Scripts are **files** containing Python source code, intended to be
started from the command line.
编辑:您也可以尝试使用通配符:
scripts=['scripts/*']
推荐阅读
- symfony - Symfony 4 导入的 .yaml 服务是自动装配的
- python - Matplotlib - 想要绘制以 x 轴中间为中心的函数
- python - TclError:图像不存在 - Tkinter 多窗口 python
- android - Android模拟器没有收到媒体按钮回调
- parsing - 如何以线程安全的方式在 Clojure 中使用对瞬态变量的引用?
- javascript - 无法使用 ng-route 将数据从控制器获取到视图中
- google-cloud-shell - Google Cloud Shell - 无法连接 - 客户端网络错误
- laravel - 将 maatwebsite excel 包添加到现有 laravel 5.7 项目后出现问题
- android - NoReadAccessException - 仅允许从事件调度线程或内部读取操作进行读取访问
- python-3.x - Python:for循环没有正确循环