Skip to content

Commit e239bbe

Browse files
docs: update .wip files with current migration state
Updated migration documentation to reflect: - Private shim removal (_config.py, _version_cls.py, _cli.py, _get_version_impl.py) - Direct imports from vcs_versioning in __init__.py - Console entry points using vcs_versioning._cli:main - dump_version migration to vcs_versioning - Config module privacy (config.py → _config.py) - Test suite status (408 passing) - Current package structure and file locations
1 parent 97b8bdf commit e239bbe

File tree

4 files changed

+115
-94
lines changed

4 files changed

+115
-94
lines changed

.wip/api-mapping.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
| API | Location | Notes |
1919
|-----|----------|-------|
20-
| `setuptools_scm.get_version` | `setuptools_scm._get_version_impl` | Soft deprecated, wraps vcs_versioning |
21-
| `setuptools_scm._get_version` | `setuptools_scm._get_version_impl` | Internal, wraps vcs_versioning |
22-
| `setuptools_scm.dump_version` | `setuptools_scm._integration.dump_version` | Soft deprecated |
20+
| `setuptools_scm.get_version` | `vcs_versioning._get_version_impl` | Soft deprecated, re-exported from vcs_versioning |
21+
| `setuptools_scm._get_version` | `vcs_versioning._get_version_impl` | Re-exported from vcs_versioning |
22+
| `setuptools_scm.dump_version` | `vcs_versioning._dump_version` | Soft deprecated, re-exported from vcs_versioning |
2323

2424
### Private Modules (moved to vcs_versioning)
2525

@@ -35,12 +35,17 @@
3535

3636
### Backward Compatibility Stubs (setuptools_scm)
3737

38-
These modules re-export from vcs_versioning for backward compatibility:
38+
These **public** modules re-export from vcs_versioning for backward compatibility:
3939

4040
- `setuptools_scm.git` → re-exports from `vcs_versioning._backends._git`
4141
- `setuptools_scm.hg` → re-exports from `vcs_versioning._backends._hg`
4242
- `setuptools_scm.version` → re-exports from `vcs_versioning._version_schemes`
43-
- `setuptools_scm._config` → re-exports from `vcs_versioning.config`
43+
- `setuptools_scm.integration` → re-exports from `vcs_versioning._integration`
44+
- `setuptools_scm.discover` → re-exports from `vcs_versioning._discover`
45+
- `setuptools_scm.fallbacks` → re-exports from `vcs_versioning._fallbacks`
46+
47+
**Note**: Private shims (_config.py, _version_cls.py, _cli.py, _get_version_impl.py) have been removed.
48+
setuptools_scm/__init__.py now imports directly from vcs_versioning.
4449

4550
### Utilities
4651

@@ -68,3 +73,10 @@ These modules re-export from vcs_versioning for backward compatibility:
6873
| `setuptools_scm.files_command` | setuptools_scm | stays in setuptools_scm | setuptools_scm only |
6974
| `setuptools_scm.files_command_fallback` | setuptools_scm | stays in setuptools_scm | setuptools_scm only |
7075

76+
### Console Scripts
77+
78+
| Script | Package | Entry Point |
79+
|--------|---------|-------------|
80+
| `setuptools-scm` | setuptools_scm | `vcs_versioning._cli:main` |
81+
| `vcs-versioning` | vcs_versioning | `vcs_versioning._cli:main` |
82+

.wip/progress.md

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -46,56 +46,52 @@
4646
- [x] Update GitHub Actions (if exists)
4747
- [x] Validate local testing
4848

