Skip to content

Commit

Permalink
Chore: pre-commit autoupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Nov 21, 2023
1 parent 34a2920 commit aa59aa4
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 66 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: 'Set up Python'
- name: "Set up Python"
uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: "3.9"

- name: 'Install dependencies'
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install tox
Expand Down
40 changes: 20 additions & 20 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: '🐍📦 Production build and release'
name: "🐍📦 Production build and release"

# GitHub/PyPI trusted publisher documentation:
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
Expand All @@ -13,45 +13,45 @@ on:
- v*.*.*

env:
python-version: '3.10'
python-version: "3.10"

### BUILD ###

jobs:
build:
name: '🐍 Build packages'
name: "🐍 Build packages"
runs-on: ubuntu-latest
permissions:
# IMPORTANT: mandatory for Sigstore
id-token: write
steps:
### BUILDING ###

- name: 'Checkout repository'
- name: "Checkout repository"
uses: actions/checkout@v4

- name: 'Setup PDM for build commands'
- name: "Setup PDM for build commands"
uses: pdm-project/setup-pdm@v3
with:
version: 2.10.0

- name: 'Setup Python 3.10'
- name: "Setup Python 3.10"
uses: actions/[email protected]
with:
python-version: ${{ env.python-version }}

- name: 'Update version from tags for production release'
- name: "Update version from tags for production release"
run: |
echo "Github versioning: ${{ github.ref_name }}"
scripts/release-versioning.sh
- name: 'Build with PDM backend'
- name: "Build with PDM backend"
run: |
pdm build
### SIGNING ###

- name: 'Sign packages with Sigstore'
- name: "Sign packages with Sigstore"
uses: sigstore/[email protected]
with:
inputs: >-
Expand All @@ -67,7 +67,7 @@ jobs:
### PUBLISH GITHUB ###

github:
name: '📦 Publish to GitHub'
name: "📦 Publish to GitHub"
# Only publish on tag pushes
if: startsWith(github.ref, 'refs/tags/')
needs:
Expand All @@ -77,13 +77,13 @@ jobs:
# IMPORTANT: mandatory to publish artefacts
contents: write
steps:
- name: '⬇ Download build artefacts'
- name: "⬇ Download build artefacts"
uses: actions/download-artifact@v3
with:
name: ${{ github.ref_name }}
path: dist/

- name: '📦 Publish release to GitHub'
- name: "📦 Publish release to GitHub"
uses: ModeSevenIndustrialSolutions/action-automatic-releases@latest
with:
# Valid inputs are:
Expand All @@ -99,7 +99,7 @@ jobs:
### PUBLISH PYPI TEST ###

testpypi:
name: '📦 Publish to PyPi Test'
name: "📦 Publish to PyPi Test"
# Only publish on tag pushes
if: startsWith(github.ref, 'refs/tags/')
needs:
Expand All @@ -111,13 +111,13 @@ jobs:
# IMPORTANT: mandatory for trusted publishing
id-token: write
steps:
- name: '⬇ Download build artefacts'
- name: "⬇ Download build artefacts"
uses: actions/download-artifact@v3
with:
name: ${{ github.ref_name }}
path: dist/

- name: 'Remove files unsupported by PyPi'
- name: "Remove files unsupported by PyPi"
run: |
if [ -f dist/buildvars.txt ]; then
rm dist/buildvars.txt
Expand All @@ -133,7 +133,7 @@ jobs:
### PUBLISH PYPI ###

pypi:
name: '📦 Publish to PyPi'
name: "📦 Publish to PyPi"
# Only publish on tag pushes
if: startsWith(github.ref, 'refs/tags/')
needs:
Expand All @@ -145,23 +145,23 @@ jobs:
# IMPORTANT: mandatory for trusted publishing
id-token: write
steps:
- name: '⬇ Download build artefacts'
- name: "⬇ Download build artefacts"
uses: actions/download-artifact@v3
with:
name: ${{ github.ref_name }}
path: dist/

