Commit d98a2e2
committed
fix: resolve module name mismatch causing Integration Test failures on Windows
**Critical Module Name Fixes:**
- Fix Rust PyO3 module name: change #[pymodule] fn demopy_gb_jj to #[pymodule] fn _rust
- Update Python module import: change from demopy_gb_jj._rust to demopy._rust
- Align module structure with maturin configuration: module-name = 'demopy._rust'
- Resolve PyInit symbol mismatch that prevented module import on Windows
**Package Structure Alignment:**
- Package name: demopy_gb_jj (in pyproject.toml)
- Python module path: python/demopy/
- Rust module name: _rust (matches module-name config)
- Import statement: import demopy (works correctly)
- Rust extension import: demopy._rust (internal, automatic)
**Comprehensive Integration Testing:**
- Create scripts/test_integration.py for complete package validation
- Test package import, functionality, wheel installation, and fallback behavior
- Verify both Rust extension and Python fallback implementations work correctly
- Add wheel installation testing in clean virtual environment
**CI Workflow Improvements:**
- Update Integration Test workflow to properly test module import after build
- Fix fallback testing to use correct module name (demopy._rust instead of demopy_gb_jj._rust)
- Add comprehensive verification steps after maturin develop
- Include integration test execution in CI pipeline
**Expected Resolution:**
- Integration Test workflow should complete successfully on all platforms (Ubuntu, Windows, macOS)
- maturin build should create wheels with correct module structure
- import demopy should work without ModuleNotFoundError
- Both Rust extension and Python fallback should function correctly
- All Python versions (3.8-3.13) should be supported
**Root Cause:** Module naming inconsistency between package name (demopy_gb_jj), Rust module name (demopy_gb_jj), expected module structure (demopy._rust), and actual import path (demopy). The PyO3 module name must match the module-name configuration in pyproject.toml.
**Solution:** Align all module names: Rust module _rust, Python import demopy._rust, maturin config demopy._rust, maintaining backward compatibility with import demopy.1 parent 618d85b commit d98a2e2
5 files changed
Lines changed: 372 additions & 9 deletions
File tree
- .github/workflows
- python/demopy
- scripts
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
176 | 177 | | |
177 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
178 | 198 | | |
179 | 199 | | |
180 | 200 | | |
| |||
193 | 213 | | |
194 | 214 | | |
195 | 215 | | |
196 | | - | |
197 | | - | |
| 216 | + | |
| 217 | + | |
198 | 218 | | |
199 | 219 | | |
200 | 220 | | |
201 | 221 | | |
202 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
203 | 225 | | |
204 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
205 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| 37 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
0 commit comments