Setuptools 正在为 UNKNOWN 创建蛋,而不是 setuptools-rust。

huangapple go评论88阅读模式
英文:

Setuptools is creating is creating egg for UNKNOWN instead of setuptools-rust

问题

我正在尝试使用Python 3.10.4、openssl 3.0和setuptools v58.2构建setuptools rust(v1.3)。以下是命令和输出:

  1. (venv3.10) [/dbc/blr-dbc2112/abandaru/projects]$ python cayman_pyo3_setuptools-rust/pyo3_setuptools-rust/src/setup.py build
  2. running build
  3. (venv3.10) [/dbc/blr-dbc2112/abandaru/projects]$ python cayman_pyo3_setuptools-rust/pyo3_setuptools-rust/src/setup.py install
  4. running install
  5. running bdist_egg
  6. running egg_info
  7. writing UNKNOWN.egg-info/PKG-INFO
  8. writing dependency_links to UNKNOWN.egg-info/dependency_links.txt
  9. writing top-level names to UNKNOWN.egg-info/top_level.txt
  10. reading manifest file 'UNKNOWN.egg-info/SOURCES.txt'
  11. writing manifest file 'UNKNOWN.egg-info/SOURCES.txt'
  12. installing library code to build/bdist.linux-x86_64/egg
  13. running install_lib
  14. warning: install_lib: 'build/lib' does not exist -- no Python modules to install
  15. creating build/bdist.linux-x86_64/egg
  16. creating build/bdist.linux-x86_64/egg/EGG-INFO
  17. copying UNKNOWN.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
  18. copying UNKNOWN.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
  19. copying UNKNOWN.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
  20. copying UNKNOWN.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
  21. zip_safe flag not set; analyzing archive contents...
  22. creating 'dist/UNKNOWN-0.0.0-py3.10.egg' and adding 'build/bdist.linux-x86_64/egg' to it
  23. removing 'build/bdist.linux-x86_64/egg' (and everything under it)
  24. Processing UNKNOWN-0.0.0-py3.10.egg
  25. Copying UNKNOWN-0.0.0-py3.10.egg to /dbc/blr-dbc2112/abandaru/projects/venv3.10/lib/python3.10/site-packages
  26. Adding UNKNOWN 0.0.0 to easy-install.pth file
  27. Installed /dbc/blr-dbc2112/abandaru/projects/venv3.10/lib/python3.10/site-packages/UNKNOWN-0.0.0-py3.10.egg
  28. Processing dependencies for UNKNOWN==0.0.0
  29. Finished processing dependencies for UNKNOWN==0.0.0
  30. (venv3.10) [/dbc/blr-dbc2112/abandaru/projects]$ unzip venv3.10/lib64/python3.10/site-packages/UNKNOWN-0.0.0-py3.10.egg
  31. Archive: venv3.10/lib64/python3.10/site-packages/UNKNOWN-0.0.0-py3.10.egg
  32. inflating: EGG-INFO/PKG-INFO
  33. inflating: EGG-INFO/SOURCES.txt
  34. inflating: EGG-INFO/dependency_links.txt
  35. inflating: EGG-INFO/top_level.txt
  36. inflating: EGG-INFO/zip-safe

编辑:请在此处找到相关文件:

setup.py:

  1. #!/usr/bin/env python
  2. from setuptools import setup
  3. if __name__ == "__main__":
  4. setup()

pyproject.toml:

  1. [build-system]
  2. requires = ["setuptools>=58.0", "setuptools_scm[toml]>=3.4.3"]
  3. build-backend = "setuptools.build_meta"
  4. [tool.setuptools_scm]
  5. write_to = "setuptools_rust/version.py"
  6. [tool.isort]
  7. profile = "black"
  8. [tool.pytest.ini_options]
  9. minversion = "6.0"
  10. addopts = "--doctest-modules"