49-
## Current Status
50-
51-
Phase 1: Completed - Package structure set up
52-
Phase 2: In progress - Core functionality moved, imports being updated
53-
54-
### Phase 1 Completed
55-
- ✅ Updated pyproject.toml with dependencies
56-
- ✅ Added entry points for version_scheme, local_scheme, parse_scm, parse_scm_fallback
57-
- ✅ Created directory structure (_backends/)
58-
59-
### Phase 2 Progress
60-
- ✅ Moved utility files (_run_cmd, _node_utils, _modify_version, _types, _entrypoints, _log, _compat, _overrides, _requirement_cls, _version_cls)
61-
- ✅ Moved VCS backends (git, hg, hg_git) to _backends/
62-
- ✅ Moved scm_workdir to _backends/
63-
- ✅ Moved discover
64-
- ✅ Moved fallbacks (as _fallbacks)
65-
- ✅ Moved CLI modules
66-
- ✅ Moved config (as public config.py)
67-
- ✅ Moved version (as _version_schemes.py)
68-
- ✅ Created scm_version.py (currently re-exports from _version_schemes)
69-
- ✅ Moved _get_version_impl
70-
- ✅ Moved integration utility (_integration.py)
71-
- ✅ Moved toml utility (_toml.py)
72-
- ✅ Created _pyproject_reading.py with core functionality
73-
- ✅ Updated imports in moved files (partially done)
74-
- ✅ Created public __init__.py with API exports
75-
76-
### Next Steps
77-
- Fix remaining import errors
78-
- Test basic imports
79-
- Commit Phase 1 & 2 work
80-
81-
## Latest Status (October 12, 2025 - Updated)
82-
83-
### ✅ COMPLETED - ALL PHASES
49+
## Current Status: ✅ ALL PHASES COMPLETE
50+
51+
All phases have been successfully completed and the refactoring is ready for review.
52+
53+
### Recent Updates (Latest Session)
54+
55+
#### Private Shim Removal (Oct 13, 2025)
56+
- ✅ Removed `_config.py` shim from setuptools_scm (not used internally)
57+
- ✅ Removed `_version_cls.py` shim from setuptools_scm (not used internally)
58+
- ✅ Removed `_cli.py` shim from setuptools_scm (not used internally)
59+
- ✅ Removed `_get_version_impl.py` shim from setuptools_scm (not used internally)
60+
- ✅ Updated `__init__.py` to import directly from vcs_versioning
61+
- ✅ Updated console entry points to use `vcs_versioning._cli:main`
62+
- ✅ Updated test imports to use vcs_versioning modules directly
63+
- ✅ All tests still pass (408 passing)
64+
65+
#### Config Module Privacy
66+
- ✅ Renamed `vcs_versioning/config.py``vcs_versioning/_config.py`
67+
- ✅ Configuration class remains public (exported in __all__)
68+
- ✅ Updated all imports throughout both packages
69+
70+
#### dump_version Migration
71+
- ✅ Moved dump_version logic to `vcs_versioning/_dump_version.py`
72+
- ✅ Shared templates between both packages (no branding differences)
73+
- ✅ setuptools_scm now imports directly from vcs_versioning
74+
75+
## Latest Status (October 13, 2025 - Updated)
76+
77+
### ✅ COMPLETED - ALL PHASES + CLEANUP
8478
- **Phase 1-2**: Package structure and code movement complete
8579
- **Phase 3**: Backward compatibility layer complete
8680
- Circular imports resolved, ScmVersion in _version_schemes
87-
- Re-export stubs in setuptools_scm for backward compatibility
81+
- Re-export stubs in setuptools_scm for PUBLIC API backward compatibility
82+
- **PRIVATE shims removed** (_config.py, _version_cls.py, _cli.py, _get_version_impl.py)
8883
- **Phase 4**: Public API properly exported
8984
- vcs_versioning exports Configuration, ScmVersion, Version
90-
- setuptools_scm re-exports for backward compatibility
85+
- setuptools_scm imports directly from vcs_versioning (no intermediate shims)
9186
- **Phase 5**: Integration layer rebuilt
9287
- setuptools_scm depends on vcs-versioning
9388
- Entry points properly distributed between packages
89+
- Console scripts use `vcs_versioning._cli:main`
9490
- File finders remain in setuptools_scm
9591
- **Phase 6**: Test migration complete
96-
- VCS-agnostic tests moved to vcs-versioning (79 tests)
97-
- Integration tests remain in setuptools_scm (329 tests)
98-
- All test imports fixed to use correct modules
92+
- VCS-agnostic tests moved to vcs-versioning (testingB/)
93+
- Integration tests remain in setuptools_scm (testing/)
94+
- All test imports use vcs_versioning directly
9995
- **Phase 7**: Progress tracked with regular commits
10096
- **Phase 8**: CI/CD ready
10197
- uv workspace configured
@@ -111,20 +107,24 @@ Phase 2: In progress - Core functionality moved, imports being updated
111107

112108
### 📦 Build Status
113109
- `uv sync` successful
114-
- setuptools-scm: version 9.2.2.dev20+g6e22672.d20251012
110+
- setuptools-scm: version 9.2.2.dev40+g97b8bdf.d20251013
115111
- vcs-versioning: version 0.0.1
116112
- Both packages install and import correctly
113+
- Minimal indirection: __init__.py imports directly from vcs_versioning
117114

