Skip to content

Commit ef6e057

Browse files
authored
ci,config(fix): Harden smoke test and VCS matrix (#588)
why: The runtime dependency smoke test resolved unpinned dependencies, CI skipped Mercurial and Subversion checkouts, and legacy-option load warnings concatenated workspace keys lacking a trailing slash. what: - Run scripts/runtime_dep_smoketest.py with --frozen against uv.lock - Install Git, Mercurial, and Subversion in CI and pin UV_PYTHON - Separate workspace and repo names in load_configs() legacy warnings - Isolate test_config_variations checkouts per test directory
2 parents bcd5709 + 06983c0 commit ef6e057

6 files changed

Lines changed: 63 additions & 18 deletions

File tree

‎.github/CONTRIBUTING.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,18 @@ the dev/test extras by importing every `vcspull` module and exercising each
128128
CLI subcommand with `--help` in an isolated environment:
129129

130130
```console
131-
$ uvx \
131+
$ uv run \
132132
--isolated \
133133
--no-cache \
134-
--from . \
134+
--no-dev \
135+
--no-editable \
136+
--frozen \
135137
python scripts/runtime_dep_smoketest.py
136138
```
137139

138140
The same check has a pytest wrapper behind a dedicated marker, and both are
139-
network-dependent because `uvx` builds the package in an isolated
140-
environment:
141+
network-dependent because `uv` builds the wheel in an isolated environment
142+
with the runtime dependencies from `uv.lock`:
141143

142144
```console
143145
$ uv run pytest \

‎.github/workflows/tests.yml‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ jobs:
77
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
88

99
runs-on: ubuntu-latest
10+
env:
11+
UV_PYTHON: ${{ matrix.python-version }}
1012
strategy:
1113
matrix:
1214
python-version: ['3.15']
@@ -21,13 +23,23 @@ jobs:
2123
- name: Set up Python ${{ matrix.python-version }}
2224
run: uv python install ${{ matrix.python-version }}
2325

26+
- name: Install native VCS tools
27+
run: |
28+
sudo apt-get update
29+
sudo apt-get install --yes --no-install-recommends git mercurial subversion
30+
git --version
31+
hg --version
32+
svn --version --quiet
33+
svnadmin --version --quiet
34+
2435
- name: Install dependencies
25-
run: uv sync --all-extras --dev
36+
run: uv sync --frozen --all-extras --dev
2637

2738
- name: Print python versions
2839
run: |
2940
python -V
3041
uv run python -V
42+
uv run python -c 'import os, sys; assert ".".join(map(str, sys.version_info[:2])) == os.environ["UV_PYTHON"]'
3143
3244
- name: Lint with ruff check
3345
run: uv run ruff check .
@@ -39,14 +51,14 @@ jobs:
3951
run: uv run mypy .
4052

4153
- name: Test with pytest
42-
run: uv run py.test --cov=./ --cov-append --cov-report=xml
54+
run: uv run py.test -ra --cov=./ --cov-append --cov-report=xml
4355
env:
4456
COV_CORE_SOURCE: .
4557
COV_CORE_CONFIG: pyproject.toml
4658
COV_CORE_DATAFILE: .coverage.eager
4759

4860
- name: Runtime dependency smoke test
49-
run: uvx --isolated --no-cache --from . python scripts/runtime_dep_smoketest.py
61+
run: uv run --isolated --no-cache --no-dev --no-editable --frozen python scripts/runtime_dep_smoketest.py
5062

5163
- uses: codecov/codecov-action@v7
5264
with:

‎CHANGES‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ _Notes on upcoming releases will be added here_
4545
Python 3.10 reached end-of-life in October 2026. vcspull now requires Python
4646
3.11 or newer.
4747

48+
### Fixes
49+
50+
#### Separate workspace and repository names in legacy-key warnings (#588)
51+
52+
Configuration load warnings quote and separate the workspace root and
53+
repository name (`'~/code' -> 'flask'`) so workspace labels written without a
54+
trailing slash remain distinct.
55+
4856
## vcspull v1.68.0 (2026-10-24)
4957

5058
vcspull v1.68.0 adds Python 3.15 support. PyPI lists Python 3.15 among the

‎scripts/test_runtime_dep_smoketest.py‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,23 @@
1818

1919

2020
def test_runtime_smoke_test_script() -> None:
21-
"""Run ``scripts/runtime_dep_smoketest.py`` in a clean uvx environment."""
22-
uvx = shutil.which("uvx")
23-
if uvx is None:
24-
pytest.skip("uvx is required to run the runtime dependency smoke test")
21+
"""Run the installed wheel with only its locked runtime dependencies."""
22+
uv = shutil.which("uv")
23+
if uv is None:
24+
pytest.skip("uv is required to run the runtime dependency smoke test")
2525

2626
repo_root = pathlib.Path(__file__).resolve().parents[1]
2727
script_path = repo_root / "scripts" / "runtime_dep_smoketest.py"
2828

2929
result = subprocess.run(
3030
[
31-
uvx,
31+
uv,
32+
"run",
3233
"--isolated",
3334
"--no-cache",
34-
"--from",
35-
str(repo_root),
35+
"--no-dev",
36+
"--no-editable",
37+
"--frozen",
3638
"python",
3739
str(script_path),
3840
],

‎src/vcspull/config.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,9 @@ def load_configs(
593593
if warn_legacy_options:
594594
legacy_entries = detect_legacy_repo_options(config_content)
595595
if legacy_entries:
596-
affected = ", ".join(f"{label}{name}" for label, name in legacy_entries)
596+
affected = ", ".join(
597+
f"'{label}' -> '{name}'" for label, name in legacy_entries
598+
)
597599
log.warning(
598600
"%s: top-level rev/shallow/depth are deprecated; move them "
599601
"under 'options:' (run 'vcspull migrate'). Affected: %s",

‎tests/test_sync.py‎

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def write_config_remote(
8383
return write_config(
8484
config_path=config_path,
8585
content=config_tpl.format(
86-
tmp_path=str(tmp_path.parent),
86+
tmp_path=str(tmp_path),
8787
path=path,
8888
CLONE_NAME=clone_name,
8989
),
@@ -137,7 +137,7 @@ class ConfigVariationTest(t.NamedTuple):
137137
{CLONE_NAME}:
138138
repo: git+file://{path}
139139
remotes:
140-
git_scheme_repo: git@codeberg.org:tmux-python/tmuxp.git
140+
git_scheme_repo: file://{path}
141141
""",
142142
remote_list=["git_scheme_repo"],
143143
),
@@ -148,7 +148,7 @@ class ConfigVariationTest(t.NamedTuple):
148148
{CLONE_NAME}:
149149
repo: git+file://{path}
150150
remotes:
151-
git_scheme_repo: git@github.com:tony/vcspull.git
151+
git_scheme_repo: "{path}"
152152
""",
153153
remote_list=["git_scheme_repo"],
154154
),
@@ -668,6 +668,25 @@ def test_load_configs_warns_on_legacy_options(
668668
assert record.vcspull_legacy_count == affected_count
669669

670670

671+
def test_load_configs_legacy_warning_separates_names(
672+
tmp_path: pathlib.Path,
673+
caplog: pytest.LogCaptureFixture,
674+
) -> None:
675+
"""Separate workspace and repository names in legacy-option warnings."""
676+
config_file = tmp_path / ".vcspull.yaml"
677+
save_config_yaml(config_file, {"~/code": {"flask": {"repo": _REPO, "rev": "v1"}}})
678+
679+
with caplog.at_level(logging.WARNING, logger="vcspull.config"):
680+
load_configs([config_file], warn_legacy_options=True)
681+
682+
legacy_records = [
683+
record for record in caplog.records if hasattr(record, "vcspull_legacy_count")
684+
]
685+
assert len(legacy_records) == 1
686+
assert legacy_records[0].vcspull_legacy_count == 1
687+
assert "Affected: '~/code' -> 'flask'" in legacy_records[0].getMessage()
688+
689+
671690
class BranchErrorDetectionFixture(t.NamedTuple):
672691
"""pytest fixture for _looks_like_branch_error classification."""
673692

0 commit comments

Comments
 (0)