Skip to content

Commit

Permalink
Merge branch 'master' into composite-github-action
Browse files Browse the repository at this point in the history
  • Loading branch information
codejedi365 committed Mar 30, 2024
2 parents 30af9dc + a352050 commit 9f8c42c
Show file tree
Hide file tree
Showing 84 changed files with 8,899 additions and 3,128 deletions.
20 changes: 20 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
version: 2
updates:

- package-ecosystem: "pip"
directory: "/"
schedule:
Expand All @@ -12,5 +13,24 @@ updates:
include: "scope"
labels:
- dependencies
- dependabot
open-pull-requests-limit: 10
rebase-strategy: auto
versioning-strategy: "increase-if-necessary"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "18:00"
commit-message:
prefix: "ci"
labels:
- dependencies
- dependabot
rebase-strategy: auto
groups:
github-actions:
patterns:
- "*"
41 changes: 22 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
Expand All @@ -43,17 +43,21 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install mypy & dev packages
run: |
python -m pip install ".[dev, mypy]"
- name: ruff
run: |
python -m ruff check . --config pyproject.toml --diff --show-source
python -m ruff check . \
--config pyproject.toml \
--diff \
--show-source \
--exit-non-zero-on-fix
- name: mypy
run: |
python -m mypy --ignore-missing-imports semantic_release
Expand All @@ -71,18 +75,19 @@ jobs:

steps:
- name: Set up Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.9

- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Black
run: python -m pip install black
- name: Install Ruff
run: python -m pip install ".[dev]"

- name: Beautify with Black
run: python -m black .
- name: Format
run: |
python -m ruff format .
- name: Commit and push changes
uses: github-actions-x/commit@v2.9
Expand All @@ -104,13 +109,16 @@ jobs:
concurrency: push
needs: [test, lint, beautify]
if: github.repository == 'python-semantic-release/python-semantic-release'
environment:
name: pypi
url: https://pypi.org/project/python-semantic-release/
permissions:
# https://docs.github.com/en/rest/overview/permissions-required-for-github-apps?apiVersion=2022-11-28#metadata
id-token: write
contents: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
Expand All @@ -121,20 +129,15 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
root_options: "-vv"

# https://github.com/pypa/gh-action-pypi-publish#specifying-a-different-username
# This will need converting to use trusted publishing at a later date
# see https://docs.pypi.org/trusted-publishers/
- name: Publish package distributions to PyPI
id: pypi-publish

# NOTE: DO NOT wrap the conditional in ${{ }} as it will always evaluate to true.
# See https://github.com/actions/runner/issues/1173
if: steps.release.outputs.released == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}

- name: Publish package distributions to GitHub Releases
id: github-release
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
Expand All @@ -40,25 +40,30 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install mypy & dev packages
run: |
python -m pip install ".[dev, mypy]"
- name: ruff
run: |
python -m ruff check . --config pyproject.toml --diff --show-source
python -m ruff check . \
--config pyproject.toml \
--diff \
--show-source \
--exit-non-zero-on-fix
- name: mypy
run: python -m mypy --ignore-missing-imports semantic_release

commitlint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5
45 changes: 45 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: 'Stale Bot'
on:
schedule:
# Execute Daily at 7:15 AM UTC
- cron: '15 7 * * *'

# Default token permissions = None
permissions: {}


jobs:
stale:
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
pull-requests: write
steps:
- uses: actions/stale@v9
with:
# default: 30, GitHub Actions API Rate limit is 1000/hr
operations-per-run: 200
exempt-all-milestones: true
# exempt-all-assignees: false (default)
stale-issue-label: stale
days-before-issue-stale: 90
days-before-issue-close: 7
exempt-issue-labels: confirmed, help-wanted
stale-issue-message: >
This issue is stale because it has not been confirmed or planned by the maintainers
and has been open 90 days with no recent activity. It will be closed in 7 days,
if no further activity occurs. Thank you for your contributions.
close-issue-message: >
This issue was closed because activity was dormant for 97 days.
# PR Configurations
stale-pr-label: stale
days-before-pr-stale: 60
days-before-pr-close: 10
exempt-pr-labels: confirmed, dependabot
stale-pr-message: >
This PR is stale because it has not been confirmed or planned by the maintainers
and had been open 60 days with no recent activity. It will be closed in 10 days,
if no further activity occurs. Thank you for your contributions.
close-pr-message: >
This PR was closed because activity was dormant for 70 days.
32 changes: 20 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
default_language_version:
python: python3

exclude: "^CHANGELOG.md$"

repos:
# Meta hooks
- repo: meta
Expand Down Expand Up @@ -30,37 +32,43 @@ repos:
- id: check-ast

# Formatters that may modify source files automatically
- repo: https://github.com/psf/black
rev: 23.9.1
- repo: https://github.com/astral-sh/ruff-pre-commit
# Keep old ruff formatting rules until other merge requests are completed
rev: v0.1.11
hooks:
- id: black
- id: ruff-format
name: ruff (format)
args: ["."]
pass_filenames: false

- repo: https://github.com/adamchainz/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs
additional_dependencies: ["black==23.7.0"]
additional_dependencies: ["black==23.10.1"]

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.15.1
hooks:
- id: pyupgrade
args: ["--py37-plus", "--keep-runtime-typing"]
args: ["--py38-plus", "--keep-runtime-typing"]

# Linters and validation
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.292
rev: v0.3.2
hooks:
- id: ruff
name: ruff (lint)
args:
- "--fix"
- "--exit-non-zero-on-fix"
- "--statistics"
- "--format=text"
- "--output-format=text"
- "."
pass_filenames: false

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.5.1"
rev: "v1.9.0"
hooks:
- id: mypy
args: ["--config-file", "pyproject.toml"]
Expand All @@ -85,7 +93,7 @@ repos:
- id: rst-inline-touching-normal

- repo: https://github.com/jendrikseipp/vulture
rev: "v2.10"
rev: "v2.11"
hooks:
- id: vulture
args:
Expand All @@ -96,7 +104,7 @@ repos:
- "tests"

- repo: https://github.com/pycqa/bandit
rev: 1.7.5
rev: 1.7.8
hooks:
- id: bandit
args:
Expand All @@ -110,7 +118,7 @@ repos:

# GHA linting
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: "0.27.0"
rev: "0.28.0"
hooks:
- id: check-github-workflows
- id: check-readthedocs
Expand Down

0 comments on commit 9f8c42c

Please sign in to comment.