python-xxhash
python-xxhash copied to clipboard
xxhash 3.0.0 fails to build on msys/mingw pip
I'm using my python install from msys/mingw, specifically the package mingw-w64-ucrt-x86_64-python.
I was able to build and install every xxhash version up to 2.0.2, but 3.0.0 fails now, with the output:
Collecting xxhash
Downloading xxhash-3.0.0.tar.gz (74 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 74.3/74.3 KB 1.4 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: xxhash
Building wheel for xxhash (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for xxhash (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [11 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.mingw_x86_64_ucrt-3.9
creating build\lib.mingw_x86_64_ucrt-3.9\xxhash
copying xxhash\version.py -> build\lib.mingw_x86_64_ucrt-3.9\xxhash
copying xxhash\__init__.py -> build\lib.mingw_x86_64_ucrt-3.9\xxhash
running build_ext
building '_xxhash' extension
error: --plat-name must be one of ('win32', 'win-amd64', 'win-arm32', 'win-arm64')
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for xxhash
Failed to build xxhash
ERROR: Could not build wheels for xxhash, which is required to install pyproject.toml-based projects
My python version, as per output from python:
Python 3.9.10 (main, Jan 25 2022, 17:58:24) [GCC UCRT 11.2.0 64 bit (AMD64)] on win32
pip version:
22.0.3
Compatible pip tags as per output from "pip debug --version":
Compatible tags: 33
cp39-cp39-mingw_x86_64_ucrt
cp39-abi3-mingw_x86_64_ucrt
cp39-none-mingw_x86_64_ucrt
cp38-abi3-mingw_x86_64_ucrt
cp37-abi3-mingw_x86_64_ucrt
cp36-abi3-mingw_x86_64_ucrt
cp35-abi3-mingw_x86_64_ucrt
cp34-abi3-mingw_x86_64_ucrt
cp33-abi3-mingw_x86_64_ucrt
cp32-abi3-mingw_x86_64_ucrt
py39-none-mingw_x86_64_ucrt
py3-none-mingw_x86_64_ucrt
py38-none-mingw_x86_64_ucrt
py37-none-mingw_x86_64_ucrt
py36-none-mingw_x86_64_ucrt
py35-none-mingw_x86_64_ucrt
py34-none-mingw_x86_64_ucrt
py33-none-mingw_x86_64_ucrt
py32-none-mingw_x86_64_ucrt
py31-none-mingw_x86_64_ucrt
py30-none-mingw_x86_64_ucrt
cp39-none-any
py39-none-any
py3-none-any
py38-none-any
py37-none-any
py36-none-any
py35-none-any
py34-none-any
py33-none-any
py32-none-any
py31-none-any
py30-none-any
Can't see what's the cause from these output.
Maybe it's the newly introduced pyproject.toml, could you try below and see if it's solved?
- manually create xxhash/version.py with content
VERSION = "3.0.0.dev1" VERSION_TUPLE = (3, 0, 0, 'dev1') - remove pyproject.toml
- try building wheel again
I'll try when I get access to a Windows computer.
After having much trouble in figuring out what to do (setup.py seems outdated) I was able to build using the command in the readme and installing it seems to have worked fine.
FYI: I've packaged python-xxhash as a Debian package (I wish to upload mycroft into Debian, which uses python-xxhash). It's still waiting to be reviewed, but it's available at https://ftp-master.debian.org/new/python-xxhash_3.0.0-1.html for now.
While trying to package it, I ran into this same problem.
Perhaps it might be good to use github's "releases" feature to distribute a source tarball that contains the generated files?
@yoe I think the problem is setuptools_scm. Building python-xxhash requires setuptools_scm to generate xxhash/version.py
I think this is fixed by https://github.com/ifduyue/python-xxhash/commit/4926ec8d691db39936ebf920ada0f4e0c829929c Please reopen if the problem still exists