Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 13 additions & 18 deletions .github/workflows/python-CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,21 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black flake8
- name: Format with Black
pip install ruff
- name: Lint with ruff
run: |
black --check .
ruff check .
- name: Format check with ruff
run: |
ruff format --check .

build:
needs: format_and_check
runs-on: ubuntu-22.04
environment: ${{ github.ref == 'refs/heads/master' && 'production' || 'staging' }}
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v3
Expand All @@ -45,20 +48,16 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install setuptools
run: |
pip install setuptools wheel
pip install pytest build
- name: Build Python package
run: |
python setup.py sdist bdist_wheel
python -m build
- name: Install Python Package
run: |
pip install dist/*.whl
- name: Test with pytest
run: |
pytest test.py -v
pytest tests/ -v

deploy:
needs: build
Expand All @@ -73,14 +72,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install setuptools
run: |
pip install setuptools wheel
pip install pytest build
- name: re-Build Python package
run: |
python setup.py sdist bdist_wheel
python -m build
- name: Install Python Package
run: |
pip install dist/*.whl
Expand Down Expand Up @@ -108,7 +103,7 @@ jobs:
- name: Get Package version
id: get_version
run: |
echo "version=$(python setup.py --version)" >> $GITHUB_ENV
echo "version=$(python -c "import re; print(re.search(r'version = \"(.*?)\"', open('pyproject.toml').read()).group(1))")" >> $GITHUB_ENV
- name: Check if release exists
id: check_release
run: |
Expand Down
21 changes: 10 additions & 11 deletions .github/workflows/python-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,21 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black flake8
- name: Format with Black
pip install ruff
- name: Lint with ruff
run: |
black --check .
ruff check .
- name: Format check with ruff
run: |
ruff format --check .

build:
needs: format_and_check
runs-on: ubuntu-22.04
environment: development
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -43,17 +46,13 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install setuptools
run: |
pip install setuptools wheel
pip install pytest build
- name: Build Python package
run: |
python setup.py sdist bdist_wheel
python -m build
- name: Install Python Package
run: |
pip install dist/*.whl
- name: Test with pytest
run: |
pytest test.py -v
pytest tests/ -v
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,15 @@ target/
.ipynb_checkpoints/

# exclude data from source control by default
/data/processed/
tests/data/processed/
tests/data/interim/
tests/data/external/

# Keep .gitkeep files in data directories
!tests/data/**/.gitkeep

# Ignore large TIFF files in raw if they are not needed for basic CI
# tests/data/raw/TIF/*.tif

# Mac OS-specific storage files
.DS_Store
Expand Down
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Format code with black
# Format and lint code with ruff
repos:
# Run black
- repo: https://github.com/psf/black
rev: 23.3.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.7
hooks:
- id: black
language_version: python3.10
- id: ruff
args: [ --fix ]
- id: ruff-format
103 changes: 0 additions & 103 deletions CONTRIBUTING.md

This file was deleted.

3 changes: 1 addition & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

The MIT License (MIT)
Copyright (c) 2025, Caihao Cui
Copyright (c) 2026, Caihao Cui

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

31 changes: 12 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: clean data lint requirements test_environment help
.PHONY: clean lint requirements rebuild upload gh-pages test help

#################################################################################
# GLOBALS #
Expand All @@ -21,13 +21,8 @@ endif
#################################################################################

## Install Python Dependencies
requirements: test_environment
$(PYTHON_INTERPRETER) -m pip install -U pip setuptools wheel
$(PYTHON_INTERPRETER) -m pip install -r requirements.txt

## Make Dataset
data: requirements
$(PYTHON_INTERPRETER) src/data/make_dataset.py data/raw data/processed
requirements:
uv sync

## Delete all compiled Python files
clean:
Expand All @@ -37,27 +32,25 @@ clean:
## Rebuilt the wheel and upload to PyPI
rebuild:
rm -rf build dist
$(PYTHON_INTERPRETER) setup.py sdist bdist_wheel
uv build
twine upload dist/*
## Upload to PyPI
upload:
$(PYTHON_INTERPRETER) setup.py sdist bdist_wheel
uv build
twine upload dist/*

## Update Github Pages
gh-pages:
$(PYTHON_INTERPRETER) -m pip install -q mkdocs mkdocs-material
mkdocs gh-deploy
mkdocs gh-deploy --force

## Run tests
test:
pytest tests/ -v

# ## Lint using flake8
## Lint and format using ruff
lint:
black src


## Test python environment is setup correctly
test_environment:
$(PYTHON_INTERPRETER) test_environment.py
ruff check . --fix
ruff format .

#################################################################################
# PROJECT RULES #
Expand Down
16 changes: 0 additions & 16 deletions Pipfile

This file was deleted.

Loading
Loading