git - pip install git repo 仅构建
问题描述
我正在尝试为我的包构建 setup.py。pip install . --user
从克隆的回购中效果很好。该软件包已构建并安装。
如果pip install git+ssh://git@github.com/Me/MyPackage.git@installation --user
被执行,pip 只构建包。它不安装。我该怎么做才能使 pip 也安装软件包?
为了完成这里是我的 setup.py。它有一个自定义安装,可以按应有的方式编译 c 代码。install.run(self)
似乎没有被执行或什么的。
from setuptools import setup, Extension, find_packages
from setuptools.command.install import install
import subprocess
import os
from mypackage import __version__
def find_executables():
folder = 'mypackage/bin'
a = [f'{folder}/{e}' for e in os.listdir(folder) if os.path.isfile(f'{folder}/{e}') and not '__' in e]
return a
class CustomInstall(install):
def run(self):
import sys
commandPullSubmodules = 'git submodule update --init --recursive'
process = subprocess.Popen(commandPullSubmodules, shell=True, cwd="./")
process.wait()
#COMPILE C-CODE
version = f'{sys.version_info[0]}.{sys.version_info[1]}'
commandInstall = f'python{version} compile.py --target all'
process = subprocess.Popen(commandInstall, shell=True, cwd="mypackage/mypackageC")
process.wait()
install.run(self)
setup(
name='mypackage',
version=__version__,
packages=find_packages(),
author='Me',
author_email='me@gmail.com',
url='https://github.com/Me/MyPackage.git',
install_requires=['lxml', 'PyFFTW', 'scipy', 'boost', 'numpy'],
extras_require={
'gpu': ['cupy'],
'gui': ['PyQt5', 'pyqtgraph'],
'all': ['cupy', 'PyQt5', 'pyqtgraph']},
cmdclass={'install': CustomInstall},
include_package_data=True,
scripts=find_executables(),
test_suite='nose.collector',
tests_require=['nose'])
解决方案
推荐阅读
- python - 如何在不使用两个 % 的情况下在 python 语句中使用 %
- r - 如何计算一组中的最大值并最小化另一组并取平均时间
- fluent-ui - Fluent UI React 将焦点轮廓颜色更改为主要反转颜色
- error-handling - 密钥派生上的 OpenSSL AES 对称错误
- python - 如何修复模板渲染期间的错误
- express - 如何正确地将快递路线拆分为单独的文件?
- css - 下拉列表左侧的 Bootstrap NAVBAR 项 t
- amazon-web-services - 监控账户中 S3 存储桶的数量
- c - 在结构中查找偏移量
- prometheus - 入口控制器中 request_duration 和 response_duration prometheus 指标之间的区别