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
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on:
push:
branches: [master, main]
pull_request:
branches: [master, main]

jobs:
test:
runs-on: macos-latest
strategy:
matrix:
python-version: ["3.10", "3.12"]
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install pipenv
run: pip install pipenv

- name: Install dependencies
run: pipenv install --dev
env:
PIPENV_VENV_IN_PROJECT: 1

- name: Ruff
run: pipenv run ruff check offload tests

- name: Ruff format
run: pipenv run ruff format --check offload tests

- name: Pytest
run: pipenv run pytest tests/ -v

- name: Mypy
run: pipenv run mypy offload --no-error-summary 2>/dev/null || true
21 changes: 21 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release Please

on:
push:
branches: [master, main]

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,6 @@ venv.bak/
offload/recent_paths.json
/tests/ol_test_file_a.txt
/tests/ol_test_file_b.txt
/ol_test_file_a.txt
/ol_test_file_b.txt
/_ol_test_settings.json
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.1.3"
}
26 changes: 26 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Offload build
WEBSITE_ASSETS ?= ../offload_website/assets/files
APPLICATIONS ?= /Applications

.PHONY: clean build zip deploy-website install all

clean:
rm -rf dist build

build: clean
pipenv run python setup.py py2app

zip: build
zip -r dist/Offload.zip dist/Offload.app

deploy-website: zip
cp dist/Offload.zip $(WEBSITE_ASSETS)/Offload.zip

install: build
yes | cp -rf dist/Offload.app $(APPLICATIONS)/Offload.app

# Full flow: clean, build, zip, copy to website and Applications
all: build
zip -r dist/Offload.zip dist/Offload.app
cp dist/Offload.zip $(WEBSITE_ASSETS)/Offload.zip
yes | cp -rf dist/Offload.app $(APPLICATIONS)/Offload.app
17 changes: 11 additions & 6 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@ url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
autopep8 = "*"
pytest = ">=7.0"
ruff = ">=0.1.0"
mypy = ">=1.0"
pre-commit = ">=3.0"
py2app = ">=0.28"
modulegraph = ">=0.19"

[packages]
xxhash = "*"
pyqt5 = "*"
psutil = "*"
pillow = "*"
xxhash = ">=3.0,<4"
pyqt5 = ">=5.15"
psutil = ">=5.9"
pillow = ">=10.0"
setuptools = "*"

[requires]
python_version = "3.9"
python_version = "3.12"
771 changes: 771 additions & 0 deletions Pipfile.lock

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,36 @@ Offload is a simple tool for offloading files from memory cards and external dri
2. Run the app.
3. Enjoy!

## Development

The project supports **macOS on Apple Silicon (M1)** and Intel. Python 3.12+ is required.

- **Setup**: Install Python 3.12 (e.g. via [Homebrew](https://brew.sh) or [pyenv](https://github.com/pyenv/pyenv)), then:
```bash
pipenv install --dev
```
- **Tests**: Run the test suite with pytest:
```bash
pipenv run pytest
```
- **Lint/format**: Run ruff:
```bash
pipenv run ruff check offload tests && pipenv run ruff format --check offload tests
```
- **Pre-commit** (optional): Install hooks so ruff and format run before each commit:
```bash
pipenv run pre-commit install
```
- **Run the GUI**: From the project root:
```bash
pipenv run python -m offload.gui
```
or `pipenv run python offload/gui.py`
- **Build the .app bundle** (macOS): Uses py2app; produces a native arm64 app on Apple Silicon:
```bash
./compile.sh
```
Or manually: `pipenv run python setup.py py2app`. The built app is in `dist/Offload.app`.

## Credits
- Source Sans Pro https://github.com/adobe-fonts/source-sans-pro
Loading