Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into build/requests
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Jun 9, 2024
2 parents 8056002 + ab7b06a commit 05ced0a
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 1,459 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/build.yaml

This file was deleted.

21 changes: 17 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
test:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
max-parallel: 2
fail-fast: false
Expand Down Expand Up @@ -38,10 +38,9 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: pip

- uses: trim21/setup-poetry@dist/v2

- uses: trim21/install-poetry-project@dist/v2
- run: pip install -e '.[dev]'

- name: test
run: coverage run -m pytest
Expand All @@ -54,3 +53,17 @@ jobs:
with:
flags: "${{ matrix.python }}"
token: ${{ secrets.CODECOV_TOKEN }}

dist-files:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"

- run: pipx run flit build

- name: Check Files
run: pipx run twine check --strict dist/*
8 changes: 2 additions & 6 deletions .github/workflows/codeql-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

strategy:
fail-fast: false
Expand All @@ -28,17 +28,13 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.11"

- uses: trim21/setup-poetry@dist/v2

- uses: trim21/install-poetry-project@dist/v2
cache: pip

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yaml
setup-python-dependencies: false

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
28 changes: 11 additions & 17 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,54 +10,48 @@ on:

jobs:
mypy:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.10"

- uses: trim21/setup-poetry@dist/v2

- uses: trim21/install-poetry-project@dist/v2
cache: pip

- uses: liskin/gh-problem-matcher-wrap@v3
with:
action: add
linters: mypy

- run: pip install -e '.[dev]'

- name: mypy
run: mypy --show-column-numbers transmission_rpc

pre-commit:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.10"

- uses: trim21/setup-poetry@dist/v2
- uses: trim21/install-poetry-project@dist/v2
- uses: trim21/actions/pre-commit@master
python-version: "3.x"

- run: pip install -e '.[dev]'

- uses: trim21/actions/pre-commit@master

sphinx:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: pip

- uses: trim21/setup-poetry@dist/v2

- uses: trim21/install-poetry-project@dist/v2
with:
install_args: --with docs
- run: pip install -e '.[dev]'

- run: sphinx-build -W docs/ dist/
2 changes: 1 addition & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ permissions:

jobs:
lint:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
Expand Down
30 changes: 19 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,39 @@ on:

jobs:
release:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-python@v5
- uses: trim21/setup-poetry@dist/v2
with:
python-version: '3.x'

- run: poetry publish --build
- run: pipx run flit publish
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
FLIT_USERNAME: '__token__'
FLIT_PASSWORD: ${{ secrets.PYPI_TOKEN }}

- name: Get Previous Tag
id: tag
uses: trim21/changelog-previous-tag@master
with:
token: ${{ github.token }}
version-spec: pep440

- name: Generate Changelog
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1.10.2
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ github.ref_name }}
writeToFile: false
fromTag: ${{ github.ref_name }}
toTag: ${{ env.previousTag }}
restrictToTypes: feat,fix,revert

- name: Upload Github Release
run: gh release create "${GITHUB_REF}" --notes "${CHANGELOG}"
run: gh release create "${GITHUB_REF}" --notes "${CHANGELOG}" $EXTRA_OPTS
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHANGELOG: "${{ steps.changelog.outputs.changes }}"
EXTRA_OPTS: "${{ env.preRelease == 'true' && '-p' || '' }}"
19 changes: 12 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
default_stages: [commit]

repos:
- repo: https://github.com/python-poetry/poetry
rev: "1.8.3"
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.18
hooks:
- id: poetry-check
- id: poetry-lock
name: poetry-lock-check
args: ["--check"]
- id: validate-pyproject
# Optional extra validations from SchemaStore:
additional_dependencies: ["validate-pyproject-schema-store[all]"]

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.13.0
hooks:
- id: pretty-format-yaml
args: [--autofix, --indent, '2', '--preserve-quotes', --offset, '2']

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
Expand All @@ -34,7 +39,7 @@ repos:
rev: v0.4.8
hooks:
- id: ruff
args: [ --fix ]
args: [--fix]

- repo: https://github.com/psf/black
rev: 24.4.2
Expand Down
17 changes: 7 additions & 10 deletions docs/.readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@ version: 2
build:
os: "ubuntu-22.04"
tools:
python: "3.12"
jobs:
post_create_environment:
# Install poetry
# https://python-poetry.org/docs/#installing-manually
- python -m pip install poetry
post_install:
# Install dependencies with 'docs' dependency group
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --with docs
python: "3.10"

python:
install:
- method: pip
path: .
extra_requirements: [dev]

sphinx:
configuration: docs/conf.py
Loading

0 comments on commit 05ced0a

Please sign in to comment.