You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MAINT: Update test suite for Python 3.11-3.13 and Sphinx 6-8 compatibility (#79)
* Update test suite for Python 3.11-3.13 and Sphinx 6-8 compatibility
- Update pyproject.toml: require Python >=3.11, Sphinx >=6.1, matplotlib >=3.8
- Update tox.ini: add 9 test environments (py311/312/313 × sphinx6/7/8)
- Fix deprecation warnings:
- Use os.path.splitext() instead of string operations (RemovedInSphinx90Warning)
- Update sphinx.util.console import path
- Implement Sphinx-version-specific regression fixtures:
- Generate separate .sphinx6/.sphinx7/.sphinx8 fixtures for HTML and XML
- Track actual Sphinx output differences without filtering
- Add ipykernel process ID normalization for test stability
- All 110 tests pass across all 9 Python/Sphinx combinations
* Fix MatplotlibDeprecationWarning in test code and update CHANGELOG
- Update CHANGELOG.md with v1.0.0 and v1.0.1 release information
- Fix deprecated matplotlib.axes.Axes.cohere() API usage in test files
- Change from positional args to keyword args (NFFT=, Fs=)
- Eliminates MatplotlibDeprecationWarning from test output
- Regenerate Sphinx 8 test fixtures to reflect corrected test code
- All 110 tests passing with only external myst_nb warnings remaining
* Update myst-nb dependency to >=1.1.0 to eliminate deprecation warnings
- Change from myst-nb~=1.0.0 to myst-nb>=1.1.0
- myst-nb v1.1.0+ uses Node.findall() instead of deprecated Node.traverse()
- Eliminates PendingDeprecationWarning and RemovedInSphinx90Warning
- All 110 tests pass with ZERO warnings
* Regenerate Sphinx 6 and 7 test fixtures with updated myst-nb
- Update fixtures to reflect myst-nb >=1.1.0 output (no warnings)
- Remove MatplotlibDeprecationWarning from fixture files
* Update pytest dependency from ~=8.0.0 to >=8.0
- Similar to myst-nb update, the ~=8.0.0 constraint was locking pytest to 8.0.x
- Latest pytest is 8.4.2 with bug fixes and improvements
- All 110 tests passing with pytest 8.4.2
* Apply pre-commit formatting fixes
- Fix E402: Move sphinx.locale import to top of file in nodes.py
- Add newline at end of MANIFEST.in
- Apply ruff-format line wrapping for long lines
* Normalize matplotlib image hashes in tests
Matplotlib generates platform/version-specific content hashes for images.
This causes test failures when comparing fixtures generated on different
platforms (macOS vs Linux) or with different package versions.
Solution: Add regex pattern to FileRegression to normalize all matplotlib
image hashes to 'IMAGEHASH.png', making tests platform-independent.
Fixes CI test failures in test_gateddirective.py.
* Update CI to test all Python and Sphinx combinations
Match CI test matrix to tox configuration:
- Python versions: 3.11, 3.12, 3.13
- Sphinx versions: 6, 7, 8
- Total: 9 test combinations
This ensures CI tests the same environments as local tox testing,
providing better coverage and catching version-specific issues.
* Add Sphinx version compatibility for strip_escape_sequences
The function strip_escape_sequences was removed from sphinx.util.console
in later versions. Add try/except import with fallback implementation.
Also update tox.ini to properly install Sphinx version-specific dependencies
by explicitly listing all testing dependencies in deps rather than using
the 'testing' extra which includes a broad Sphinx version range.
Fixes CI failure on Python 3.13 + Sphinx 6 combination.
* Fix tox to properly install version-specific Sphinx
Use constrain_package_deps and use_frozen_constraints to ensure
that the Sphinx version specified in tox deps takes precedence over
the package's own dependency declaration (sphinx>=6.1).
This creates a constraints file that locks the Sphinx version during
package dependency installation, preventing pip from upgrading to the
latest version.
Verified working:
- py311-sphinx6: Sphinx 6.2.1
- py311-sphinx7: Sphinx 7.4.7
- py311-sphinx8: Sphinx 8.2.3
* Simplify tox configuration by using testing extras
Now that constrain_package_deps is working correctly, we can use
the 'testing' extras from pyproject.toml instead of manually listing
all dependencies.
This is more maintainable - when testing dependencies change in
pyproject.toml, they automatically apply to tox without needing
to update both files.
The constraints mechanism ensures Sphinx version from deps still
takes precedence over the package's sphinx>=6.1,<9 requirement.
* Fix Sphinx 6 compatibility in conftest.py rootdir fixture
The sphinx.testing.path.path object in Sphinx <7.2 doesn't have an
.absolute() method. The path is already absolute, so we can use it
directly without calling .absolute().
This fixes the AttributeError: 'path' object has no attribute 'absolute'
error that was causing all 110 tests to fail on Sphinx 6.
The version check ensures Sphinx 7.2+ continues to use pathlib.Path
with .absolute() as before.
* Regenerate Sphinx 7 fixtures with normalized image hashes
* Add Sphinx 6 fixture files for complete test coverage
* Replace os.path.splitext with pathlib.Path for consistency
Use pathlib.Path.with_suffix('') instead of os.path.splitext()[0] for
better consistency with modern Python practices. This removes the os
import which was only used for this single operation.
* Replace remaining os.path usage with pathlib across codebase
Modernize all remaining os.path operations to use pathlib.Path for
consistency:
- sphinx_exercise/__init__.py: Use Path for package/locale directory
- sphinx_exercise/post_transforms.py: Use Path.with_suffix('')
- sphinx_exercise/translations/_convert.py: Use Path.resolve()
This completes the migration to pathlib throughout the codebase,
keeping only os.sep in tests where it's appropriate for path
separator normalization.
0 commit comments