Skip to content
Draft
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
42 changes: 42 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Wheels

on:
push:
branches: [ main, poc, pub ]
pull_request:
branches: [ main, poc, pub ]

jobs:
build-test-wheels:
# Separate native runners so mac gets native arm64 & x86_64 (universal2), Windows gets MSVC, etc.
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-13, macos-14 ]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Set up QEMU
if: runner.os == 'Linux' && runner.arch == 'X64'
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Setup uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true

- name: Build wheels
uses: pypa/cibuildwheel@v3.1.3
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_ARCHS_LINUX: ${{ runner.arch == 'X64' && 'auto ppc64le s390x' || 'auto' }}

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
49 changes: 49 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish

on:
push:
tags: [ "*" ]


jobs:
build:
uses: ./.github/workflows/build.yml

sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Build sdist
run: uv build --sdist --no-sources
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz

publish:
needs: [ build, sdist ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Download wheels
uses: actions/download-artifact@v4
with:
pattern: wheels-*
merge-multiple: true
path: dist
- name: Download sdist
uses: actions/download-artifact@v4
with:
name: sdist
path: dist
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
20 changes: 12 additions & 8 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ name: style

on:
push:
branches: [main, poc, pub]
branches: [ main, poc, pub ]
pull_request:
branches: [main, poc, pub]

concurrency:
group: style-${{ github.head_ref }}
Expand All @@ -21,13 +20,18 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up Python "3.11"
- name: Set up Python "3.13"
uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.13"

- name: Install Hatch
run: pip install --upgrade hatch
- name: Setup uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true

- name: Run ruff
run: uv run --python-preference system --extra style ruff check duper

- name: Run check
run: hatch run style:check
- name: Run ruff
run: uv run --python-preference system --extra style ruff format duper
30 changes: 14 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@ name: test

on:
push:
branches: [main, poc, pub]
branches: [ main, poc, pub ]
pull_request:
branches: [main, poc, pub]

concurrency:
group: test-${{ github.head_ref }}
cancel-in-progress: true

env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"

jobs:
cov:
Expand All @@ -21,19 +17,21 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11']
os: [ ubuntu-latest, windows-latest, macos-14 ]
python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14.0-rc.2' ]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

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

- name: Install Hatch
run: pip install --upgrade hatch
- name: Setup uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true

- name: Run tests
run: hatch run test:cov
- name: Run mypy
run: uv run --python-preference system --extra test pytest tests --cov-report=term-missing --cov-config=pyproject.toml --cov=duper --cov=tests
30 changes: 14 additions & 16 deletions .github/workflows/types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@ name: types

on:
push:
branches: [main, poc, pub]
branches: [ main, poc, pub ]
pull_request:
branches: [main, poc, pub]

concurrency:
group: types-${{ github.head_ref }}
cancel-in-progress: true

env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"

jobs:
check:
Expand All @@ -22,19 +18,21 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11']
os: [ ubuntu-latest, windows-latest, macos-14 ]
python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14.0-rc.2']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

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

- name: Install Hatch
run: pip install --upgrade hatch
- name: Setup uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true

- name: Run tests
run: hatch run types:check
- name: Run mypy
run: uv run --python-preference system --extra types mypy duper
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea/
.crush/
cmake-build-*/
*.iws
out/
Expand Down
34 changes: 34 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
repos:
- repo: local
hooks:
- id: ruff-format
name: ruff format
entry: ruff format
language: system
types: [ python ]

- id: ruff-check
name: ruff check --fix
entry: ruff check --fix
language: system
types: [ python ]

- id: reuse
name: reuse lint
entry: reuse annotate --license MPL-2.0 --copyright "Arseny Boykov (Bobronium) <mail@bobronium.me>" -y 2023-present
types: [ python ]
language: system

- id: mypy
name: mypy
entry: mypy duper
language: system
types: [ python ]
stages: [ push ]

- id: pytest
name: pytest
entry: pytest tests
language: system
pass_filenames: false
stages: [ push ]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023, Bobronium <appkiller16@gmail.com>
Copyright (c) 2023, Arseny Boykov <mail@bobronium.me>

All code in this repository except where explicitly noted otherwise is released
under the Mozilla Public License v 2.0. You can obtain a copy at https://mozilla.org/MPL/2.0/.
Loading
Loading