Skip to content

Commit

Permalink
Update development toolchain (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Nov 6, 2023
1 parent e180b3c commit cc55b26
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 142 deletions.
31 changes: 4 additions & 27 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,31 +54,10 @@ jobs:
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
- name: 🚀 Run Ruff
run: poetry run ruff .

black:
name: black
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4.1.1
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.7.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
- name: 🚀 Run black on docs
run: poetry run blacken-docs
- name: 🚀 Run ruff linter
run: poetry run ruff check --output-format=github .
- name: 🚀 Run ruff formatter
run: poetry run ruff format --check .

pre-commit-hooks:
name: pre-commit-hooks
Expand Down Expand Up @@ -117,8 +96,6 @@ jobs:
- name: 🚀 Check TOML files
run: poetry run pre-commit run check-toml --all-files
- name: 🚀 Check XML files
run: poetry run pre-commit run check-xml --all-files
- name: 🚀 Check YAML files
run: poetry run pre-commit run check-yaml --all-files
- name: 🚀 Check YAML files
run: poetry run pre-commit run check-yaml --all-files
Expand Down
20 changes: 15 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ jobs:
release:
name: Releasing to PyPi
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/pvo
permissions:
contents: write
id-token: write
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4.1.1
Expand All @@ -40,8 +46,12 @@ jobs:
- name: 🏗 Build package
run: poetry build --no-interaction
- name: 🚀 Publish to PyPi
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config pypi-token.pypi "${PYPI_TOKEN}"
poetry publish --no-interaction
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
verbose: true
print-hash: true
- name: ✍️ Sign published artifacts
uses: sigstore/gh-action-sigstore-python@v2.1.0
with:
inputs: ./dist/*.tar.gz ./dist/*.whl
release-signing-artifacts: true
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
uses: codecov/codecov-action@v3.1.4
- name: SonarCloud Scan
if: github.event.pull_request.head.repo.fork == false
uses: SonarSource/sonarcloud-github-action@v1.9
uses: SonarSource/sonarcloud-github-action@v2.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
19 changes: 7 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,20 @@
repos:
- repo: local
hooks:
- id: ruff
name: 🐶 Ruff
- id: ruff-check
name: 🐶 Ruff Linter
language: system
types: [python]
entry: poetry run ruff --fix
entry: poetry run ruff check --fix
require_serial: true
stages: [commit, push, manual]
- id: black
name: ☕️ Format using black
- id: ruff-format
name: 🐶 Ruff Formatter
language: system
types: [python]
entry: poetry run black
require_serial: true
- id: blacken-docs
name: ☕️ Format documentation examples using black
language: system
files: '\.(rst|md|markdown|py|tex)$'
entry: poetry run blacken-docs
entry: poetry run ruff format
require_serial: true
stages: [commit, push, manual]
- id: check-ast
name: 🐍 Check Python AST
language: system
Expand Down
Loading

0 comments on commit cc55b26

Please sign in to comment.