Skip to content

Alpine Linux: pip and uv fail to install kson-lang 0.1.0 from PyPI #223

@AndydeCleyre

Description

@AndydeCleyre

Hi, and thanks!

I've been unable to install the PyPI package. Here are some reproducers:

EDIT: I mistakenly thought kson was the right PyPI package, but it's kson-lang. The following is irrelevant.

Oops, wrong package

uv

$ podman run -it --rm ghcr.io/astral-sh/uv:python3.13-alpine sh
/ # uv venv
Using CPython 3.13.7 interpreter at: /usr/local/bin/python
Creating virtual environment at: .venv
/ # uv pip install kson
  x Failed to build `kson==0.1.0`
  |-> The build backend returned an error
  `-> Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit status: 1)

      [stderr]
      Traceback (most recent call last):
        File "<string>", line 14, in <module>
          requires = get_requires_for_build({})
        File "/root/.cache/uv/builds-v0/.tmpYc8MX4/lib/python3.13/site-packages/setuptools/build_meta.py", line 331, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/root/.cache/uv/builds-v0/.tmpYc8MX4/lib/python3.13/site-packages/setuptools/build_meta.py", line 301, in _get_build_requires
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "/root/.cache/uv/builds-v0/.tmpYc8MX4/lib/python3.13/site-packages/setuptools/build_meta.py", line 512, in run_setup
          super().run_setup(setup_script=setup_script)
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/root/.cache/uv/builds-v0/.tmpYc8MX4/lib/python3.13/site-packages/setuptools/build_meta.py", line 317, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 14, in <module>
          requires = get_requires_for_build({})
                           ~~~~~~~~~~~~~~~~^^^^
        File "<string>", line 7, in read
      FileNotFoundError: [Errno 2] No such file or directory: '/root/.cache/uv/sdists-v9/pypi/kson/0.1.0/BPvJBWn8kfvrQ9hn9ZReC/src/../README.md'

      hint: This usually indicates a problem with the package or the build environment.

Same result with Python 3.12.

pip

$ podman run -it --rm python:3.13-alpine sh
/ # python -m venv venv
/ # . ./venv/bin/activate
(venv) / # pip install kson
Collecting kson
  Downloading kson-0.1.0.tar.gz (9.4 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [24 lines of output]
      Traceback (most recent call last):
        File "/venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
          main()
          ~~~~^^
        File "/venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File "/venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-wel7394e/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 331, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-wel7394e/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 301, in _get_build_requires
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "/tmp/pip-build-env-wel7394e/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 512, in run_setup
          super().run_setup(setup_script=setup_script)
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-wel7394e/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 317, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 14, in <module>
        File "<string>", line 7, in read
      FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-install-oge_6neb/kson_e47a437f184e4f919ec8266547a624af/../README.md'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Again, same result for Python 3.12.

EDIT: OK here's the problem with the actually correct package:

Install kson-lang in ghcr.io/astral-sh/uv:python3.13-alpine
$ podman run -it --rm ghcr.io/astral-sh/uv:python3.13-alpine sh
Trying to pull ghcr.io/astral-sh/uv:python3.13-alpine...
Getting image source signatures
Copying blob c987cde7f297 done   |
Copying blob 9d08fbafb11c done   |
Copying blob 5eb8a9c59764 done   |
Copying blob 9824c27679d3 done   |
Copying blob ea971c774474 done   |
Copying config 67581b053f done   |
Writing manifest to image destination
/ # uv venv
Using CPython 3.13.7 interpreter at: /usr/local/bin/python
Creating virtual environment at: .venv
/ # uv pip install kson-lang
Resolved 3 packages in 469ms
  x Failed to build `kson-lang==0.1.0`
  |-> The build backend returned an error
  `-> Call to `build_backend.build_wheel` failed (exit status: 1)

      [stdout]
      Building native artifacts with bundled Gradle setup...
      Gradle build failed:
      ./gradlew: exec: line 340:
      /root/.cache/uv/sdists-v9/pypi/kson-lang/0.1.0/mvaokqzVFQNtlTkih2iCu/src/kson-sdist/gradle/jdk/OpenJDK17U-jdk_x64_linux_hotspot_17.0.14_7-a3ebc3/jdk-17.0.14+7/bin/java:
      not found


      [stderr]
      Traceback (most recent call last):
        File "<string>", line 11, in <module>
          wheel_filename = backend.build_wheel("/root/.cache/uv/builds-v0/.tmpi1gAEr", {}, None)
        File "/root/.cache/uv/sdists-v9/pypi/kson-lang/0.1.0/mvaokqzVFQNtlTkih2iCu/src/build_backend.py", line 80, in build_wheel
          _ensure_native_artifacts()
          ~~~~~~~~~~~~~~~~~~~~~~~~^^
        File "/root/.cache/uv/sdists-v9/pypi/kson-lang/0.1.0/mvaokqzVFQNtlTkih2iCu/src/build_backend.py", line 40, in _ensure_native_artifacts
          raise RuntimeError("Failed to build native artifacts")
      RuntimeError: Failed to build native artifacts

      hint: This usually indicates a problem with the package or the build environment.

It seems there are additional build requirements when installing from PyPI which aren't specified on the PyPI page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions