Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Python 3.12 #5

Merged
merged 18 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG VARIANT="3"

FROM mcr.microsoft.com/vscode/devcontainers/python:${VARIANT}

ARG POETRY_VERSION="1.5.1"
ARG POETRY_VERSION="1.8.2"
ARG POETRY_SRC="https://install.python-poetry.org"

USER vscode
Expand Down
5 changes: 3 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json",
"name": "Python",
"build": {
"dockerfile": "Dockerfile",
"args": {
"POETRY_VERSION": "1.5.1",
"VARIANT": "3.11"
"POETRY_VERSION": "1.8.2",
"VARIANT": "3.12"
}
},
"remoteEnv": {
Expand Down
16 changes: 8 additions & 8 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ inputs:
python_version:
description: The Python version.
required: false
default: '3.11'
default: '3.12'
poetry_version:
description: The Poetry version.
required: false
default: '1.5.1'
default: '1.8.2'
install_dependencies:
description: Install dependencies.
required: false
Expand All @@ -20,15 +20,15 @@ runs:
using: composite
steps:
- name: Setup Poetry cache on Linux
uses: actions/cache@v3
uses: actions/cache@v4
if: runner.os == 'Linux'
with:
key: poetry-${{ inputs.poetry_version }}-${{ inputs.python_version }}-${{ runner.os }}-${{ runner.arch }}
path: |
~/.local/bin
~/.local/share/pypoetry
- name: Setup Poetry cache on macOS
uses: actions/cache@v3
uses: actions/cache@v4
if: runner.os == 'macOS'
with:
key: poetry-${{ inputs.poetry_version }}-${{ inputs.python_version }}-${{ runner.os }}-${{ runner.arch }}
Expand All @@ -37,23 +37,23 @@ runs:
~/.local/share/pypoetry
~/Library/Application Support/pypoetry
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python_version }}
- name: Setup Poetry
uses: Gr1N/setup-poetry@v8
uses: Gr1N/setup-poetry@v9
with:
poetry-version: ${{ inputs.poetry_version }}
- name: Setup Python with cache
uses: actions/setup-python@v4
uses: actions/setup-python@v5
if: inputs.install_dependencies == 'true'
with:
cache: poetry
python-version: ${{ inputs.python_version }}
- name: Check lockfile
if: inputs.install_dependencies == 'true'
shell: bash
run: poetry lock --check
run: poetry check --lock
- name: Install dependencies
if: inputs.install_dependencies == 'true'
shell: bash
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ on:
description: The Python version.
type: string
required: false
default: '3.11'
default: '3.12'
runs_on:
description: The runner environment.
type: string
required: false
default: ubuntu-latest
upload_artifact:
description: Upload the built artifact.
type: string
required: false
default: 'false'
outputs:
artifact_name:
description: The artifact name.
Expand All @@ -26,15 +31,16 @@ jobs:
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
with:
python_version: ${{ inputs.python_version }}
- name: Build
run: make build
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: inputs.upload_artifact == 'true'
with:
name: build-${{ github.sha }}
if-no-files-found: error
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ jobs:
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
with:
install_dependencies: 'false'
- name: Download artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact_name }}
path: dist/
Expand Down
24 changes: 14 additions & 10 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Check

on:
push:
branches:
- main
pull_request:
branches:
- '**'

Expand All @@ -19,8 +22,8 @@ jobs:
- macos-latest
- windows-latest
python:
- '3.10'
- '3.11'
- '3.12'
include:
- os: ubuntu-latest
os_name: Linux
Expand All @@ -30,7 +33,7 @@ jobs:
os_name: Windows
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
with:
Expand All @@ -45,11 +48,11 @@ jobs:
fail-fast: false
matrix:
python:
- '3.10'
- '3.11'
- '3.12'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
with:
Expand All @@ -62,6 +65,7 @@ jobs:
with:
python_version: ${{ matrix.python }}
runs_on: ${{ matrix.os }}
upload_artifact: ${{ matrix.python == '3.11' && matrix.os == 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix:
Expand All @@ -70,8 +74,8 @@ jobs:
- macos-latest
- windows-latest
python:
- '3.10'
- '3.11'
- '3.12'
include:
- os: ubuntu-latest
os_name: Linux
Expand All @@ -92,8 +96,8 @@ jobs:
- macos-latest
- windows-latest
python:
- '3.10'
- '3.11'
- '3.12'
include:
- os: ubuntu-latest
os_name: Linux
Expand All @@ -103,23 +107,23 @@ jobs:
os_name: Windows
steps:
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Download artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact_name }}
path: .
- name: Find wheels
uses: tj-actions/glob@v16
uses: tj-actions/glob@v21
id: wheels
with:
files: '*.whl'
- name: Install
run: pip install ${{ steps.wheels.outputs.paths }}
- name: Create main.py
uses: DamianReeves/write-file-action@v1.2
uses: DamianReeves/write-file-action@v1.3
with:
write-mode: overwrite
path: main.py
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
name: Format

on:
pull_request:
branches:
push:
branches-ignore:
- main
workflow_dispatch: {}

jobs:
fix:
name: Commit fixes
commit:
name: Format code
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_TOKEN }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5
uses: crazy-max/ghaction-import-gpg@v6
with:
git_user_signingkey: true
git_commit_gpgsign: true
Expand All @@ -32,7 +32,7 @@ jobs:
- name: Format
run: make format
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
if: always()
with:
commit_message: Run format
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Generate

on:
push:
branches-ignore:
- main
workflow_dispatch: {}

jobs:
commit:
name: Generate code
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_TOKEN }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
git_user_signingkey: true
git_commit_gpgsign: true
git_committer_name: ${{ secrets.GIT_USER_NAME }}
git_committer_email: ${{ secrets.GIT_USER_EMAIL }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Setup
uses: ./.github/actions/setup
with:
install_dependencies: 'false'
- name: Normalize poetry.lock
run: poetry lock --no-update
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Generate code
commit_user_name: ${{ secrets.GIT_USER_NAME }}
commit_user_email: ${{ secrets.GIT_USER_EMAIL }}
commit_author: ${{ secrets.GIT_USER_NAME }} <${{ secrets.GIT_USER_EMAIL }}>
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ jobs:
needs: build
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact_name }}
path: dist/
- name: Create GitHub release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GH_TOKEN }}
fail_on_unmatched_files: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5
uses: crazy-max/ghaction-import-gpg@v6
with:
git_user_signingkey: true
git_commit_gpgsign: true
Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.11.4
3.12.2
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2023 Evan Sosenko
Copyright (c) 2024 Evan Sosenko

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion makenew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ makenew () {
find_replace "s/${old_title}/${mk_title}/g"
find_replace "s/${old_title_underline}/${new_title_underline}/g"
find_replace "s/Package skeleton for a Python module\./${mk_description}/g"
find_replace "s/2023 Evan Sosenko/2023 ${mk_author}/g"
find_replace "s/2024 Evan Sosenko/2023 ${mk_author}/g"
find_replace "s/Evan Sosenko/${mk_author}/g"
find_replace "s/razorx@evansosenko\.com/${mk_email}/g"
find_replace "s/makenew\/pypackage/${mk_user}\/${mk_repo}/g"
Expand Down
Loading