Skip to content

Package as poetry-managed pip-installable library#1

Merged
transfix merged 3 commits into
mainfrom
chore/poetry-packaging
May 18, 2026
Merged

Package as poetry-managed pip-installable library#1
transfix merged 3 commits into
mainfrom
chore/poetry-packaging

Conversation

@transfix
Copy link
Copy Markdown
Contributor

@transfix transfix commented May 18, 2026

Adds Poetry-based packaging so GRL-SNAM can be installed from source or PyPI and used as a dependency by downstream projects.

What changed

  • New pyproject.toml (Poetry / PEP 621) declaring grl-snam 0.1.0, dependencies, and an optional dev group (pytest + ruff).
  • New grl_snam/ shim package exposing stable imports (CoefEnergyNet, integrate_surrogate, dynamics, network, adaptation, utils) on top of the existing flat-layout modules — no behaviour changes.
  • tests/test_smoke.py covering the public import surface (3/3 passing).
  • .github/workflows/ci.yml running smoke tests on Python 3.10 / 3.11 / 3.12.
  • README "Installation" section rewritten for pip install -e . and Poetry usage.
  • .gitignore for Python build/cache artifacts.

Verification

  • poetry check passes (with only Poetry 2.x style deprecation warnings).
  • poetry build produces grl_snam-0.1.0.tar.gz and grl_snam-0.1.0-py3-none-any.whl.
  • pip install -e . + pytest → 3/3 smoke tests pass.

GRL-SNAM dev and others added 3 commits May 18, 2026 00:37
Adds a thin `grl_snam` shim package at the repo root that re-exports
the public API (CoefEnergyNet, integrate_surrogate_v2, HistSecantController,
utils) from the existing flat layout. The flat layout (train_coef_energy.py,
surrogate_robust.py, eval_coef_energy.py, scripts/, experiments/, src/)
is preserved unchanged so all existing research scripts continue to work.

- Add pyproject.toml (Poetry, Python 3.10+, PEP 517 build via poetry-core)
- Add tests/test_smoke.py exercising the new public import paths
- Add ruff and pytest configuration
- Add GitHub Actions CI workflow (lint + test on 3.10/3.11/3.12)
- Add .gitignore covering build artefacts, venvs, training outputs

Install:
    pip install -e .              # local dev
    pip install grl-snam          # once published

Downstream projects (e.g. the DBG extension) can now declare
`grl-snam` as a regular dependency.
Resolves Poetry 2.x deprecation warnings by moving name/version/
description/authors/license/readme/keywords/classifiers/dependencies/
urls into the standard [project] table. Poetry-specific bits (packages
list and dev group) stay under [tool.poetry]. Build output unchanged.

  poetry check  -> All set!
  poetry build  -> grl_snam-0.1.0.tar.gz + wheel
- Narrow ruff's include to grl_snam/ and tests/ so CI lints only the
  packaging shim and its tests, not the legacy flat-layout research
  scripts (experiments/, scripts/, src/, train_*.py, etc.) which carry
  thousands of pre-existing style issues unrelated to packaging.
- Replace the Poetry-based CI install with a pip-based one that pulls
  torch from the CPU-only index, eliminating multi-GB CUDA wheel
  downloads on every run.
- Bump actions/checkout@v5 and actions/setup-python@v6 to use a
  supported Node.js runtime, and add pip caching.

Local verification:
  ruff check .  -> All checks passed!
  pytest -q     -> 3 passed
@transfix transfix merged commit 9bf996f into main May 18, 2026
3 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