Skip to content
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
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Publish to PyPI and create release on GitHub

on: push
on:
push:
tags:
- 'v*'

jobs:
build:
Expand All @@ -12,6 +15,8 @@ jobs:

steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0 # setuptools_scm needs full history/tags to derive the version
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Build a binary wheel and a source tarball
Expand All @@ -25,7 +30,6 @@ jobs:
publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ jobs:

steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0 # setuptools_scm needs full history/tags to derive the version

- name: Install uv
uses: astral-sh/setup-uv@v3
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@ target/

# ignore generated file that gets manually copied into README
cli.md

# generated by setuptools_scm
src/bcdata/_version.py
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools"]
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"

[project]
Expand Down Expand Up @@ -47,8 +47,8 @@ bcdata = "bcdata.cli:cli"
Homepage = "https://github.com/smnorris/bcdata"
Issues = "https://github.com/smnorris/bcdata"

[tool.setuptools.dynamic]
version = {attr = "bcdata.__version__"}
[tool.setuptools_scm]
write_to = "src/bcdata/_version.py"

[tool.ruff]
line-length = 100
3 changes: 1 addition & 2 deletions src/bcdata/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import requests

from ._version import __version__ as __version__
from .bc2pg import bc2pg as bc2pg
from .bcdc import get_table_definition as get_table_definition
from .bcdc import get_table_name as get_table_name
Expand All @@ -20,5 +21,3 @@
else:
raise ConnectionError(f"Failed to download primary key database at {PRIMARY_KEY_DB_URL}")
primary_keys = {}

__version__ = "0.17.1"
Loading