118115
### 🧪 Test Results - ALL PASSING ✅
119-
- **vcs-versioning**: 79 passed
120-
- **setuptools_scm**: 329 passed, 10 skipped, 1 xfailed
121-
- **Total**: 408 tests passing
122-
- Test run time: ~15s with parallel execution
116+
- **Total**: 408 passed, 10 skipped, 1 xfailed
117+
- Test run time: ~16-17s with parallel execution (`-n12`)
118+
- Combined test suite: `uv run pytest -n12 testing/ nextgen/vcs-versioning/testingB/`
123119

124120
### 🔧 Key Fixes Applied
125121
1. Empty tag regex deprecation warning properly emitted
126122
2. Test mocks patching actual module locations
127123
3. Missing backward compat imports (strip_path_suffix, __main__.py)
128124
4. setuptools.dynamic.version conflict warning
129125
5. Test patches for _git module vs re-exported git
126+
6. **Private shim removal**: No unnecessary re-export layers
127+
7. **Config module privacy**: config.py → _config.py (Configuration is public)
128+
8. **dump_version migration**: Now in vcs_versioning._dump_version
129+
9. **Direct imports**: setuptools_scm.__init__ imports from vcs_versioning
130130

.wip/summary.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,16 @@ All planned phases of the refactoring have been successfully completed. The code
2525
- `_fallbacks.py` - Fallback version parsing
2626
- `_cli.py` - CLI implementation
2727
- `_get_version_impl.py` - Core version logic
28+
- `_dump_version.py` - Version file writing (templates and logic)
29+
- `_config.py` - Configuration class (private module, Configuration is public)
2830
- And more utility modules...
2931

3032
**Entry Points**:
3133
- `setuptools_scm.parse_scm` - VCS parsers
3234
- `setuptools_scm.parse_scm_fallback` - Fallback parsers
3335
- `setuptools_scm.local_scheme` - Local version schemes
3436
- `setuptools_scm.version_scheme` - Version schemes
35-
- `vcs-versioning` script
37+
- `vcs-versioning` script`vcs_versioning._cli:main`
3638

3739
**Tests**: 111 passing (includes backend tests: git, mercurial, hg-git)
3840

@@ -44,20 +46,27 @@ All planned phases of the refactoring have been successfully completed. The code
4446
**Contents**:
4547
- **Integration modules**:
4648
- `_integration/setuptools.py` - Setuptools hooks
47-
- `_integration/dump_version.py` - Version file writing
4849
- `_integration/pyproject_reading.py` - Extended with setuptools-specific logic
49-
- `_integration/version_inference.py` - Version inference
50+
- `_integration/version_inference.py` - Version inference wrapper
5051

5152
- **File finders** (setuptools-specific):
5253
- `_file_finders/` - Git/Hg file finder implementations
5354

54-
- **Re-export stubs** for backward compatibility:
55-
- Most core modules re-export from vcs_versioning
55+
- **Internal modules**:
56+
- `_log.py` - Used by _integration and _file_finders
5657

57-
- **Public API**: Re-exports Configuration, get_version, etc.
58+
- **Re-export stubs** for backward compatibility (public API):
59+
- `git.py`, `hg.py` - Re-export backend functions
60+
- `discover.py`, `fallbacks.py` - Re-export discovery/fallback functions
61+
- `version.py`, `integration.py` - Re-export version schemes and utilities
62+
63+
- **Public API** (`__init__.py`): Imports directly from vcs_versioning
64+
- Configuration, Version, ScmVersion, NonNormalizedVersion
65+
- _get_version, get_version, dump_version
66+
- DEFAULT_* constants
5867

5968
**Entry Points**:
60-
- `setuptools_scm` script
69+
- `setuptools-scm` script`vcs_versioning._cli:main`
6170
- `setuptools.finalize_distribution_options` hooks
6271
- `setuptools_scm.files_command` - File finders
6372

@@ -115,6 +124,10 @@ All planned phases of the refactoring have been successfully completed. The code
115124
3. **Backward compatibility**: Added `__main__.py` shim, fixed imports
116125
4. **Setuptools conflict warning**: Warns when `tool.setuptools.dynamic.version` conflicts with `setuptools-scm[simple]`
117126
5. **Module privacy**: Tests import private APIs directly from vcs_versioning
127+
6. **Private shim removal**: Removed unnecessary re-export shims (_config.py, _version_cls.py, _cli.py, _get_version_impl.py)
128+
7. **Direct imports**: setuptools_scm/__init__.py imports directly from vcs_versioning
129+
8. **dump_version migration**: Moved to vcs_versioning._dump_version with shared templates
130+
9. **Config privacy**: Renamed config.py → _config.py in vcs_versioning (Configuration class is public)
118131

