Skip to content

Commit

Permalink
Update supported Python versions + add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
dmayo3 committed Dec 5, 2024
1 parent bd2f017 commit 5c0d40c
Show file tree
Hide file tree
Showing 6 changed files with 170 additions and 16 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/docs-preview.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: RtD Docs Preview
on:
pull_request_target:
types:
- opened

permissions:
pull-requests: write

jobs:
documentation-links:
runs-on: ubuntu-latest
steps:
- uses: readthedocs/actions/preview@v1
with:
project-slug: "utctime"
107 changes: 107 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Release to PyPI / TestPyPi
on:
workflow_dispatch:
push:
tags:
- "0.*"
- "1.*"

defaults:
run:
shell: bash

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: |
pip install "tox>=4.5,<4.6"
- name: Run tox
run: |
tox --colored no --quiet
dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install build tools
run: python -m pip install build
- name: Build source and wheel distribution
run: python -m build --sdist --wheel --outdir dist/
- name: Upload distribution artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: dist

verify-dist:
runs-on: ubuntu-latest
needs: dist
steps:
- name: Download dist artifact
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Verify dist files exist
run: ls dist/*
- name: Validate wheel distribution data
run: python -m zipfile --list dist/*.whl | grep --extended-regexp --silent 'utctime/__init__.py'

upload-to-testpypi:
runs-on: ubuntu-latest
needs:
- build
- verify-dist
environment:
name: testpypi
url: https://test.pypi.org/p/utctime
steps:
- name: Download dist artifact
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/

upload-to-pypi:
runs-on: ubuntu-latest
needs:
- build
- verify-dist
environment:
name: pypi
url: https://pypi.org/p/utctime
steps:
- name: Download dist artifact
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
repository_url: https://upload.pypi.org/legacy/
38 changes: 38 additions & 0 deletions .github/workflows/utctime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build
on:
push:
branches: ["*"]
pull_request:
branches: ["*"]
workflow_dispatch:

permissions:
contents: read

defaults:
run:
shell: bash

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: |
pip install "tox>=4.5,<4.6"
- name: Run tox
run: |
tox --colored no --quiet
4 changes: 2 additions & 2 deletions .python-version
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
3.7
3.8
3.9
3.10
3.11
3.12
3.13
19 changes: 6 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.2-alpha"

description = "A simple and type-safe way of working with UTC datetimes and ISO 8601 strings."

requires-python = ">= 3.7"
requires-python = ">= 3.9"
readme = "README.rst"
license = { file = "LICENSE" }
classifiers = [
Expand All @@ -15,11 +15,11 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Software Development :: Libraries",
Expand All @@ -46,13 +46,6 @@ tag = true
push = false

[tool.bumpver.file_patterns]
"pyproject.toml" = [
'current_version = "{version}"',
'version = "{version}"',
]
"utctime/__init__.py" = [
"{version}",
]
"README.rst" = [
"{version}",
]
"pyproject.toml" = ['current_version = "{version}"', 'version = "{version}"']
"utctime/__init__.py" = ["{version}"]
"README.rst" = ["{version}"]
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
requires =
tox>=4
env_list = format, lint, mypy, py{37,38,39,310,311}, docs
env_list = format, lint, mypy, py{39,310,311,312,313}, docs

[testenv]
description = run unit tests
Expand Down

0 comments on commit 5c0d40c

Please sign in to comment.