-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add poetry and refactor pyproject.toml * Change poetry dep install call * Adjust lint rules and reapply * Remove unused extensions from devcontainer * Update ci to use poetry --------- Co-authored-by: tb1337 <[email protected]>
- Loading branch information
Showing
43 changed files
with
1,569 additions
and
197 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,31 +24,26 @@ jobs: | |
steps: | ||
- name: ⤵️ Checkout code | ||
uses: actions/[email protected] | ||
- name: 🏷 Get repository tag | ||
id: vars | ||
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | ||
- name: 🚧 Setup Poetry | ||
run: pip install poetry | ||
- name: 🐍 Setup Python ${{ env.DEFAULT_PYTHON }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
cache: poetry | ||
- name: 🚧 Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build tomli tomli-w | ||
run: poetry install --no-interaction | ||
- name: 🏷 Get repository tag | ||
id: vars | ||
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | ||
- 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) | ||
run: poetry version --no-interaction "${{ steps.vars.outputs.tag }}" | ||
- name: 🚀 Build package | ||
run: python -m build | ||
run: poetry build --no-interaction | ||
- name: ⬆️ Publish to PyPi | ||
uses: pypa/[email protected] | ||
with: | ||
print-hash: true | ||
- name: 🔏 Sign published artifacts | ||
uses: sigstore/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,14 +21,17 @@ jobs: | |
steps: | ||
- name: ⤵️ Checkout code | ||
uses: actions/[email protected] | ||
- name: 🚧 Setup Poetry | ||
run: pip install poetry | ||
- name: 🐍 Setup Python ${{ matrix.python-version }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: poetry | ||
- name: 🚧 Install dependencies | ||
run: pip install . .[test] | ||
run: poetry install --no-root --only main,test --no-interaction | ||
- name: 🚀 Run Pytest | ||
run: pytest --cov pypaperless tests | ||
run: poetry run pytest --cov pypaperless tests | ||
- name: ⬆️ Upload coverage | ||
uses: actions/[email protected] | ||
with: | ||
|
@@ -44,16 +47,19 @@ jobs: | |
uses: actions/[email protected] | ||
- name: ⬇️ Download coverage | ||
uses: actions/[email protected] | ||
- name: 🚧 Setup Poetry | ||
run: pip install poetry | ||
- name: 🐍 Setup Python ${{ env.DEFAULT_PYTHON }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
cache: poetry | ||
- name: 🚧 Install dependencies | ||
run: pip install . .[test] | ||
run: poetry install --no-root --only main,test --no-interaction | ||
- name: 🚀 Process coverage results | ||
run: | | ||
coverage combine coverage*/.coverage* | ||
coverage xml -i | ||
poetry run coverage combine coverage*/.coverage* | ||
poetry run coverage xml -i | ||
- name: ⬆️ Upload coverage to Codecov | ||
uses: codecov/[email protected] | ||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,24 +18,27 @@ jobs: | |
steps: | ||
- name: ⤵️ Checkout code | ||
uses: actions/[email protected] | ||
- name: 🚧 Setup Poetry | ||
run: pip install poetry | ||
- name: 🐍 Setup Python ${{ env.DEFAULT_PYTHON }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
cache: poetry | ||
- name: 🚧 Install dependencies | ||
run: pip install . .[test] | ||
run: poetry install --no-root --only main,dev --no-interaction | ||
- name: 🚀 Run pre-commit hooks | ||
run: | | ||
pre-commit run check-yaml --all-files | ||
pre-commit run check-toml --all-files | ||
pre-commit run check-ast --all-files | ||
pre-commit run check-docstring-first --all-files | ||
pre-commit run debug-statements --all-files | ||
pre-commit run end-of-file-fixer --all-files | ||
pre-commit run trailing-whitespace --all-files | ||
pre-commit run ruff --all-files | ||
pre-commit run ruff-format --all-files | ||
pre-commit run black --all-files | ||
pre-commit run codespell --all-files | ||
pre-commit run mypy --all-files | ||
pre-commit run pylint --all-files | ||
poetry run pre-commit run check-yaml --all-files | ||
poetry run pre-commit run check-toml --all-files | ||
poetry run pre-commit run check-ast --all-files | ||
poetry run pre-commit run check-docstring-first --all-files | ||
poetry run pre-commit run debug-statements --all-files | ||
poetry run pre-commit run end-of-file-fixer --all-files | ||
poetry run pre-commit run trailing-whitespace --all-files | ||
poetry run pre-commit run ruff --all-files | ||
poetry run pre-commit run ruff-format --all-files | ||
poetry run pre-commit run black --all-files | ||
poetry run pre-commit run codespell --all-files | ||
poetry run pre-commit run mypy --all-files | ||
poetry run pre-commit run pylint --all-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,5 +107,3 @@ venv.bak/ | |
|
||
# mypy | ||
.mypy_cache/ | ||
|
||
tests_old |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.