我正在尝试使用python 3.10.4,openssl 3.0和setuptools v58.2构建setuptools rust(v1.3),这些是命令和输出:
(venv3.10) [/dbc/blr-dbc2112/abandaru/projects]$ python cayman_pyo3_setuptools-rust/pyo3_setuptools-rust/src/setup.py build
running build
(venv3.10) [/dbc/blr-dbc2112/abandaru/projects]$ python cayman_pyo3_setuptools-rust/pyo3_setuptools-rust/src/setup.py install
running install
running bdist_egg
running egg_info
writing UNKNOWN.egg-info/PKG-INFO
writing dependency_links to UNKNOWN.egg-info/dependency_links.txt
writing top-level names to UNKNOWN.egg-info/top_level.txt
reading manifest file 'UNKNOWN.egg-info/SOURCES.txt'
writing manifest file 'UNKNOWN.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
warning: install_lib: 'build/lib' does not exist -- no Python modules to install
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying UNKNOWN.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying UNKNOWN.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying UNKNOWN.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying UNKNOWN.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/UNKNOWN-0.0.0-py3.10.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing UNKNOWN-0.0.0-py3.10.egg
Copying UNKNOWN-0.0.0-py3.10.egg to /dbc/blr-dbc2112/abandaru/projects/venv3.10/lib/python3.10/site-packages
Adding UNKNOWN 0.0.0 to easy-install.pth file
Installed /dbc/blr-dbc2112/abandaru/projects/venv3.10/lib/python3.10/site-packages/UNKNOWN-0.0.0-py3.10.egg
Processing dependencies for UNKNOWN==0.0.0
Finished processing dependencies for UNKNOWN==0.0.0
(venv3.10) [/dbc/blr-dbc2112/abandaru/projects]$ unzip venv3.10/lib64/python3.10/site-packages/UNKNOWN-0.0.0-py3.10.egg
Archive: venv3.10/lib64/python3.10/site-packages/UNKNOWN-0.0.0-py3.10.egg
inflating: EGG-INFO/PKG-INFO
inflating: EGG-INFO/SOURCES.txt
inflating: EGG-INFO/dependency_links.txt
inflating: EGG-INFO/top_level.txt
inflating: EGG-INFO/zip-safe
编辑:请在此处查找相关文件:
setup.py:
#!/usr/bin/env python
from setuptools import setup
if __name__ == "__main__":
setup()
pyproject.toml:
[build-system]
requires = ["setuptools>=58.0", "setuptools_scm[toml]>=3.4.3"]
build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
write_to = "setuptools_rust/version.py"
[tool.isort]
profile = "black"
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--doctest-modules"
setup.cfg:
[metadata]
name = setuptools-rust
version = attr: setuptools_rust.__version__
author = Nikolay Kim
author_email = fafhrd91@gmail.com
license = MIT
description = Setuptools Rust extension plugin
keywords = distutils, setuptools, rust
url = https://github.com/PyO3/setuptools-rust
long_description = file: README.md
long_description_content_type = text/markdown
classifiers =
Topic :: Software Development :: Version Control
License :: OSI Approved :: MIT License
Intended Audience :: Developers
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Development Status :: 5 - Production/Stable
Operating System :: POSIX
Operating System :: MacOS :: MacOS X
Operating System :: Microsoft :: Windows
[options]
packages = setuptools_rust
zip_safe = True
install_requires = setuptools>=58.0; semantic_version>=2.8.2,<3; typing_extensions>=3.7.4.3
setup_requires = setuptools>=58.0; setuptools_scm>=6.3.2
python_requires = >=3.7
[options.entry_points]
distutils.commands =
clean_rust=setuptools_rust:clean_rust
build_rust=setuptools_rust:build_rust
distutils.setup_keywords =
rust_extensions=setuptools_rust.setuptools_ext:rust_extensions
我不知道为什么setuptools要为unknown而不是setuptools-rust构建它。有人能指出我的错误吗?
1条答案
按热度按时间rnmwe5a21#
问题似乎是您当前的工作目录必须是包含
setup.py
脚本的目录。据我所知,类似python path/to/setup.py
的任何操作都会失败,只有python setup.py
会成功。因此,首先将cd
导入包含setup.py
脚本的项目目录,然后调用setup.py
命令。