Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ To re-execute a notebook: `jupyter nbconvert --to notebook --execute --inplace <
A notebook handed to students must not change under them, so on Colab each one clones a release
tag, not `main`, and the package fetches tables from the same tag. To cut the next one:

1. Set `TAG` in `src/orteach/paths.py` and `REF` in every setup cell (the eleven seeds and the six
1. Set `TAG` in `src/orteach/paths.py`, `version` in `pyproject.toml`, and `REF` in every setup cell (the eleven seeds and the six
notebooks edited in place) to the new tag. `check_notebooks.py` refuses any setup cell that
disagrees with `TAG`.
disagrees with `TAG`, and `tests/test_paths.py` refuses a package version that does.
2. Re-execute, merge through a pull request with CI green.
3. Tag the merge commit, annotated, and check it peels to that commit:
`git tag -a vX.Y.Z <sha> -m "..."`, `git push origin vX.Y.Z`,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "orteach"
version = "0.1.0"
version = "1.0.0"
description = "Teaching models for IE 3315, IE 5301 and REE 4301 — the package half of the notebook/package split"
requires-python = ">=3.10,<3.14"

Expand Down
13 changes: 13 additions & 0 deletions tests/test_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@

import pytest

if sys.version_info >= (3, 11):
import tomllib
else: # declared in dev for 3.10; never skipped
import tomli as tomllib

sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(
os.path.abspath(__file__))), "src"))

Expand Down Expand Up @@ -71,3 +76,11 @@ def fake_retrieve(url, dest):
def test_the_url_names_the_release_tag_not_a_branch():
assert "/%s/data/raw/" % paths.TAG in paths.RAW_URL
assert "/main/" not in paths.RAW_URL and paths.TAG.startswith("v")


def test_the_package_version_is_the_tag_the_notebooks_clone():
"""A release is one number: the version pip reports and the tag Colab clones must agree."""
root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
with open(os.path.join(root, "pyproject.toml"), "rb") as f:
version = tomllib.load(f)["project"]["version"]
assert "v" + version == paths.TAG, (version, paths.TAG)
Loading