119132
## Next Steps (Recommended)
120133

.wip/test-status.md

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,44 @@
11
# Test Suite Status
22

3-
## Tests to Move to vcs_versioning
4-
5-
- [ ] `test_git.py` - Git backend tests
6-
- [ ] `test_mercurial.py` - Mercurial backend tests
7-
- [ ] `test_hg_git.py` - HG-Git backend tests
8-
- [ ] `test_version.py` - Version scheme tests
9-
- [ ] `test_config.py` - Configuration tests
10-
- [ ] `test_cli.py` - CLI tests
11-
- [ ] `test_functions.py` - Core function tests
12-
- [ ] `test_overrides.py` - Override tests
13-
- [ ] `test_basic_api.py` - Basic API tests (parts)
14-
- [ ] `conftest.py` - Shared fixtures
15-
- [ ] `wd_wrapper.py` - Test helper
16-
17-
## Tests to Keep in setuptools_scm
18-
19-
- [ ] `test_integration.py` - Setuptools integration
20-
- [ ] `test_pyproject_reading.py` - Pyproject reading (update imports)
21-
- [ ] `test_version_inference.py` - Version inference
22-
- [ ] `test_deprecation.py` - Deprecation warnings
23-
- [ ] `test_regressions.py` - Regression tests
24-
- [ ] `test_file_finder.py` - File finder (setuptools-specific)
25-
- [ ] `test_internal_log_level.py` - Log level tests
26-
- [ ] `test_main.py` - Main module tests
27-
- [ ] `test_compat.py` - Compatibility tests
28-
- [ ] `test_better_root_errors.py` - Error handling
29-
- [ ] `test_expect_parse.py` - Parse expectations
3+
## ✅ Tests Moved to vcs_versioning (testingB/)
4+
5+
- [x] `test_git.py` - Git backend tests
6+
- [x] `test_mercurial.py` - Mercurial backend tests
7+
- [x] `test_hg_git.py` - HG-Git backend tests
8+
- [x] `test_version.py` - Version scheme tests
9+
- [x] `test_config.py` - Configuration tests
10+
- [x] `test_functions.py` - Core function tests
11+
- [x] `test_overrides.py` - Override tests
12+
- [x] `test_basic_api.py` - Basic API tests
13+
- [x] `conftest.py` - Shared fixtures (via pytest plugin)
14+
15+
## ✅ Tests Kept in setuptools_scm (testing/)
16+
17+
- [x] `test_integration.py` - Setuptools integration
18+
- [x] `test_pyproject_reading.py` - Pyproject reading
19+
- [x] `test_version_inference.py` - Version inference
20+
- [x] `test_deprecation.py` - Deprecation warnings
21+
- [x] `test_regressions.py` - Regression tests
22+
- [x] `test_file_finder.py` - File finder (setuptools-specific)
23+
- [x] `test_internal_log_level.py` - Log level tests
24+
- [x] `test_main.py` - Main module tests
25+
- [x] `test_compat.py` - Compatibility tests
26+
- [x] `test_better_root_errors.py` - Error handling (updated imports)
27+
- [x] `test_expect_parse.py` - Parse expectations
28+
- [x] `test_cli.py` - CLI tests (updated imports)
3029

3130
## Test Execution Status
3231

33-
### vcs_versioning tests
32+
### Combined test suite
3433
```
35-
Not yet run
36-
```
37-
38-
### setuptools_scm tests
39-
```
40-
Not yet run
34+
408 passed, 10 skipped, 1 xfailed in 16-17s
4135
```
4236

4337
## Notes
4438

45-
- File finders stay in setuptools_scm (setuptools-specific)
46-
- Update imports in all tests to use vcs_versioning where appropriate
47-
- Ensure shared fixtures work for both test suites
39+
- ✅ File finders stay in setuptools_scm (setuptools-specific)
40+
- ✅ All test imports updated to use vcs_versioning where appropriate
41+
- ✅ Shared test fixtures work via `vcs_versioning.test_api` pytest plugin
42+
- ✅ Test directory renamed to `testingB/` in vcs-versioning to avoid conftest conflicts
43+
- ✅ Pytest plugin properly configured in both `pyproject.toml` files
4844

0 commit comments

Comments
 (0)