diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d940b49 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: CI + +on: + push: + pull_request: + +jobs: + checks: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v6 + with: + python-version: "3.13" + cache: "pip" + + - name: Install package and dev tools + run: | + python -m pip install --upgrade pip + pip install -e . + pip install pytest ruff mypy + + - name: Lint + run: ruff check . + + - name: Format check + run: ruff format --check . + + - name: Type check + run: mypy src + + - name: Test + run: pytest diff --git a/.gitignore b/.gitignore index 52bcebd..8d9f191 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ .venv/ +.venv-test __pycache__/ *.pyc .DS_Store *.egg-info/ -data \ No newline at end of file +data +dist/ +build/ \ No newline at end of file diff --git a/Makefile b/Makefile index 2ad763c..526d46f 100644 --- a/Makefile +++ b/Makefile @@ -13,4 +13,4 @@ typecheck: test: pytest -check: lint test typecheck \ No newline at end of file +check: lint test format typecheck \ No newline at end of file diff --git a/README.md b/README.md index 03cb5d2..4d1f3c2 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@ +[![CI](https://github.com/aga87/python-photo-tools/actions/workflows/ci.yml/badge.svg)](https://github.com/aga87/python-photo-tools/actions) + # Python Photo Tools A command-line tool for organising and processing photos using Python. -## Branches +## Supported formats -- `main` – Stable branch. Contains production-ready code and reflects the latest completed features. -- `dev` – Integration branch. Used to combine and test feature branches before merging into `main`. +- RAW: .raf +- JPG: .jpg, .jpeg ## Prerequisites - System Tools @@ -34,6 +36,22 @@ If running in a Docker container, include: RUN apt-get update && apt-get install -y exiftool ``` +## Installation + +### Using pipx (recommended) + +```shell +pipx install git+https://github.com/aga87/python-photo-tools.git +``` + +### Local development + +Clone the repository and install: + +```shell +pip install . +``` + ## Usage List available commands: @@ -114,7 +132,7 @@ photo-tools optimise photo-tools optimise --dry-run ``` -## Local Testing Setup +## Local Development Setup ### Data @@ -157,4 +175,4 @@ Other commands follow the same structure but are not yet covered. ### Makefile -Common development tasks are available via the Makefile. \ No newline at end of file +Common development tasks are available via the Makefile. diff --git a/pyproject.toml b/pyproject.toml index 13a1d96..850503f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ requires-python = ">=3.13" dependencies = ["typer>=0.24,<1.0", "pillow>=12.1,<13.0"] [dependency-groups] -dev = ["pytest>=9,<10", "ruff>=0.15,<1.0", "mypy>=1.19,<2.0"] +dev = ["pytest>=9,<10", "ruff>=0.15,<1.0", "mypy>=1.19,<2.0", "build>=1.4,<2.0"] [project.scripts] photo-tools = "photo_tools.cli:app" diff --git a/src/photo_tools/cli.py b/src/photo_tools/cli.py index c0fde24..c94f4c5 100644 --- a/src/photo_tools/cli.py +++ b/src/photo_tools/cli.py @@ -8,9 +8,7 @@ from photo_tools.organise_by_type import organise_by_type from photo_tools.soft_delete_unpaired_raws import soft_delete_unpaired_raws -app = typer.Typer( - help="CLI tools for organising and optimising photography workflows." -) +app = typer.Typer(help="CLI tools for organising and optimising photography workflows.") @app.callback() @@ -91,7 +89,7 @@ def soft_delete_unpaired_raws_cmd( @app.command( "optimise", - help="Resize JPG images to max 2500px width and compress to ≤500KB using quality " \ + help="Resize JPG images to max 2500px width and compress to ≤500KB using quality " "70-100, saving as prefixed copies.", ) def optimise_cmd(