Skip to content

Feature/convert python environment to uv#22

Merged
cuicaihao merged 2 commits into
developfrom
feature/Convert-Python-Environment-to-uv
Mar 29, 2026
Merged

Feature/convert python environment to uv#22
cuicaihao merged 2 commits into
developfrom
feature/Convert-Python-Environment-to-uv

Conversation

@cuicaihao
Copy link
Copy Markdown
Owner

Summary
This PR provides a comprehensive modernization of the splitraster repository. It streamlines the developer workflow by migrating to modern Python tooling (uv,
ruff), standardizes the project structure, and enhances the documentation and CI/CD pipelines.

Key Changes

  1. Tooling & Dependency Management
  • Migrated to uv: Replaced standard pip workflows with uv for faster, more reliable dependency resolution and environment synchronization.
  • Migrated to ruff: Replaced black and flake8 with ruff for unified, high-performance linting and formatting.
  • Dependency Cleanup: Moved torch, torchvision, and pre-commit to development dependencies to keep the core library lightweight.
  • Optional GIS Support: Added gdal as an optional dependency extra. Users can now install GIS support via pip install "splitraster[geo]".
  1. Structural Refinement
  • Standardized Testing:
    • Created a root-level tests/ directory.
    • Moved test assets to tests/data/ and updated .gitignore to prevent tracking processed outputs.
    • Moved test.py to tests/test_splitraster.py and updated it to use robust, relative paths.
  • Boilerplate Removal: Deleted unused files from the original template (src/data/, test_environment.py, docs/sphinx/).
  • Unified Documentation:
    • Moved CONTRIBUTING.md to the docs/ directory (supported by GitHub and MkDocs).
    • Consolidated the PyPI description to use PyPi.md while maintaining README.md for the repository landing page.
  1. Documentation & Tutorials
  • Renamed Notebooks: Updated tutorials to a more structured naming convention:
    • 01_Standard_Image_Tiling.ipynb
    • 02_GIS_GeoTIFF_Tiling.ipynb
  • Path Synchronization: Updated all code snippets in README.md, docs/, and notebooks to point to the new ./tests/data/ paths.
  • MkDocs Cleanup: Added a "Contributing" page to the site navigation and updated the site_url.
  1. CI/CD Modernization
  • Updated GitHub Actions (python-CI.yml and python-CD.yml) to:
    • Use ruff for linting and formatting checks.
    • Use PEP 517 python -m build for package creation instead of the outdated setup.py.
    • Target Python versions 3.10 through 3.13.

Verification Results

  • Linting: ruff check . and ruff format . pass cleanly.
  • Tests: All tests in tests/test_splitraster.py pass successfully via pytest tests/.
  • Build: Package builds correctly using uv build (producing .whl and .tar.gz).
  • Docs: mkdocs build runs without warnings.

- Replace Pipenv (Pipfile, Pipfile.lock) and setup.py with uv for faster and more reliable dependency management.
- Consolidate project metadata and dependencies into a modern pyproject.toml.
- Update documentation (README, CONTRIBUTING, tutorials) to reflect the new uv-based development workflow.
- Update Makefile to use uv for syncing, building, and environment setup.
- Upgrade pre-commit hooks to newer versions of black (24.8.0) and flake8 (7.1.0).
- Bump version to 0.4.0 and set minimum Python version to 3.10.
- Update tutorial notebooks to reflect the new environment and version.
@cuicaihao cuicaihao merged commit 7acffdd into develop Mar 29, 2026
12 checks passed
@cuicaihao cuicaihao deleted the feature/Convert-Python-Environment-to-uv branch March 29, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant