Skip to content

Commit 7a8c0e3

Browse files
Merge pull request #1 from kintsugi-tax/chore/no-ref/v0.3.0-refactor
chore/no-ref: v0.3.0 refactor and open source prep
2 parents 3d188ad + e7c009e commit 7a8c0e3

17 files changed

Lines changed: 540 additions & 606 deletions

.github/workflows/auto-tag.yml

Lines changed: 0 additions & 60 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
python-version: '3.12'
2121

2222
- name: Install Poetry
23-
uses: snok/install-poetry@v1
23+
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
2424
with:
25-
version: latest
25+
version: "2.1.3"
2626
virtualenvs-create: true
2727
virtualenvs-in-project: true
2828

@@ -32,5 +32,77 @@ jobs:
3232
- name: Run pre-commit hooks
3333
run: poetry run pre-commit run --all-files
3434

35+
- name: Check version consistency
36+
run: |
37+
PYPROJECT_VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/' || true)
38+
INIT_VERSION=$(grep '^__version__ = ' squawk_alembic/__init__.py | sed 's/__version__ = "\(.*\)"/\1/' || true)
39+
if [ -z "$PYPROJECT_VERSION" ] || [ -z "$INIT_VERSION" ]; then
40+
echo "::error::Could not parse version from pyproject.toml or __init__.py"
41+
exit 1
42+
fi
43+
if [ "$PYPROJECT_VERSION" != "$INIT_VERSION" ]; then
44+
echo "::error::Version mismatch: pyproject.toml ($PYPROJECT_VERSION) != __init__.py ($INIT_VERSION)"
45+
echo "Run 'make bump VERSION=x.y.z' to update both files."
46+
exit 1
47+
fi
48+
echo "Versions match: $PYPROJECT_VERSION"
49+
3550
- name: Run tests
3651
run: poetry run pytest tests/ -v
52+
53+
auto-tag:
54+
needs: lint-and-test
55+
if: github.event_name == 'push'
56+
runs-on: ubuntu-latest
57+
permissions:
58+
contents: write
59+
outputs:
60+
tag: ${{ steps.tag.outputs.tag }}
61+
created: ${{ steps.tag.outputs.created }}
62+
63+
steps:
64+
- name: Checkout code
65+
uses: actions/checkout@v4
66+
with:
67+
fetch-depth: 0
68+
69+
- name: Create tag if needed
70+
id: tag
71+
run: |
72+
VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
73+
TAG="v${VERSION}"
74+
75+
echo "Detected version: $VERSION"
76+
echo "Tag: $TAG"
77+
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
78+
79+
if git rev-parse "$TAG" >/dev/null 2>&1; then
80+
echo "Tag $TAG already exists. Nothing to do."
81+
echo "created=false" >> "$GITHUB_OUTPUT"
82+
exit 0
83+
fi
84+
85+
echo "Creating and pushing tag $TAG"
86+
git tag "$TAG"
87+
git push origin "$TAG"
88+
echo "created=true" >> "$GITHUB_OUTPUT"
89+
90+
release:
91+
needs: auto-tag
92+
if: needs.auto-tag.outputs.created == 'true'
93+
runs-on: ubuntu-latest
94+
permissions:
95+
contents: write
96+
97+
steps:
98+
- name: Checkout code
99+
uses: actions/checkout@v4
100+
101+
- name: Create GitHub Release
102+
env:
103+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104+
TAG: ${{ needs.auto-tag.outputs.tag }}
105+
run: |
106+
gh release create "$TAG" \
107+
--title "Release $TAG" \
108+
--generate-notes

.github/workflows/version-check.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.gitignore

Lines changed: 14 additions & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -1,179 +1,32 @@
1-
# Byte-compiled / optimized / DLL files
1+
# Byte-compiled / optimized
22
__pycache__/
33
*.py[cod]
44
*$py.class
55

6-
# C extensions
7-
*.so
8-
96
# Distribution / packaging
10-
.Python
117
build/
12-
develop-eggs/
138
dist/
14-
downloads/
15-
eggs/
16-
.eggs/
17-
lib/
18-
lib64/
19-
parts/
20-
sdist/
21-
var/
22-
wheels/
23-
share/python-wheels/
249
*.egg-info/
25-
.installed.cfg
2610
*.egg
27-
MANIFEST
2811

