ms-env 0.3.0__tar.gz → 0.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. {ms_env-0.3.0 → ms_env-0.3.2}/PKG-INFO +1 -1
  2. {ms_env-0.3.0 → ms_env-0.3.2}/docs/guide.md +4 -1
  3. {ms_env-0.3.0 → ms_env-0.3.2}/src/ms_env/app.py +14 -1
  4. {ms_env-0.3.0 → ms_env-0.3.2}/src/ms_env.egg-info/PKG-INFO +1 -1
  5. ms_env-0.3.2/src/ms_env.egg-info/scm_version.json +8 -0
  6. {ms_env-0.3.0 → ms_env-0.3.2}/tests/test_ms_env.py +18 -0
  7. ms_env-0.3.0/src/ms_env.egg-info/scm_version.json +0 -8
  8. {ms_env-0.3.0 → ms_env-0.3.2}/.github/workflows/ci.yml +0 -0
  9. {ms_env-0.3.0 → ms_env-0.3.2}/.github/workflows/docs.yml +0 -0
  10. {ms_env-0.3.0 → ms_env-0.3.2}/.github/workflows/publish.yml +0 -0
  11. {ms_env-0.3.0 → ms_env-0.3.2}/.gitignore +0 -0
  12. {ms_env-0.3.0 → ms_env-0.3.2}/LICENSE +0 -0
  13. {ms_env-0.3.0 → ms_env-0.3.2}/README.md +0 -0
  14. {ms_env-0.3.0 → ms_env-0.3.2}/docs/api_reference.md +0 -0
  15. {ms_env-0.3.0 → ms_env-0.3.2}/docs/index.md +0 -0
  16. {ms_env-0.3.0 → ms_env-0.3.2}/pyproject.toml +0 -0
  17. {ms_env-0.3.0 → ms_env-0.3.2}/setup.cfg +0 -0
  18. {ms_env-0.3.0 → ms_env-0.3.2}/src/ms_env/__init__.py +0 -0
  19. {ms_env-0.3.0 → ms_env-0.3.2}/src/ms_env/host.py +0 -0
  20. {ms_env-0.3.0 → ms_env-0.3.2}/src/ms_env/recipes.py +0 -0
  21. {ms_env-0.3.0 → ms_env-0.3.2}/src/ms_env/steps.py +0 -0
  22. {ms_env-0.3.0 → ms_env-0.3.2}/src/ms_env.egg-info/SOURCES.txt +0 -0
  23. {ms_env-0.3.0 → ms_env-0.3.2}/src/ms_env.egg-info/dependency_links.txt +0 -0
  24. {ms_env-0.3.0 → ms_env-0.3.2}/src/ms_env.egg-info/requires.txt +0 -0
  25. {ms_env-0.3.0 → ms_env-0.3.2}/src/ms_env.egg-info/scm_file_list.json +0 -0
  26. {ms_env-0.3.0 → ms_env-0.3.2}/src/ms_env.egg-info/top_level.txt +0 -0
  27. {ms_env-0.3.0 → ms_env-0.3.2}/zensical.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ms_env
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: Environments for MolSuite apps: find or install external tools, on this machine or over ssh.
5
5
  Author: Mario S. Valdés-Tresanco, Mario E. Valdés-Tresanco
6
6
  License-Expression: MIT
@@ -177,7 +177,10 @@ ensure(recipe, host).future.result()
177
177
  What travels and what is downloaded:
178
178
 
179
179
  - A package imported from a source checkout goes as a wheel of its code as it
180
- is now. The wheel is built once for each state of the code.
180
+ is now. The wheel is built once for each state of the code and of its last
181
+ tag, where its version comes from. A checkout that lacks the tag of a release
182
+ made on the server builds a development version below it, which the host
183
+ refuses for an app that asks for that release: `git fetch --tags` in it.
181
184
  - A package that is installed here is asked for in the version it has.
