Skip to content

Modernize packaging; fix pip install with build isolation (#84)#86

Merged
mariomulansky merged 3 commits into
developfrom
fix/issue-84-modernize-packaging
May 11, 2026
Merged

Modernize packaging; fix pip install with build isolation (#84)#86
mariomulansky merged 3 commits into
developfrom
fix/issue-84-modernize-packaging

Conversation

@mariomulansky
Copy link
Copy Markdown
Owner

Issue #84: 'pip install pyspike' fails on modern pip/setuptools with 'ModuleNotFoundError: No module named numpy' because pip builds in an isolated environment that doesn't see numpy from the user's venv, but setup.py calls numpy.get_include() for the Cython extensions.

  • Add pyproject.toml with full [project] metadata moved from setup.py
  • Declare numpy, Cython, setuptools>=77 and wheel in build-system.requires
  • Replace deprecated BSD License classifier with SPDX 'BSD-2-Clause'
  • Remove setup.cfg (description-file deprecation), metadata in pyproject.toml
  • Update supported Python versions (drop 3.7/3.8 EOL, add 3.11/3.12/3.13)
  • Refresh CI to use pip install . so the matrix actually tests the build-isolation path that broke
  • Slim setup.py to only the Cython/ext_modules logic
  • Update MANIFEST.in to ship .pyx/.pxd sources in sdist
  • Remove SetupNoPrompt.py (workaround for a long-disabled input() prompt)

Closes #84.

Issue #84: 'pip install pyspike' fails on modern pip/setuptools with
'ModuleNotFoundError: No module named numpy' because pip builds in an
isolated environment that doesn't see numpy from the user's venv, but
setup.py calls numpy.get_include() for the Cython extensions.

- Add pyproject.toml with full [project] metadata moved from setup.py
- Declare numpy, Cython, setuptools>=77 and wheel in build-system.requires
- Replace deprecated BSD License classifier with SPDX 'BSD-2-Clause'
- Remove setup.cfg (description-file deprecation), metadata in pyproject.toml
- Update supported Python versions (drop 3.7/3.8 EOL, add 3.11/3.12/3.13)
- Refresh CI to use pip install . so the matrix actually tests the
  build-isolation path that broke
- Slim setup.py to only the Cython/ext_modules logic
- Update MANIFEST.in to ship .pyx/.pxd sources in sdist
- Remove SetupNoPrompt.py (workaround for a long-disabled input() prompt)

Closes #84.
pkg_resources is provided by setuptools, and starting with Python 3.12
venv no longer installs setuptools by default. After 'pip install .' in a
fresh 3.12+ environment the runtime venv contains only pyspike and numpy,
so 'import pyspike' raised ModuleNotFoundError: No module named
'pkg_resources' and every test file failed to collect (pytest exit code 2).

Switch to importlib.metadata.version, which has been in the standard
library since Python 3.8 and works regardless of whether setuptools is
present at runtime.
@mariomulansky mariomulansky merged commit d3de36c into develop May 11, 2026
10 checks passed
mariomulansky added a commit that referenced this pull request May 11, 2026
Minor version bump rather than patch because PySpike now requires
Python 3.9 (3.7 and 3.8 support was dropped in the packaging
modernization in #86).

Highlights since 0.8.0:
- pyproject.toml-based packaging, fixes pip install with build isolation (#84)
- Python 3.12 and 3.13 support
- CI tests both the Cython and pure-Python install paths
mariomulansky added a commit that referenced this pull request May 11, 2026
* Update setup.py with new version number

* Modernize packaging; fix pip install with build isolation (#84) (#86)

* Modernize packaging; fix pip install with build isolation (#84)

Issue #84: 'pip install pyspike' fails on modern pip/setuptools with
'ModuleNotFoundError: No module named numpy' because pip builds in an
isolated environment that doesn't see numpy from the user's venv, but
setup.py calls numpy.get_include() for the Cython extensions.

- Add pyproject.toml with full [project] metadata moved from setup.py
- Declare numpy, Cython, setuptools>=77 and wheel in build-system.requires
- Replace deprecated BSD License classifier with SPDX 'BSD-2-Clause'
- Remove setup.cfg (description-file deprecation), metadata in pyproject.toml
- Update supported Python versions (drop 3.7/3.8 EOL, add 3.11/3.12/3.13)
- Refresh CI to use pip install . so the matrix actually tests the
  build-isolation path that broke
- Slim setup.py to only the Cython/ext_modules logic
- Update MANIFEST.in to ship .pyx/.pxd sources in sdist
- Remove SetupNoPrompt.py (workaround for a long-disabled input() prompt)

Closes #84.

* Re-enable no-cython test cases

* Use importlib.metadata for __version__ (fix Python 3.12+)

pkg_resources is provided by setuptools, and starting with Python 3.12
venv no longer installs setuptools by default. After 'pip install .' in a
fresh 3.12+ environment the runtime venv contains only pyspike and numpy,
so 'import pyspike' raised ModuleNotFoundError: No module named
'pkg_resources' and every test file failed to collect (pytest exit code 2).

Switch to importlib.metadata.version, which has been in the standard
library since Python 3.8 and works regardless of whether setuptools is
present at runtime.

* Bump version to 0.9.0

Minor version bump rather than patch because PySpike now requires
Python 3.9 (3.7 and 3.8 support was dropped in the packaging
modernization in #86).

Highlights since 0.8.0:
- pyproject.toml-based packaging, fixes pip install with build isolation (#84)
- Python 3.12 and 3.13 support
- CI tests both the Cython and pure-Python install paths

---------

Co-authored-by: thomaskreuz <thomaskreuz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant