Package as poetry-managed pip-installable library#1
Merged
Conversation
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
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.
Adds Poetry-based packaging so GRL-SNAM can be installed from source or PyPI and used as a dependency by downstream projects.
What changed
pyproject.toml(Poetry / PEP 621) declaringgrl-snam0.1.0, dependencies, and an optional dev group (pytest + ruff).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.pycovering the public import surface (3/3 passing)..github/workflows/ci.ymlrunning smoke tests on Python 3.10 / 3.11 / 3.12.pip install -e .and Poetry usage..gitignorefor Python build/cache artifacts.Verification
poetry checkpasses (with only Poetry 2.x style deprecation warnings).poetry buildproducesgrl_snam-0.1.0.tar.gzandgrl_snam-0.1.0-py3-none-any.whl.pip install -e .+pytest→ 3/3 smoke tests pass.