182
185
  - Everything else the host downloads, pinned to the versions of this
183
186
  environment, so the two machines may be different systems.
@@ -34,8 +34,21 @@ def _checkout(module: str) -> Path | None:
34
34
  return next((parent for parent in origin.parents if (parent / "pyproject.toml").is_file()), None)
35
35
 
36
36
 
37
+ def _described(root: Path) -> str:
38
+ """`git describe` of the checkout at `root`: the version of its wheel comes from the last tag,
39
+ which may change while the code does not. Without git, nothing."""
40
+ if not (root / ".git").exists():
41
+ return ""
42
+ try:
43
+ return subprocess.run(["git", "-C", str(root), "describe", "--tags", "--long", "--always"],
44
+ capture_output=True, text=True, timeout=30, check=False).stdout.strip()
45
+ except (OSError, subprocess.TimeoutExpired):
46
+ return ""
47
+
48
+
37
49
  def _tree_hash(root: Path, module: str) -> str:
38
- digest = hashlib.sha256((root / "pyproject.toml").read_bytes())
50
+ """What the wheel of the checkout depends on: its code and the tag its version comes from."""
51
+ digest = hashlib.sha256((root / "pyproject.toml").read_bytes() + _described(root).encode())
39
52
  package = Path(importlib.util.find_spec(module).origin).resolve().parent
40
53
  for path in sorted(package.rglob("*")):
41
54
  if path.is_file() and "__pycache__" not in path.parts:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ms_env
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: Environments for MolSuite apps: find or install external tools, on this machine or over ssh.
5
5
  Author: Mario S. Valdés-Tresanco, Mario E. Valdés-Tresanco
6
6
  License-Expression: MIT
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "0.3.2",
3
+ "distance": 0,
4
+ "node": "g3f644bbfcaf555dc7cedf971907597ad44ef3f75",
5
+ "dirty": false,
6
+ "branch": "HEAD",
7
+ "node_date": "2026-10-28"
8
+ }
@@ -1,6 +1,7 @@
1
1
  """Tool recipes: TOML binding, lookup order, env bootstrap script, project-less installs, whose a prefix is."""
2
2
  from __future__ import annotations
3
3
 
4
+ import subprocess
4
5
  import dataclasses
5
6
  import json
6
7
  import sys
@@ -325,3 +326,20 @@ def test_windows_layout_and_platform_names():
325
326
  assert tools.conda_platform("Windows", "AMD64") == "win-64"
326
327
  assert tools.conda_platform("Darwin", "arm64") == "osx-arm64"
327
328
  assert tools.conda_platform("Linux", "x86_64") == "linux-64" == Host().platform() or sys.platform != "linux"
329
+
330
+
331
+ def test_a_new_tag_on_the_same_code_builds_a_new_wheel(tmp_path):
332
+ from ms_env import app
333
+
334
+ def git(*words):
335
+ subprocess.run(["git", "-C", str(tmp_path), "-c", "user.name=t", "-c", "user.email=t@t", *words],
336
+ check=True, capture_output=True)
337
+
338
+ git("init", "-q")
339
+ git("commit", "-q", "--allow-empty", "-m", "one")
340
+ git("tag", "v0.1.0")
341
+ git("commit", "-q", "--allow-empty", "-m", "docs only")
342
+ before = app._described(tmp_path)
343
+ git("tag", "v0.2.0") # a release of the same code: its wheel has another version
344
+ assert before.startswith("v0.1.0-1-g") and app._described(tmp_path).startswith("v0.2.0-0-g")
345
+ assert app._described(tmp_path / "not-a-checkout") == ""
@@ -1,8 +0,0 @@
1
- {
2
- "tag": "0.3.0",
3
- "distance": 0,
4
- "node": "gdf83d1f895ee2bbc643067d4692195ceb5e9a3b1",
5
- "dirty": false,
6
- "branch": "HEAD",
7
- "node_date": "2026-10-22"
8
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes