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.
- {ms_env-0.3.0 → ms_env-0.3.2}/PKG-INFO +1 -1
- {ms_env-0.3.0 → ms_env-0.3.2}/docs/guide.md +4 -1
- {ms_env-0.3.0 → ms_env-0.3.2}/src/ms_env/app.py +14 -1
- {ms_env-0.3.0 → ms_env-0.3.2}/src/ms_env.egg-info/PKG-INFO +1 -1
- ms_env-0.3.2/src/ms_env.egg-info/scm_version.json +8 -0
- {ms_env-0.3.0 → ms_env-0.3.2}/tests/test_ms_env.py +18 -0
- ms_env-0.3.0/src/ms_env.egg-info/scm_version.json +0 -8
- {ms_env-0.3.0 → ms_env-0.3.2}/.github/workflows/ci.yml +0 -0
- {ms_env-0.3.0 → ms_env-0.3.2}/.github/workflows/docs.yml +0 -0
- {ms_env-0.3.0 → ms_env-0.3.2}/.github/workflows/publish.yml +0 -0
- {ms_env-0.3.0 → ms_env-0.3.2}/.gitignore +0 -0
- {ms_env-0.3.0 → ms_env-0.3.2}/LICENSE +0 -0
- {ms_env-0.3.0 → ms_env-0.3.2}/README.md +0 -0
- {ms_env-0.3.0 → ms_env-0.3.2}/docs/api_reference.md +0 -0
- {ms_env-0.3.0 → ms_env-0.3.2}/docs/index.md +0 -0
- {ms_env-0.3.0 → ms_env-0.3.2}/pyproject.toml +0 -0
- {ms_env-0.3.0 → ms_env-0.3.2}/setup.cfg +0 -0
- {ms_env-0.3.0 → ms_env-0.3.2}/src/ms_env/__init__.py +0 -0
- {ms_env-0.3.0 → ms_env-0.3.2}/src/ms_env/host.py +0 -0
- {ms_env-0.3.0 → ms_env-0.3.2}/src/ms_env/recipes.py +0 -0
- {ms_env-0.3.0 → ms_env-0.3.2}/src/ms_env/steps.py +0 -0
- {ms_env-0.3.0 → ms_env-0.3.2}/src/ms_env.egg-info/SOURCES.txt +0 -0
- {ms_env-0.3.0 → ms_env-0.3.2}/src/ms_env.egg-info/dependency_links.txt +0 -0
- {ms_env-0.3.0 → ms_env-0.3.2}/src/ms_env.egg-info/requires.txt +0 -0
- {ms_env-0.3.0 → ms_env-0.3.2}/src/ms_env.egg-info/scm_file_list.json +0 -0
- {ms_env-0.3.0 → ms_env-0.3.2}/src/ms_env.egg-info/top_level.txt +0 -0
- {ms_env-0.3.0 → ms_env-0.3.2}/zensical.toml +0 -0
|
@@ -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
|
-
|
|
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,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") == ""
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|