tttapa / py-build-cmake

Modern, PEP 517 compliant build backend for creating Python packages with extensions built using CMake.
https://pypi.org/project/py-build-cmake
MIT License
45 stars 7 forks source link

Bug: exception when try to install to subfolder with dist-info #30

Closed ilya-lavrenov closed 3 months ago

ilya-lavrenov commented 3 months ago

Exception image

Cmake code:

install(FILES "${openvino_tokenizers_SOURCE_DIR}/LICENSE"
              "${openvino_tokenizers_SOURCE_DIR}/third-party-programs.txt"
              "${openvino_tokenizers_SOURCE_DIR}/SECURITY.md"
        DESTINATION "${PY_BUILD_CMAKE_PACKAGE_NAME}-${PY_BUILD_CMAKE_PACKAGE_VERSION}.dist-info/licenses"
        COMPONENT openvino_tokenizers_licenses
        EXCLUDE_FROM_ALL)

When install to "${PY_BUILD_CMAKE_PACKAGE_NAME}-${PY_BUILD_CMAKE_PACKAGE_VERSION}.dist-info - works well.

tttapa commented 3 months ago

The error seems to originate from the distlib package, which py-build-cmake depends on for creating Wheel files.

Looking at https://packaging.python.org/en/latest/specifications/binary-distribution-format/#the-dist-info-directory, adding subdirectories to the .dist-info folder is not explicitly disallowed, but not explicitly allowed either.

I would simply put them directly into .dist-info, without a subdirectory, but you may want to open an issue over at https://github.com/pypa/distlib/issues.

As a side note, please post any code and error messages as text between code fences (triple backticks) instead of using screenshots.

ilya-lavrenov commented 3 months ago

Ok, if it's not easy to fix, we can close ticket.

scikit-build-core creates licenses subfolder within dist-info, that is why I supposed it's easy to fix.

Example of such package https://pypi.org/project/openvino-tokenizers/#files

tttapa commented 3 months ago

Ok, if it's not easy to fix, we can close ticket.

Is suspect that the fix will be easy enough, but it should be fixed in the distlib package, not in the py-build-cmake package.

ilya-lavrenov commented 3 months ago

scikit-build-core WAs the issue somehow.

But maybe that project does not use distlib

In general, I consider an issue of your dependency is your issue 🔧