- name: 'Remove files unsupported by PyPi'
- name: "Remove files unsupported by PyPi"
run: |
if [ -f dist/buildvars.txt ]; then
rm dist/buildvars.txt
fi
rm dist/*.crt dist/*.sig*
- name: 'Setup PDM for build commands'
- name: "Setup PDM for build commands"
uses: pdm-project/setup-pdm@v3

- name: 'Publish release to PyPI'
- name: "Publish release to PyPI"
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This workflow will upload a Python package
# using Twine when a tagged commit is merged.

name: 'Publish on PyPI'
name: "Publish on PyPI"

# yamllint disable-line rule:truthy
on:
Expand All @@ -20,14 +20,14 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
python-version: "3.x"

- name: 'Install dependencies'
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: 'Build and publish'
- name: "Build and publish"
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.OSC_PHYSRISK_API_PYPI_TOKEN }}
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/test-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# Workflow to build Docker image
# Based on openshift.yml (excluding OpenShift deployment)

name: 'Run tests, build and push image'
name: "Run tests, build and push image"

env:
APP_NAME: 'physrisk-api'
IMAGE_REGISTRY: 'quay.io/os-climate'
IMAGE_TAGS: ''
APP_NAME: "physrisk-api"
IMAGE_REGISTRY: "quay.io/os-climate"
IMAGE_TAGS: ""

# yamllint disable-line rule:truthy
on:
Expand All @@ -18,11 +18,11 @@ on:

jobs:
build:
name: 'Build and push to Quay'
name: "Build and push to Quay"
runs-on: ubuntu-latest

steps:
- name: 'Check for required secrets'
- name: "Check for required secrets"
uses: actions/github-script@v4
with:
script: |
Expand Down Expand Up @@ -51,21 +51,21 @@ jobs:
core.info(`✅ All the required secrets are set`);
}
- name: 'Check out repository'
- name: "Check out repository"
uses: actions/checkout@v2

- name: 'Determine app name'
- name: "Determine app name"
if: env.APP_NAME == ''
run: |
echo "APP_NAME=$(basename $PWD)" | tee -a $GITHUB_ENV
- name: 'Determine image tags'
- name: "Determine image tags"
if: env.IMAGE_TAGS == ''
run: |
echo "IMAGE_TAGS=latest ${GITHUB_SHA::12}" | tee -a $GITHUB_ENV
# https://github.com/redhat-actions/buildah-build#readme
- name: 'Build from Dockerfile'
- name: "Build from Dockerfile"
id: build-image
uses: redhat-actions/buildah-build@v2
with:
Expand All @@ -79,7 +79,7 @@ jobs:
./Dockerfile
# https://github.com/redhat-actions/push-to-registry#readme
- name: 'Push to registry'
- name: "Push to registry"
id: push-image
uses: redhat-actions/push-to-registry@v2
with:
Expand Down
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
ci:
autofix_commit_msg: 'Chore: pre-commit autoupdate'
autofix_commit_msg: "Chore: pre-commit autoupdate"
skip:
# pre-commit.ci cannot install WGET, so tomlint must be disabled
- tomllint
Expand All @@ -19,7 +19,7 @@ repos:
- repo: local
hooks:
- id: tomllint
name: 'Script: scripts/tomllint.sh'
name: "Script: scripts/tomllint.sh"
language: script
# pass_filenames: false
files: \^*.toml
Expand Down Expand Up @@ -47,7 +47,7 @@ repos:
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
args: ['--fix=lf']
args: ["--fix=lf"]
- id: name-tests-test
# Do not allow direct push to main/master branches
- id: no-commit-to-branch
Expand All @@ -61,14 +61,14 @@ repos:
hooks:
- id: prettier
args:
['--ignore-unknown', '--no-error-on-unmatched-pattern', '!chart/**']
["--ignore-unknown", "--no-error-on-unmatched-pattern", "!chart/**"]

# Lint: Markdown
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.37.0
hooks:
- id: markdownlint
args: ['--fix']
args: ["--fix"]

# - repo: https://github.com/asottile/pyupgrade
# rev: v3.15.0
Expand All @@ -95,7 +95,7 @@ repos:
rev: 2.1.1
hooks:
- id: bashate
args: ['--ignore=E006']
args: ["--ignore=E006"]

- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.9.0
Expand Down Expand Up @@ -139,7 +139,7 @@ repos:
# additional_dependencies: [black]

- repo: https://github.com/pycqa/flake8
rev: '6.1.0'
rev: "6.1.0"
hooks:
- id: flake8

Expand All @@ -150,14 +150,14 @@ repos:
# - id: codespell

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.6.1'
rev: "v1.6.1"
hooks:
- id: mypy

- repo: local
hooks:
- id: pip-audit
name: 'Script: scripts/pipaudit.sh'
name: "Script: scripts/pipaudit.sh"
language: script
# pass_filenames: false
entry: scripts/pipaudit.sh
4 changes: 2 additions & 2 deletions .thoth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ runtime_environments:
- name: default
operating_system:
name: ubi
version: '8'
python_version: '3.8'
version: "8"
python_version: "3.8"
recommendation_type: latest

managers:
Expand Down
Loading

0 comments on commit aa59aa4

Please sign in to comment.