Installed python-z3-solver is not detected as a Python module

Description:

After python-z3-solver is installed, it is not recognized as a Python module when listed with pip --list. Other Arch packages are listed there. z3-solve is usable in Python programs but if developing with a requirement for z3-solver, pip/pipx will install another copy of z3 despite there being a system version available.

Steps to reproduce:

  1. Install python-z3-solver package
  2. Create a minimal pyproject.toml with the following contents:
[build-system]
requires = ["setuptools>=64"]
build-backend = "setuptools.build_meta"

[project]
name = "test-z3"
dependencies = [
    "z3-solver"
]
  1. Run pip --list and note that z3-solver does not appear
  2. Run pip install --break-system-packages --user .

pip will install a local copy of z3-solver in ~/.local/lib/python3.11/site-packages despite it being installed system-wide (remove using pip uninstall --break-system-packages z3-solver)

Fix:

I believe that instead of compiling using cmake and ninja, it would be better to follow https://wiki.archlinux.org/title/Python_package_guidelines#Standards_based_(PEP_517), and run python -m build --wheel --no-isolation -x in src/api/python in the Z3 sources.