Skip to content

Commit

Permalink
chore: trusted pub, Python 3.12 (#22)
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii committed Oct 3, 2023
1 parent 8e1fee2 commit 7c8bb75
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 116 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/cd.yml
@@ -0,0 +1,35 @@
name: CD

on:
workflow_dispatch:
release:
types:
- published

jobs:
dist:
name: Distribution build
runs-on: ubuntu-latest

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

- uses: hynek/build-and-inspect-python-package@v1

publish:
name: Publish
needs: [dist]
environment: pypi
permissions:
id-token: write
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
name: Packages
path: dist

- uses: pypa/gh-action-pypi-publish@release/v1
34 changes: 4 additions & 30 deletions .github/workflows/ci.yml
Expand Up @@ -5,12 +5,7 @@ on:
pull_request:
push:
branches:
- master
- main
- develop
release:
types:
- published

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -20,19 +15,13 @@ env:
FORCE_COLOR: 3

jobs:
pre-commit:
name: Format
pylint:
name: PyLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- uses: pre-commit/action@v3.0.0
with:
extra_args: --hook-stage manual --all-files
- name: Run PyLint
run: |
echo "::add-matcher::$GITHUB_WORKSPACE/.github/matchers/pylint.json"
Expand All @@ -41,11 +30,10 @@ jobs:
checks:
name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
needs: [pre-commit]
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.11"]
python-version: ["3.8", "3.12"]
runs-on: [ubuntu-latest, macos-latest, windows-latest]

include:
Expand Down Expand Up @@ -73,24 +61,10 @@ jobs:
dist:
name: Distribution build
runs-on: ubuntu-latest
needs: [pre-commit]

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

- name: Build sdist and wheel
run: pipx run build

- uses: actions/upload-artifact@v3
with:
path: dist

- name: Check products
run: pipx run twine check dist/*

- uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'release' && github.event.action == 'published'
with:
password: ${{ secrets.pypi_password }}
- uses: hynek/build-and-inspect-python-package@v1
61 changes: 0 additions & 61 deletions docs/conf.py

This file was deleted.

24 changes: 0 additions & 24 deletions docs/index.rst

This file was deleted.

6 changes: 5 additions & 1 deletion pyproject.toml
Expand Up @@ -22,6 +22,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Typing :: Typed",
]
dynamic = ["version"]
Expand Down Expand Up @@ -114,7 +115,6 @@ extend-ignore = [
"PLR", # Design related pylint codes
"E501", # Line too long
]
target-version = "py38"
src = ["src"]
unfixable = [
"F841", # Removes unused variables
Expand All @@ -135,3 +135,7 @@ messages_control.disable = [
"wrong-import-position",
"invalid-name",
]


[tool.repo-review]
ignore = ["PY004", "PC111", "RTD"]

0 comments on commit 7c8bb75

Please sign in to comment.