Skip to content

Commit

Permalink
Major Rewrite to v3.0.0 (#87)
Browse files Browse the repository at this point in the history
Co-authored-by: tb1337 <[email protected]>
  • Loading branch information
tb1337 and tb1337 authored Feb 9, 2024
1 parent e2a5f8c commit c17d91c
Show file tree
Hide file tree
Showing 75 changed files with 5,496 additions and 3,818 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"esbenp.prettier-vscode",
"GitHub.vscode-pull-request-github",
"ms-azuretools.vscode-docker",
"ms-python.isort"
"ms-python.isort",
"ms-python.mypy-type-checker"
],
"settings": {
"python.pythonPath": "/usr/local/bin/python",
Expand Down
78 changes: 78 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
- name: "breaking-change"
color: ee0701
description: "A breaking change for existing users."
- name: "bugfix"
color: ee0701
description: "Inconsistencies or issues which will cause a problem for users or implementers."
- name: "documentation"
color: 0052cc
description: "Solely about the documentation of the project."
- name: "enhancement"
color: 1d76db
description: "Enhancement of the code, not introducing new features."
- name: "refactor"
color: 1d76db
description: "Improvement of existing code, not introducing new features."
- name: "performance"
color: 1d76db
description: "Improving performance, not introducing new features."
- name: "new-feature"
color: 0e8a16
description: "New features or options."
- name: "maintenance"
color: 2af79e
description: "Generic maintenance tasks."
- name: "ci"
color: 1d76db
description: "Work that improves the continue integration."
- name: "dependencies"
color: 1d76db
description: "Upgrade or downgrade of project dependencies."

- name: "in-progress"
color: fbca04
description: "Issue is currently being resolved by a developer."
- name: "stale"
color: fef2c0
description: "There has not been activity on this issue or PR for quite some time."
- name: "no-stale"
color: fef2c0
description: "This issue or PR is exempted from the stable bot."

- name: "security"
color: ee0701
description: "Marks a security issue that needs to be resolved asap."
- name: "incomplete"
color: fef2c0
description: "Marks a PR or issue that is missing information."
- name: "invalid"
color: fef2c0
description: "Marks a PR or issue that is missing information."

- name: "beginner-friendly"
color: 0e8a16
description: "Good first issue for people wanting to contribute to the project."
- name: "help-wanted"
color: 0e8a16
description: "We need some extra helping hands or expertise in order to resolve this."

- name: "priority-critical"
color: ee0701
description: "This should be dealt with ASAP. Not fixing this issue would be a serious error."
- name: "priority-high"
color: b60205
description: "After critical issues are fixed, these should be dealt with before any further issues."
- name: "priority-medium"
color: 0e8a16
description: "This issue may be useful, and needs some attention."
- name: "priority-low"
color: e4ea8a
description: "Nice addition, maybe... someday..."

- name: "major"
color: b60205
description: "This PR causes a major version bump in the version number."
- name: "minor"
color: 0e8a16
description: "This PR causes a minor version bump in the version number."
22 changes: 22 additions & 0 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Sync labels

on:
push:
branches:
- master
paths:
- .github/labels.yml
workflow_dispatch:

jobs:
labels:
name: 🏷 Sync labels
runs-on: ubuntu-latest
steps:
- name: ⤵️ Checkout code
uses: actions/[email protected]
- name: 🚀 Run label sync
uses: micnncim/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 5 additions & 4 deletions .github/workflows/pr-labels.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Verify valid PR labels

---
name: PR Labels

on:
Expand All @@ -11,13 +10,15 @@ on:
branches:
- master

permissions: {}

jobs:
pr_labels:
name: Verify
runs-on: ubuntu-latest
steps:
- name: Verify PR has a valid label
- name: 🏷 Verify valid PR label
uses: ludeeus/[email protected]
with:
labels: >-
breaking change, bug, chore, enhancement, refactor, documentation
breaking-change, bugfix, chore, dependencies, documentation, enhancement, new-feature, refactor
26 changes: 15 additions & 11 deletions .github/workflows/pre-commit-updater.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
# Update pre-commit on a daily interval

---
name: Pre-commit auto-update

on:
schedule:
- cron: '0 0 * * *'
- cron: '0 0 * * 1'

env:
DEFAULT_PYTHON: "3.11"

jobs:
auto-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
- name: ⤵️ Checkout code
uses: actions/[email protected]
- name: 🐍 Setup Python ${{ env.DEFAULT_PYTHON }}
uses: actions/[email protected]
with:
python-version: '3.10'
- name: Install pre-commit
python-version: ${{ env.DEFAULT_PYTHON }}
- name: 🚧 Install pre-commit
run: pip install pre-commit
- name: Run pre-commit autoupdate
- name: 🚧 Run pre-commit autoupdate
run: pre-commit autoupdate
- name: Create Pull Request
- name: 🅿️ Create Pull Request
uses: peter-evans/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update/pre-commit-autoupdate
branch: chore/pre-commit-autoupdate
title: Auto-update pre-commit hooks
commit-message: Auto-update pre-commit hooks
body: |
Update versions of tools in pre-commit
configs to latest version
labels: chore
labels: dependencies
49 changes: 0 additions & 49 deletions .github/workflows/release-package.yml

This file was deleted.

56 changes: 56 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
name: Release

on:
release:
types:
- published

env:
DEFAULT_PYTHON: "3.11"

jobs:
release:
name: Releasing to PyPi
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pypaperless
permissions:
contents: write
id-token: write # important for trusted publishing (pypi)
outputs:
version: ${{ steps.vars.outputs.tag }}
steps:
- name: ⤵️ Checkout code
uses: actions/[email protected]
- name: 🏷 Get repository tag
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: 🐍 Setup Python ${{ env.DEFAULT_PYTHON }}
uses: actions/[email protected]
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: 🚧 Install dependencies
run: |
python -m pip install --upgrade pip
pip install build tomli tomli-w
- name: 🚧 Set project version from tag
shell: python
run: |-
import tomli
import tomli_w
with open("pyproject.toml", "rb") as f:
pyproject = tomli.load(f)
pyproject["project"]["version"] = "${{ steps.vars.outputs.tag }}"
with open("pyproject.toml", "wb") as f:
tomli_w.dump(pyproject, f)
- name: 🚀 Build package
run: python -m build
- name: ⬆️ Publish to PyPi
uses: pypa/[email protected]
- name: 🔏 Sign published artifacts
uses: sigstore/[email protected]
with:
inputs: ./dist/*.tar.gz ./dist/*.whl
release-signing-artifacts: true
36 changes: 0 additions & 36 deletions .github/workflows/test.yml

This file was deleted.

62 changes: 62 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
name: Tests

on:
push:
branches:
- master
pull_request:
workflow_dispatch:

env:
DEFAULT_PYTHON: "3.11"

jobs:
pytest:
name: Testing on Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12"]
steps:
- name: ⤵️ Checkout code
uses: actions/[email protected]
- name: 🐍 Setup Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: 🚧 Install dependencies
run: pip install . .[test]
- name: 🚀 Run Pytest
run: pytest --cov pypaperless tests
- name: ⬆️ Upload coverage
uses: actions/[email protected]
with:
name: coverage-${{ matrix.python-version }}
path: .coverage

coverage:
name: Coverage report
runs-on: ubuntu-latest
needs: pytest
steps:
- name: ⤵️ Checkout code
uses: actions/[email protected]
- name: ⬇️ Download coverage
uses: actions/[email protected]
- name: 🐍 Setup Python ${{ env.DEFAULT_PYTHON }}
uses: actions/[email protected]
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: 🚧 Install dependencies
run: pip install . .[test]
- name: 🚀 Process coverage results
run: |
coverage combine coverage*/.coverage*
coverage xml -i
- name: ⬆️ Upload coverage to Codecov
uses: codecov/[email protected]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: ./coverage.xml
Loading

0 comments on commit c17d91c

Please sign in to comment.