-
Notifications
You must be signed in to change notification settings - Fork 0
chore/no-ref: v0.3.0 refactor and open source prep #1
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
Changes from all commits
509d47b
0c48a4e
e621377
978307d
357179a
f7e73d6
a2d5f85
e7c009e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,9 +20,9 @@ jobs: | |
| python-version: '3.12' | ||
|
|
||
| - name: Install Poetry | ||
| uses: snok/install-poetry@v1 | ||
| uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1 | ||
| with: | ||
| version: latest | ||
| version: "2.1.3" | ||
| virtualenvs-create: true | ||
| virtualenvs-in-project: true | ||
|
|
||
|
|
@@ -32,5 +32,77 @@ jobs: | |
| - name: Run pre-commit hooks | ||
| run: poetry run pre-commit run --all-files | ||
|
|
||
| - name: Check version consistency | ||
| run: | | ||
| PYPROJECT_VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/' || true) | ||
| INIT_VERSION=$(grep '^__version__ = ' squawk_alembic/__init__.py | sed 's/__version__ = "\(.*\)"/\1/' || true) | ||
| if [ -z "$PYPROJECT_VERSION" ] || [ -z "$INIT_VERSION" ]; then | ||
| echo "::error::Could not parse version from pyproject.toml or __init__.py" | ||
| exit 1 | ||
| fi | ||
| if [ "$PYPROJECT_VERSION" != "$INIT_VERSION" ]; then | ||
| echo "::error::Version mismatch: pyproject.toml ($PYPROJECT_VERSION) != __init__.py ($INIT_VERSION)" | ||
| echo "Run 'make bump VERSION=x.y.z' to update both files." | ||
| exit 1 | ||
| fi | ||
| echo "Versions match: $PYPROJECT_VERSION" | ||
|
|
||
| - name: Run tests | ||
| run: poetry run pytest tests/ -v | ||
|
|
||
| auto-tag: | ||
| needs: lint-and-test | ||
| if: github.event_name == 'push' | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| outputs: | ||
| tag: ${{ steps.tag.outputs.tag }} | ||
| created: ${{ steps.tag.outputs.created }} | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Create tag if needed | ||
| id: tag | ||
| run: | | ||
| VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/') | ||
| TAG="v${VERSION}" | ||
|
|
||
| echo "Detected version: $VERSION" | ||
| echo "Tag: $TAG" | ||
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | ||
|
|
||
| if git rev-parse "$TAG" >/dev/null 2>&1; then | ||
| echo "Tag $TAG already exists. Nothing to do." | ||
| echo "created=false" >> "$GITHUB_OUTPUT" | ||
| exit 0 | ||
| fi | ||
|
|
||
| echo "Creating and pushing tag $TAG" | ||
| git tag "$TAG" | ||
| git push origin "$TAG" | ||
| echo "created=true" >> "$GITHUB_OUTPUT" | ||
|
|
||
| release: | ||
| needs: auto-tag | ||
| if: needs.auto-tag.outputs.created == 'true' | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Create GitHub Release | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| TAG: ${{ needs.auto-tag.outputs.tag }} | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix expression injection in release step The old workflow interpolated |
||
| run: | | ||
| gh release create "$TAG" \ | ||
| --title "Release $TAG" \ | ||
| --generate-notes | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,179 +1,32 @@ | ||
| # Byte-compiled / optimized / DLL files | ||
| # Byte-compiled / optimized | ||
| __pycache__/ | ||
| *.py[cod] | ||
| *$py.class | ||
|
|
||
| # C extensions | ||
| *.so | ||
|
|
||
| # Distribution / packaging | ||
| .Python | ||
| build/ | ||
| develop-eggs/ | ||
| dist/ | ||
| downloads/ | ||
| eggs/ | ||
| .eggs/ | ||
| lib/ | ||
| lib64/ | ||
| parts/ | ||
| sdist/ | ||
| var/ | ||
| wheels/ | ||
| share/python-wheels/ | ||
| *.egg-info/ | ||
| .installed.cfg | ||
| *.egg | ||
| MANIFEST | ||
|
|
||
| # PyInstaller | ||
| # Usually these files are written by a python script from a template | ||
| # before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
| *.manifest | ||
| *.spec | ||
| # Virtual environments | ||
| .venv/ | ||
|
|
||
| # Installer logs | ||
| pip-log.txt | ||
| pip-delete-this-directory.txt | ||
| # Linting | ||
| .ruff_cache/ | ||
|
|
||
| # Unit test / coverage reports | ||
| htmlcov/ | ||
| .tox/ | ||
| .nox/ | ||
| .coverage | ||
| .coverage.* | ||
| .cache | ||
| nosetests.xml | ||
| coverage.xml | ||
| *.cover | ||
| *.py,cover | ||
| .hypothesis/ | ||
| # Test / coverage | ||
| .pytest_cache/ | ||
| cover/ | ||
|
|
||
| # Translations | ||
| *.mo | ||
| *.pot | ||
|
|
||
| # Django stuff: | ||
| *.log | ||
| local_settings.py | ||
| db.sqlite3 | ||
| db.sqlite3-journal | ||
|
|
||
| # Flask stuff: | ||
| instance/ | ||
| .webassets-cache | ||
|
|
||
| # Scrapy stuff: | ||
| .scrapy | ||
|
|
||
| # Sphinx documentation | ||
| docs/_build/ | ||
|
|
||
| # PyBuilder | ||
| .pybuilder/ | ||
| target/ | ||
|
|
||
| # Jupyter Notebook | ||
| .ipynb_checkpoints | ||
|
|
||
| # IPython | ||
| profile_default/ | ||
| ipython_config.py | ||
|
|
||
| # pyenv | ||
| # For a library or package, you might want to ignore these files since the code is | ||
| # intended to run in multiple environments; otherwise, check them in: | ||
| # .python-version | ||
|
|
||
| # pipenv | ||
| # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
| # However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
| # having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
| # install all needed dependencies. | ||
| #Pipfile.lock | ||
|
|
||
| # poetry | ||
| # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. | ||
| # This is especially recommended for binary packages to ensure reproducibility, and is more | ||
| # commonly ignored for libraries. | ||
| # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control | ||
| #poetry.lock | ||
|
|
||
| # pdm | ||
| # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. | ||
| #pdm.lock | ||
| # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it | ||
| # in version control. | ||
| # https://pdm.fming.dev/#use-with-ide | ||
| .pdm.toml | ||
|
|
||
| # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm | ||
| __pypackages__/ | ||
|
|
||
| # Celery stuff | ||
| celerybeat-schedule | ||
| celerybeat.pid | ||
|
|
||
| # SageMath parsed files | ||
| *.sage.py | ||
|
|
||
| # Environments | ||
| .env | ||
| .venv | ||
| env/ | ||
| venv/ | ||
| ENV/ | ||
| env.bak/ | ||
| venv.bak/ | ||
|
|
||
| # Spyder project settings | ||
| .spyderproject | ||
| .spyproject | ||
|
|
||
| # Rope project settings | ||
| .ropeproject | ||
|
|
||
| # mkdocs documentation | ||
| /site | ||
|
|
||
| # mypy | ||
| .mypy_cache/ | ||
| .dmypy.json | ||
| dmypy.json | ||
|
|
||
| # Pyre type checker | ||
| .pyre/ | ||
|
|
||
| # pytype static type analyzer | ||
| .pytype/ | ||
|
|
||
| # Cython debug symbols | ||
| cython_debug/ | ||
| .coverage | ||
| htmlcov/ | ||
|
|
||
| # PyCharm | ||
| # JetBrains specific template is maintained in a separate JetBrains.gitignore that can | ||
| # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore | ||
| # and can be added to the global gitignore or merged into this file. For a more nuclear | ||
| # option (not recommended) you can uncomment the following to ignore the entire idea folder. | ||
| # Editors / OS | ||
| .idea/ | ||
|
|
||
| .vscode/ | ||
| .DS_Store | ||
| .vscode | ||
| .python-version | ||
|
|
||
| compare_output/ | ||
| export/backup/ | ||
| node_modules/ | ||
|
|
||
| # Environment | ||
| .env | ||
|
|
||
| .serverless/ | ||
|
|
||
| # Local files with credentials/secrets | ||
| local_files/ | ||
|
|
||
| # Claude skills/agents/config | ||
| .claude/ | ||
| CLAUDE.md | ||
| .mcp.json | ||
| # Python version | ||
| .python-version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gate auto-tag on CI passing
Previously
auto-tag.ymlandci.ymlwere independent workflows both triggered onpush: branches: [main]. A broken commit could get tagged and released before tests failed. Merging them into one workflow withneeds: lint-and-testensures tagging only happens after tests pass. Theif: github.event_name == 'push'guard prevents the auto-tag job from running on PR checks.