Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
a3ede58
update readme formatting
bmos Feb 17, 2026
e81c4b2
remove unused import in test
bmos Feb 17, 2026
30c9f16
consistent formatting
bmos Feb 17, 2026
dbbee93
use https documentation link
bmos Feb 17, 2026
9181534
add type hints
bmos Feb 17, 2026
70a9182
remove incorrect classifier
bmos Feb 17, 2026
d1a1027
remove coding: utf-8 from top of files
bmos Feb 17, 2026
0e2e910
string handling / error improvements
bmos Feb 17, 2026
93d8cbd
update copyright date
bmos Feb 17, 2026
c4dc1de
updated test requirements due to compatibility issue with urllib3 2.0…
bmos Feb 17, 2026
38d8b9d
add benchmark and vintage type hints
bmos Feb 17, 2026
f00654d
cleaner check for data or f in _post_batch
bmos Feb 17, 2026
8095f85
direct referencing _benchmark and _vintage
bmos Feb 17, 2026
0d1072f
safer data or f check in _post_batch
bmos Feb 17, 2026
2a8c128
safer handling of open files in _post_batch
bmos Feb 17, 2026
220e2c3
remove another # -*- coding: utf-8 -*-
bmos Feb 17, 2026
f64f8bb
consolidate build info into pyproject.toml
bmos Feb 17, 2026
764a3c3
update makefile
bmos Feb 17, 2026
33e9eed
remove setuptools-scm
bmos Feb 17, 2026
3441aad
update pypi url links
bmos Feb 17, 2026
95f5f21
use backwards-compatible type hints
bmos Feb 28, 2026
c51c218
expand urllib3 version range
bmos Feb 28, 2026
da52f14
run ci on pull requests against any branch
bmos Feb 28, 2026
41cf34a
ci workflow with annotations, linting, security check, and coverage
bmos Feb 28, 2026
a6ecd25
fix actions/setup-python version flag
bmos Feb 28, 2026
ad420e1
updated release workflow with testing
bmos Feb 28, 2026
bfb90e5
update dependency versions
bmos Feb 28, 2026
0a5ca78
more typing
bmos Feb 28, 2026
fc6dfbd
explicit handling of timeout arg
bmos Feb 28, 2026
f319fe4
modernize tests
bmos Feb 28, 2026
24bff72
move coverage job up in workflow file
bmos Feb 28, 2026
a9ad552
add mypy job
bmos Feb 28, 2026
3c3beaf
add coverage comment for pr workflow
bmos Feb 28, 2026
aa24b38
bnump min setuptools version
bmos Feb 28, 2026
313a9d2
adjust dependency versions for compatibility and add mypy
bmos Feb 28, 2026
ca1f141
add ruff config
bmos Feb 28, 2026
16c0056
add mypy config
bmos Feb 28, 2026
a6869b0
add pytest/coverage config
bmos Feb 28, 2026
3034755
consolidate actions/setup-python and install-pinned/uv to astral-sh/s…
bmos Feb 28, 2026
c30a5c8
consolidate actions/setup-python and install-pinned/uv to astral-sh/s…
bmos Feb 28, 2026
926644f
provide src path to mypy
bmos Feb 28, 2026
1ac4b9c
add badges to readme
bmos Feb 28, 2026
1e9b8f2
add tool.setuptools configs
bmos Mar 1, 2026
15f48f5
update makefile
bmos Mar 1, 2026
d2a8665
tidying up licenses at top of files
bmos Mar 1, 2026
a541123
use dependency groups
bmos Mar 13, 2026
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
46 changes: 46 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This file is part of censusgeocode.
# https://github.com/fitnr/censusgeocode

# Licensed under the General Public License (version 3)
# http://opensource.org/licenses/LGPL-3.0
# Copyright (c) 2015-2026, Neil Freeman <contact@fakeisthenewreal.org>

name: Post coverage comment

on:
workflow_run:
workflows:
- Test package
types:
- completed

permissions: read-all

jobs:
test:
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'

runs-on: ubuntu-latest

permissions:
# Gives the action the necessary permissions for publishing new
# comments in pull requests.
pull-requests: write
# Gives the action the necessary permissions for editing existing
# comments (to avoid publishing multiple comments in the same PR)
contents: write
# Gives the action the necessary permissions for looking up the
# workflow that launched this workflow, and download the related
# artifact that contains the comment to be published
actions: read

steps:
- uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2
with:
disable-sudo: true
egress-policy: audit

- uses: py-cov-action/python-coverage-comment-action@e623398c19eb3853a5572d4a516e10b15b5cefbc
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }}
137 changes: 123 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,146 @@

# Licensed under the General Public License (version 3)
# http://opensource.org/licenses/LGPL-3.0
# Copyright (c) 2015-7, Neil Freeman <contact@fakeisthenewreal.org>
name: Publish to PyPi
# Copyright (c) 2015-2026, Neil Freeman <contact@fakeisthenewreal.org>

name: Build, test, & publish

on:
workflow_dispatch:
pull_request:
push:
branches:
- master
- main
release:
types: [created]
types:
- created

permissions: read-all

env:
CACHE_GLOBS: |
**/pyproject.toml
**/uv.lock
ENDPOINT_WHITELIST: >-
pypi.org:443
github.com:443
releases.astral.sh
files.pythonhosted.org:443
*.github.com:443
*.githubusercontent.com:443

jobs:
deploy:
build:
runs-on: ubuntu-latest

steps:
- uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: ${{ env.ENDPOINT_WHITELIST}}

- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098
with:
python-version: 3.13
activate-environment: true
cache-dependency-glob: ${{ env.CACHE_GLOBS }}

- run: >-
uv sync
--upgrade

- run: >-
uv build
--sdist

- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: censusgeocode-dist
path: dist/

test:
needs: build

strategy:
fail-fast: false
matrix:
python-version:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
os:
- ubuntu-latest
- windows-latest
- macos-latest

runs-on: ${{ matrix.os }}

steps:
- uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: ${{ env.ENDPOINT_WHITELIST}}

- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: censusgeocode-dist
path: dist

- shell: bash
run: |
file=$(find ./dist -name 'censusgeocode-*.tar.gz' | head -1)
# Extract to a temp directory first
mkdir -p temp_extract
tar -xzf "$file" -C temp_extract
# Find and move requirements files to root
find temp_extract -name 'pyproject.toml' -exec cp {} . \; 2>/dev/null || true
# Clean up
rm -rf temp_extract

- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: ${{ matrix.python-version }}
cache: pip

- shell: bash
run: |
file=$(find ./dist -name 'censusgeocode-*.tar.gz' | head -1)
pip install "$file"

publish:
if: github.repository_owner == 'fitnr' && github.event_name == 'release' && github.event.action == 'created'
needs: test

runs-on: ubuntu-latest
environment: release

permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing

steps:
- uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v6
- uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b
with:
python-version: '3.13'
disable-sudo: true
egress-policy: audit

- name: Install build requirements
run: pip install build
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- run: make build
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: censusgeocode-dist
path: dist

- name: Publish package
uses: pypa/gh-action-pypi-publish@v1.13.0
- uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verify-metadata: true
skip-existing: true
packages-dir: dist
verbose: true
Loading
Loading