From 24c9a01d86dd3dab90530c3a128f7454696234fa Mon Sep 17 00:00:00 2001 From: John Sirois Date: Fri, 22 Aug 2025 14:20:28 -0700 Subject: [PATCH] Fix `Filelock` usage to work with older versions. --- CHANGES.md | 5 +++++ dev_cmd/__init__.py | 2 +- dev_cmd/venv.py | 2 ++ pyproject.toml | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index ba1ec7e..b5ae376 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,10 @@ # Release Notes +## 0.32.4 + +This release brings compatility with older versions of `filelock` when installing `dev-cmd` with the +`old-pythons` extra. + ## 0.32.3 This release switches from a bespoke lock embedding in dev-cmd distributuons to use of the diff --git a/dev_cmd/__init__.py b/dev_cmd/__init__.py index dfa2254..7b982eb 100644 --- a/dev_cmd/__init__.py +++ b/dev_cmd/__init__.py @@ -1,4 +1,4 @@ # Copyright 2024 John Sirois. # Licensed under the Apache License, Version 2.0 (see LICENSE). -__version__ = "0.32.3" +__version__ = "0.32.4" diff --git a/dev_cmd/venv.py b/dev_cmd/venv.py index 95c09ef..a88840d 100644 --- a/dev_cmd/venv.py +++ b/dev_cmd/venv.py @@ -111,6 +111,7 @@ def marker_environment(python: Python, quiet: bool = False) -> dict[str, str]: fingerprint = _fingerprint(resolved_python.encode()) markers_file = _ensure_cache_dir() / "interpreters" / f"markers.{fingerprint}.json" if not os.path.exists(markers_file): + markers_file.parent.mkdir(parents=True, exist_ok=True) with ( FileLock(f"{markers_file}.lck"), TemporaryDirectory(dir=markers_file.parent, prefix="packaging-venv.") as td, @@ -245,6 +246,7 @@ def ensure( venv_dir = _ensure_cache_dir() / "venvs" / fingerprint layout_file = venv_dir / ".dev-cmd-venv-layout.json" if not os.path.exists(venv_dir): + venv_dir.parent.mkdir(parents=True, exist_ok=True) with FileLock(f"{venv_dir}.lck"): if not os.path.exists(venv_dir): print( diff --git a/pyproject.toml b/pyproject.toml index d581674..fe3b615 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,6 +5,8 @@ requires = [ # 1st support for license expressions was in setuptools 77.0.0. "setuptools>=77", + + "uv", ] build-backend = "pex.build_backend.wrap"