python - Python:如何将一个自定义包添加到另一个自定义包中?
问题描述
我有两个包,main_package 和 sub_package。两者都已打包到轮文件中。我想将 sub_package 捆绑到 main_package 中,以便在安装 main_package 时也安装 sub_package。
我的 setup.py 文件看起来像这样
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="main-package",
version="0.0.1",
author="author",
author_email="author@example.com",
description="Package 1",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/pypa/sampleproject",
packages=setuptools.find_packages()
install_requires=[
'sub_package'
],
include_package_data=True
)
如何将 sub_package 添加到 main_package 以便在执行 pip install main_package.whl 时也安装 sub_package?
解决方案
推荐阅读
- node.js - 如何在 Node.js 中关闭 tls 套接字连接?
- android - 连接 Charles 代理时,Google 双击广告请求失败
- glsl - 如何将shadershop公式转换为glsl
- javascript - 将对象原型设置为 null 时使用 toString
- sql - 关于 Oracle PURGE INDEX 语句
- angular - 如何允许服务在 Angular 5 测试中进行真正的 http 调用
- python - Numpy power 不允许负值
- apache - .htaccess RewriteRule 没有重定向到正确的位置
- javascript - 表单提交时停止页面重定向
- c# - 使用 C# .NET 批量转换文件