setup.cfg:

  1. [metadata]
  2. name = setuptools-rust
  3. version = attr: setuptools_rust.__version__
  4. author = Nikolay Kim
  5. author_email = fafhrd91@gmail.com
  6. license = MIT
  7. description = Setuptools Rust extension plugin
  8. keywords = distutils, setuptools, rust
  9. url = https://github.com/PyO3/setuptools-rust
  10. long_description = file: README.md
  11. long_description_content_type = text/markdown
  12. classifiers =
  13. Topic :: Software Development :: Version Control
  14. License :: OSI Approved :: MIT License
  15. Intended Audience :: Developers
  16. Programming Language :: Python :: 3
  17. Programming Language :: Python :: 3.6
  18. Programming Language :: Python :: 3.7
  19. Programming Language :: Python :: 3.8
  20. Programming Language :: Python :: 3.9
  21. Development Status :: 5 - Production/Stable
  22. Operating System :: POSIX
  23. Operating System :: MacOS :: MacOS X
  24. Operating System :: Microsoft :: Windows
  25. [options]
  26. packages = setuptools_rust
  27. zip_safe = True
  28. install_requires = setuptools>=58.0; semantic_version>=2.8.2,<3; typing_extensions>=3.7.4.3
  29. setup_requires = setuptools>=58.0; setuptools_scm>=6.3.2
  30. python_requires = >=3.7
  31. [options.entry_points]
  32. distutils.commands =
  33. clean_rust=setuptools_rust:clean_rust
  34. build_rust=setuptools_rust:build_rust
  35. distutils.setup_keywords =
  36. rust_extensions=setuptools_rust.setuptools_ext:rust_extensions

我不确定为什么setuptools正在为"UNKNOWN"构建,而不是"setuptools-rust"。请问是否能指出我的错误所在?

英文:

I'm trying to build setuptools rust (v1.3) using python 3.10.4, openssl 3.0 and setuptools v58.2 These are the commands and outputs:

  1. (venv3.10) [/dbc/blr-dbc2112/abandaru/projects]$ python cayman_pyo3_setuptools-rust/pyo3_setuptools-rust/src/setup.py build
  2. running build
  3. (venv3.10) [/dbc/blr-dbc2112/abandaru/projects]$ python cayman_pyo3_setuptools-rust/pyo3_setuptools-rust/src/setup.py install
  4. running install
  5. running bdist_egg
  6. running egg_info
  7. writing UNKNOWN.egg-info/PKG-INFO
  8. writing dependency_links to UNKNOWN.egg-info/dependency_links.txt
  9. writing top-level names to UNKNOWN.egg-info/top_level.txt
  10. reading manifest file &#39;UNKNOWN.egg-info/SOURCES.txt&#39;
  11. writing manifest file &#39;UNKNOWN.egg-info/SOURCES.txt&#39;
  12. installing library code to build/bdist.linux-x86_64/egg
  13. running install_lib
  14. warning: install_lib: &#39;build/lib&#39; does not exist -- no Python modules to install
  15. creating build/bdist.linux-x86_64/egg
  16. creating build/bdist.linux-x86_64/egg/EGG-INFO
  17. copying UNKNOWN.egg-info/PKG-INFO -&gt; build/bdist.linux-x86_64/egg/EGG-INFO
  18. copying UNKNOWN.egg-info/SOURCES.txt -&gt; build/bdist.linux-x86_64/egg/EGG-INFO
  19. copying UNKNOWN.egg-info/dependency_links.txt -&gt; build/bdist.linux-x86_64/egg/EGG-INFO
  20. copying UNKNOWN.egg-info/top_level.txt -&gt; build/bdist.linux-x86_64/egg/EGG-INFO
  21. zip_safe flag not set; analyzing archive contents...
  22. creating &#39;dist/UNKNOWN-0.0.0-py3.10.egg&#39; and adding &#39;build/bdist.linux-x86_64/egg&#39; to it
  23. removing &#39;build/bdist.linux-x86_64/egg&#39; (and everything under it)
  24. Processing UNKNOWN-0.0.0-py3.10.egg
  25. Copying UNKNOWN-0.0.0-py3.10.egg to /dbc/blr-dbc2112/abandaru/projects/venv3.10/lib/python3.10/site-packages
  26. Adding UNKNOWN 0.0.0 to easy-install.pth file
  27. Installed /dbc/blr-dbc2112/abandaru/projects/venv3.10/lib/python3.10/site-packages/UNKNOWN-0.0.0-py3.10.egg
  28. Processing dependencies for UNKNOWN==0.0.0
  29. Finished processing dependencies for UNKNOWN==0.0.0
  30. (venv3.10) [/dbc/blr-dbc2112/abandaru/projects]$ unzip venv3.10/lib64/python3.10/site-packages/UNKNOWN-0.0.0-py3.10.egg
  31. Archive: venv3.10/lib64/python3.10/site-packages/UNKNOWN-0.0.0-py3.10.egg
  32. inflating: EGG-INFO/PKG-INFO
  33. inflating: EGG-INFO/SOURCES.txt
  34. inflating: EGG-INFO/dependency_links.txt
  35. inflating: EGG-INFO/top_level.txt
  36. inflating: EGG-INFO/zip-safe

