Как включить каталог с скомпилированными двоичными файлами в колесо Python с помощью pyproject.toml?Python

Программы на Python
Ответить Пред. темаСлед. тема
Anonymous
 Как включить каталог с скомпилированными двоичными файлами в колесо Python с помощью pyproject.toml?

Сообщение Anonymous »

Я хочу создать колесо Python, содержащее один модуль Python (

Код: Выделить всё

script.py
) и каталог скомпилированных двоичных файлов C++. Ниже представлена ​​структура моего проекта:

Код: Выделить всё

root/
│
├── bin/
│   ├── binary1
│   ├── binary2
│   ├── binary3
│   └── binary4
├── script.py
├── pyproject.toml
├── MANIFEST.in
├── README.md
pyproject.toml:

Код: Выделить всё

[build-system]
requires = ["setuptools>=61.0.0", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
py-modules = ["script"]

[project]
name = "script-test"
description = "Lorem ipsum"
readme = "README.md"
license = { file = "LICENSE" }
authors = [
{ name = "", email = "[email protected]" },
]
requires-python = ">=3.7"
dynamic = ["version"]
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Natural Language :: English",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux"
]

[tool.setuptools.dynamic]
version = {attr = "script.__version__"}

[tool.setuptools.package-data]
"*" = ["bin/*"]

[project.scripts]
script = "script:main"
MANIFEST.in

Код: Выделить всё

include README.md
include LICENSE
recursive-include bin *
После запуска:

Код: Выделить всё

python -m build
Колесо (

Код: Выделить всё

script_test-0.0.4-py3-none-any.whl
) создается, но каталог bin/ не включается в колесо, хотя он корректно включен в исходный дистрибутив (

Код: Выделить всё

script_test-0.0.4.tar.gz
).
Вывод сборки (усеченный):

Код: Выделить всё

* Building wheel...
/private/var/folders/1k/dnrtvbx9445dpk1shw82v9fw0000gn/T/build-env-jgwgjjff/lib/python3.12/site-packages/setuptools/config/expand.py:126: SetuptoolsWarning: File '/private/var/folders/1k/dnrtvbx9445dpk1shw82v9fw0000gn/T/build-via-sdist-l75sfsez/script_test-0.0.4/LICENSE' cannot be found
for path in _filter_existing_files(_filepaths)
running bdist_wheel
running build
running build_py
creating build/lib
copying script.py -> build/lib
running egg_info
writing script_test.egg-info/PKG-INFO
writing dependency_links to script_test.egg-info/dependency_links.txt
writing entry points to script_test.egg-info/entry_points.txt
writing top-level names to script_test.egg-info/top_level.txt
reading manifest file 'script_test.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'LICENSE'
writing manifest file 'script_test.egg-info/SOURCES.txt'
installing to build/bdist.macosx-10.13-universal2/wheel
running install
running install_lib
creating build/bdist.macosx-10.13-universal2/wheel
copying build/lib/script.py -> build/bdist.macosx-10.13-universal2/wheel/.
running install_egg_info
Copying script_test.egg-info to build/bdist.macosx-10.13-universal2/wheel/./script_test-0.0.4-py3.12.egg-info
running install_scripts
creating build/bdist.macosx-10.13-universal2/wheel/script_test-0.0.4.dist-info/WHEEL
creating '/Users/andrzej/Desktop/vclust_env/vclust_test/dist/.tmp-8zpx71kj/script_test-0.0.4-py3-none-any.whl' and adding 'build/bdist.macosx-10.13-universal2/wheel' to it
adding 'script.py'
adding 'script_test-0.0.4.dist-info/METADATA'
adding 'script_test-0.0.4.dist-info/WHEEL'
adding 'script_test-0.0.4.dist-info/entry_points.txt'
adding 'script_test-0.0.4.dist-info/top_level.txt'
adding 'script_test-0.0.4.dist-info/RECORD'
removing build/bdist.macosx-10.13-universal2/wheel
Successfully built script_test-0.0.4.tar.gz and script_test-0.0.4-py3-none-any.whl
Я бы хотел, чтобы каталог bin/ был частью колеса на том же уровне, что и script.py, и чтобы двоичные файлы устанавливались в него. каталог Python site-packages/ рядом со сценарием. Как включить каталог bin/ в колесо и убедиться, что он установлен вместе с пакетом?

Подробнее здесь: https://stackoverflow.com/questions/790 ... ing-pyproj
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Python»