Make pip/editable installs work from source (version parsing + full install_requires)#261
Merged
Conversation
…talls)
setup.py's get_version_str() did 'from ptsa import __version__', which
fails under PEP 517 build isolation ('pip install -e .' / 'pip install
.'): the package isn't on sys.path or installed yet, so
get_requires_for_build_editable errored with ModuleNotFoundError before
the build could start. Parse __version__ out of ptsa/__init__.py with a
regex instead — no import needed.
Verified: 'pip install -e .' now succeeds with build isolation in a
clean env (no preinstalled ptsa); the editable package imports and its
compiled extensions load from outside the source tree.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
pip installs only pulled numpy/scipy/xarray, so a 'pip install [-e] .' into a lean env imported fine for those but died on 'import traits' / 'import h5py' at runtime. Add the rest of the runtime deps (traits, h5py, netcdf4, pandas, six) with the same bounds as the conda recipe's run: list (FFTW omitted — native, not pip-installable; pybind11 omitted — build-only). Verified in a fresh conda env containing only python+fftw+compiler: 'pip install -e .' now pulls every runtime dep from PyPI and the package imports. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…indows refs - Build-from-source: drop the swig requirement (extensions are pybind11, not SWIG); list the real runtime deps; document the C++ compiler + FFTW as the only non-pip system prereqs. - Install PTSA: build isolation now works (version-import bug fixed), so 'pip install .' and 'pip install -e .' work directly; lead with the editable dev install. - Running Tests: document the editable install + 'pytest pytest-cov sybil' deps and the minimal 'NO_RHINO=1 pytest' command (verified in a clean editable env: 171 passed / 33 skipped). - CI: matrix is ubuntu + macos (Windows dropped; WSL note). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ault - Editable install: give a complete from-scratch recipe (conda env with fftw + gxx_linux-64, then 'pip install -e .'; macOS clang note) rather than pointing at 'System prerequisites'. - Running Tests: state plainly that a default 'pytest' run INCLUDES the rhino-only tests (which read lab data and error off-rhino with 'Rhino root not found!'), and that NO_RHINO=1 skips them (as CI does). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #259 (which is already merged). These four commits landed
on
update_buildafter #259 merged, so they missed it. They makepip install [-e] .actually work from source — verified independentlyon macOS and on rhino.
fix(build): read version without importing ptsa—setup.pyparsed
__version__viafrom ptsa import __version__, whichfails under PEP 517 build isolation (the package isn't importable yet),
so
pip install -e .died inget_requires_for_build_editable.Now it reads
ptsa/__init__.pywith a regex — no import.fix(build): declare full runtime deps in install_requires—install_requiresonly listed numpy/scipy/xarray, so a pip installinto a lean env imported fine for those but died on
import traits/import h5py. Adds the rest (traits, h5py, netcdf4, pandas, six),matching the conda recipe's
run:list. Verified this does notaffect conda builds (
setup.py installdoesn't resolveinstall_requires; the package's conda deps come frommeta.yaml).and a note that a default
pytestrun includes the rhino-only tests(set
NO_RHINO=1to skip them).Validation
pip install -e .in a clean conda env (python + FFTW + compileronly) pulls every runtime dep from PyPI and imports cleanly — confirmed
on macOS and rhino.
setup.py installin a build-deps-only envdoes not fetch the new
install_requiresfrom PyPI.No conda-recipe or extension changes, so the published 3.0.6 binaries
are unchanged by this PR.
🤖 Generated with Claude Code