Imported from czymh/jet (
AGENTS.md). Install upstream withnpx skills add czymh/jet. Copyright stays with the author.
AGENTS.md
Guidelines for AI coding assistants working in this repository. jet is a
standard-layout (flat) Python package with ACM-style version management
(bump2version + VERSION file + CI workflows).
Repository layout (standard flat layout)
jet/— the Python package at the repository root (NOTpy/jet/, NOTsrc/). Do not move it.__init__.py— exposes__version__viaimportlib.metadata.version("jet"); do not read the VERSION file from here
tests/— tests at the repository root, organized by module (tests/test_<module>.py).VERSION— single source of truth for the version; one line (X.Y.ZorX.Y.Z-dev.N). Never edit by hand..bumpversion.cfg— bump2version config;current_versionmust always matchVERSIONpyproject.toml— metadata + tool config;[tool.setuptools.dynamic] version = {file = "VERSION"}and[tool.pytest.ini_options] pythonpath = ["."]are intentional.github/workflows/— CI (format/lint/test + version bump workflows)README.md,LICENSE(BSD-3-Clause recommended),.gitignore
Naming
- Package name
jet: short, lowercase, no hyphens (it is exported as an env var; shells reject hyphens). - Tests: files
test_*.py, classesTestXxx(unittest.TestCase), methodstest_*. - Private helpers/parsers use a leading underscore (
_parse_arguments); CLI entry point is alwaysmain()returning an int exit code.
Tests (unittest style)
- Write tests with standard-library
unittest.TestCase(CI runs them via pytest; do not switch to bare pytest functions). - Every test class implements
setUp/tearDown(class-levelsetUpClass/tearDownClasswhen needed). - Mock external dependencies with
unittest.mock.patch(e.g.@patch('sys.argv', ...),@patch('builtins.print')). - Import the module under test as a top-level package import:
from jet.<module> import .... - Run:
pip install -e .[test]thenpytest. Single test:pytest tests/test_main.py.
Coding style
- numpy-style docstrings (module, function,
Returns); follow the lint config inpyproject.tomlbefore pushing. - No large data files in the repo. Weights are distributed via GitHub Release and
auto-fetched on first use (
resolve_weights_path, disabled byJET_NO_AUTO_FETCH); runtools/publish_data.pyafter retraining.
README
README.md(Markdown, auto-rendered on GitHub).- Structure: status badges (CI / coverage / docs) at top, then Introduction, install command
(
pip install git+https://github.com/czymh/jet.git@<tag>), quickstart, directory overview, contributing/license.
Version management (bump2version, ACM-style)
- Version lives in the top-level
VERSIONfile (one line, e.g.0.1.0-dev.3). Release formatX.Y.Z; dev formatX.Y.Z-dev.N. - Never edit
VERSIONor.bumpversion.cfgby hand.bump2versionowns both — it rewrites the version, commits, and tags atomically. Run it explicitly only when asked. - Bump types:
patch/minor/majorfor releases (auto tag created),devfor dev increments (no tag). - CI automates all bumps (see
.github/workflows/):- Merge to
devtouchingjet/**→ autobump2version dev(no tag). - Merge to
main→ the PR must carry exactly one ofbump:patch/bump:minor/bump:majorlabels (enforced bycheck-version-label.yml); the bump creates a tag + GitHub release, thenmainis merged back intodevto keep versions in sync.
- Merge to
- On a version conflict when merging: set
current_version(andVERSION) to the target branch's current value and let CI bump after merge — never bump manually to "fix" the conflict.