首页 > 解决方案 > 将生成的轮文件复制到目标

问题描述

我有以下内容setup.py

"""
Based on:
https://packaging.python.org/guides/distributing-packages-using-setuptools/
https://github.com/pypa/sampleproject
"""

# Always prefer setuptools over distutils
from setuptools import setup, find_packages
import os
# io.open is needed for projects that support Python 2.7
# It ensures open() defaults to text mode with universal newlines,
# and accepts an argument to specify the text encoding
# Python 3 only projects can skip this import
from io import open

from ReePlexos.__version__ import ReePlexos_version

here = os.path.abspath(os.path.dirname(__file__))

base_path = os.path.join('ReePlexos')
docs_folder = os.path.join(base_path, 'docs')
packages = find_packages(exclude=['docs', 'test', 'research', 'tests'])
package_data = {}

dependencies = ["PySide2>=5.13",
                "numpy>=1.14.0",
                "scipy>=1.0.0",
                "networkx>=2.1",
                "pandas>=0.22",
                "xlwt>=1.3.0",
                "xlrd>=1.1.0",
                "matplotlib>=2.1.1",
                "qtconsole>=4.3.1",
                "pyDOE>=0.3.8",
                "pySOT>=0.2.1",
                "openpyxl>=2.4.9",
                "pulp>=1.6.8",
                "smopy>=0.0.6",
                "chardet>=3.0.4",
                "scikit-learn>=0.18",
                "geopy>=1.16",
                "pytest>=3.8",
                "h5py>=2.9.0",
                "GridCal>=3.5.7",
                "Folium",
                "sphinx",
                "nose",
                "numba>=0.4",
                "pytest",
                "wheel"]

setup(
    name='ReePlexos',  # Required
    version=ReePlexos_version,  # Required
    packages=packages, 
    include_package_data=False,
    python_requires='>=3.5',
    install_requires=dependencies,
    package_data=package_data,
)

python3 setup.py bdist_wheel为了创建.whl文件,我将此设置称为。

安装程序会生成名称如ReePlexos-0.9.7-py3-none-any.whl.

我想将生成的轮文件复制到另一个不是dist. 我该怎么做?

标签: pythonpython-3.xsetuptoolssetup.py

解决方案


使用该--dist-dir选项。请参阅命令的帮助消息以bdist_wheel供参考:

$ ./setup.py bdist_wheel --help
...
  --dist-dir (-d)   directory to put final built distributions in
...

推荐阅读