29-
# PyInstaller
30-
# Usually these files are written by a python script from a template
31-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32-
*.manifest
33-
*.spec
12+
# Virtual environments
13+
.venv/
3414

35-
# Installer logs
36-
pip-log.txt
37-
pip-delete-this-directory.txt
15+
# Linting
16+
.ruff_cache/
3817

39-
# Unit test / coverage reports
40-
htmlcov/
41-
.tox/
42-
.nox/
43-
.coverage
44-
.coverage.*
45-
.cache
46-
nosetests.xml
47-
coverage.xml
48-
*.cover
49-
*.py,cover
50-
.hypothesis/
18+
# Test / coverage
5119
.pytest_cache/
52-
cover/
53-
54-
# Translations
55-
*.mo
56-
*.pot
57-
58-
# Django stuff:
59-
*.log
60-
local_settings.py
61-
db.sqlite3
62-
db.sqlite3-journal
63-
64-
# Flask stuff:
65-
instance/
66-
.webassets-cache
67-
68-
# Scrapy stuff:
69-
.scrapy
70-
71-
# Sphinx documentation
72-
docs/_build/
73-
74-
# PyBuilder
75-
.pybuilder/
76-
target/
77-
78-
# Jupyter Notebook
79-
.ipynb_checkpoints
80-
81-
# IPython
82-
profile_default/
83-
ipython_config.py
84-
85-
# pyenv
86-
# For a library or package, you might want to ignore these files since the code is
87-
# intended to run in multiple environments; otherwise, check them in:
88-
# .python-version
89-
90-
# pipenv
91-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94-
# install all needed dependencies.
95-
#Pipfile.lock
96-
97-
# poetry
98-
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99-
# This is especially recommended for binary packages to ensure reproducibility, and is more
100-
# commonly ignored for libraries.
101-
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102-
#poetry.lock
103-
104-
# pdm
105-
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106-
#pdm.lock
107-
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108-
# in version control.
109-
# https://pdm.fming.dev/#use-with-ide
110-
.pdm.toml
111-
112-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113-
__pypackages__/
114-
115-
# Celery stuff
116-
celerybeat-schedule
117-
celerybeat.pid
118-
119-
# SageMath parsed files
120-
*.sage.py
121-
122-
# Environments
123-
.env
124-
.venv
125-
env/
126-
venv/
127-
ENV/
128-
env.bak/
129-
venv.bak/
130-
131-
# Spyder project settings
132-
.spyderproject
133-
.spyproject
134-
135-
# Rope project settings
136-
.ropeproject
137-
138-
# mkdocs documentation
139-
/site
140-
141-
# mypy
142-
.mypy_cache/
143-
.dmypy.json
144-
dmypy.json
145-
146-
# Pyre type checker
147-
.pyre/
148-
149-
# pytype static type analyzer
150-
.pytype/
151-
152-
# Cython debug symbols
153-
cython_debug/
20+
.coverage
21+
htmlcov/
15422

155-
# PyCharm
156-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158-
# and can be added to the global gitignore or merged into this file. For a more nuclear
159-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
23+
# Editors / OS
16024
.idea/
161-
25+
.vscode/
16226
.DS_Store
163-
.vscode
164-
.python-version
165-
166-
compare_output/
167-
export/backup/
168-
node_modules/
16927

28+
# Environment
29+
.env
17030

171-
.serverless/
172-
173-
# Local files with credentials/secrets
174-
local_files/
175-
176-
# Claude skills/agents/config
177-
.claude/
178-
CLAUDE.md
179-
.mcp.json
31+
# Python version
32+
.python-version

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ repos:
3030
hooks:
3131
- id: poetry-check
3232
- repo: https://github.com/facebook/pyrefly-pre-commit
33-
rev: 0.0.1
33+
rev: 0.53.0
3434
hooks:
35-
- id: pyrefly-typecheck-system
35+
- id: pyrefly-check
3636
name: Pyrefly (type checking)
3737
pass_filenames: false
38-
always_run: true
38+
language: system

0 commit comments

Comments
 (0)