Edit: Please find the relevant files here:

setup.py:

  1. #!/usr/bin/env python
  2. from setuptools import setup
  3. if __name__ == &quot;__main__&quot;:
  4. setup()

pyproject.toml:

  1. [build-system]
  2. requires = [&quot;setuptools&gt;=58.0&quot;, &quot;setuptools_scm[toml]&gt;=3.4.3&quot;]
  3. build-backend = &quot;setuptools.build_meta&quot;
  4. [tool.setuptools_scm]
  5. write_to = &quot;setuptools_rust/version.py&quot;
  6. [tool.isort]
  7. profile = &quot;black&quot;
  8. [tool.pytest.ini_options]
  9. minversion = &quot;6.0&quot;
  10. addopts = &quot;--doctest-modules&quot;

setup.cfg:

  1. [metadata]
  2. name = setuptools-rust
  3. version = attr: setuptools_rust.__version__
  4. author = Nikolay Kim
  5. author_email = fafhrd91@gmail.com
  6. license = MIT
  7. description = Setuptools Rust extension plugin
  8. keywords = distutils, setuptools, rust
  9. url = https://github.com/PyO3/setuptools-rust
  10. long_description = file: README.md
  11. long_description_content_type = text/markdown
  12. classifiers =
  13. Topic :: Software Development :: Version Control
  14. License :: OSI Approved :: MIT License
  15. Intended Audience :: Developers
  16. Programming Language :: Python :: 3
  17. Programming Language :: Python :: 3.6
  18. Programming Language :: Python :: 3.7
  19. Programming Language :: Python :: 3.8
  20. Programming Language :: Python :: 3.9
  21. Development Status :: 5 - Production/Stable
  22. Operating System :: POSIX
  23. Operating System :: MacOS :: MacOS X
  24. Operating System :: Microsoft :: Windows
  25. [options]
  26. packages = setuptools_rust
  27. zip_safe = True
  28. install_requires = setuptools&gt;=58.0; semantic_version&gt;=2.8.2,&lt;3; typing_extensions&gt;=3.7.4.3
  29. setup_requires = setuptools&gt;=58.0; setuptools_scm&gt;=6.3.2
  30. python_requires = &gt;=3.7
  31. [options.entry_points]
  32. distutils.commands =
  33. clean_rust=setuptools_rust:clean_rust
  34. build_rust=setuptools_rust:build_rust
  35. distutils.setup_keywords =
  36. rust_extensions=setuptools_rust.setuptools_ext:rust_extensions

I'm not sure why setuptools is building it for unknown and not setuptools-rust. Could someone please point to my mistake?

答案1

得分: 1

问题似乎在于您当前的工作目录必须是包含 setup.py 脚本的目录。据我所知,类似 python path/to/setup.py 的任何操作都会失败,只有 python setup.py 才会成功。因此,首先使用 cd 进入包含 setup.py 脚本的项目目录,然后执行 setup.py 命令。

英文:

The issue seems to be that your current working directory has to be the directory containing the setup.py script. As far as I can tell anything like python path/to/setup.py will fail, and only python setup.py will succeed. So first cd into the project directory containing the setup.py script, then call setup.py commands.

huangapple
  • 本文由 发表于 2023年3月9日 15:27:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/75681551.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定