Skip to content

Make pip/editable installs work from source (version parsing + full install_requires)#261

Merged
Riley16 merged 4 commits into
masterfrom
update_build
May 28, 2026
Merged

Make pip/editable installs work from source (version parsing + full install_requires)#261
Riley16 merged 4 commits into
masterfrom
update_build

Conversation

@Riley16

@Riley16 Riley16 commented May 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #259 (which is already merged). These four commits landed
on update_build after #259 merged, so they missed it. They make
pip install [-e] . actually work from source — verified independently
on macOS and on rhino.

  • fix(build): read version without importing ptsasetup.py
    parsed __version__ via from ptsa import __version__, which
    fails under PEP 517 build isolation (the package isn't importable yet),
    so pip install -e . died in get_requires_for_build_editable.
    Now it reads ptsa/__init__.py with a regex — no import.
  • fix(build): declare full runtime deps in install_requires
    install_requires only listed numpy/scipy/xarray, so a pip install
    into 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 not
    affect conda builds (setup.py install doesn't resolve
    install_requires; the package's conda deps come from
    meta.yaml).
  • README — self-contained editable dev-env recipe (FFTW + compiler),
    and a note that a default pytest run includes the rhino-only tests
    (set NO_RHINO=1 to skip them).

Validation

  • pip install -e . in a clean conda env (python + FFTW + compiler
    only) pulls every runtime dep from PyPI and imports cleanly — confirmed
    on macOS and rhino.
  • conda build unaffected: setup.py install in a build-deps-only env
    does not fetch the new install_requires from PyPI.

No conda-recipe or extension changes, so the published 3.0.6 binaries
are unchanged by this PR.

🤖 Generated with Claude Code

Riley16 and others added 4 commits May 27, 2026 17:18
…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>
@Riley16 Riley16 merged commit f70f653 into master May 28, 2026
13 checks passed
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