-
Notifications
You must be signed in to change notification settings - Fork 0
chore: release pipeline, testing helper, docs, dev-loop hardening #2
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| --- | ||
| name: Bug report | ||
| about: Report incorrect behaviour | ||
| title: "" | ||
| labels: bug | ||
| assignees: "" | ||
| --- | ||
|
|
||
| ## What happened | ||
|
|
||
| A clear description of the bug. | ||
|
|
||
| ## Expected behaviour | ||
|
|
||
| What you expected instead. | ||
|
|
||
| ## Reproduction | ||
|
|
||
| A minimal snippet. Mock the client with `snowflake_sql_api.testing` if the issue | ||
| does not need a live account (see docs/testing.md): | ||
|
|
||
| ```python | ||
| # ... | ||
| ``` | ||
|
|
||
| ## Environment | ||
|
|
||
| - `snowflake-sql-api` version: | ||
| - Python version: | ||
| - OS: | ||
|
|
||
| ## Additional context | ||
|
|
||
| Tracebacks (redact secrets), Snowflake `code` / `sqlState` if relevant, anything | ||
| else that helps. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| --- | ||
| name: Feature request | ||
| about: Suggest an enhancement | ||
| title: "" | ||
| labels: enhancement | ||
| assignees: "" | ||
| --- | ||
|
|
||
| ## Problem | ||
|
|
||
| What are you trying to do that the library does not support today? | ||
|
|
||
| ## Proposed solution | ||
|
|
||
| What you would like to see. Keep in mind the project's design principles | ||
| (pure-Python, small footprint, vendor-neutral, sync/async parity). | ||
|
|
||
| ## Alternatives considered | ||
|
|
||
| Other approaches, existing workarounds, or related libraries. | ||
|
|
||
| ## Additional context | ||
|
|
||
| Anything else (links to Snowflake SQL API docs, example use case). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| ## Summary | ||
|
|
||
| What changed and why. Write for the reviewer and for downstream consumers, not | ||
| for yourself: lead with the user-visible behaviour, not the implementation | ||
| narrative. | ||
|
|
||
| ## Backwards compatibility | ||
|
|
||
| This is a library; downstream code depends on it. State the impact: | ||
|
|
||
| - [ ] No public API change, or | ||
| - [ ] Public API changed (describe it, and the migration for callers) | ||
|
|
||
| Do not add compatibility shims for behaviour that never shipped; just change the | ||
| code. | ||
|
|
||
| ## Test plan | ||
|
|
||
| - [ ] `coverage run -m pytest && coverage report` passes (coverage holds >= 89%) | ||
| - [ ] `ruff check`, `black --check`, and `mypy` pass (or `pre-commit run --all-files`) | ||
| - [ ] New behaviour is covered by tests; each fixed bug has a `test_regression_*` | ||
| - [ ] Public API changes documented in the README / `docs/` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| version: 2 | ||
| updates: | ||
| # Python dependencies declared in pyproject.toml. | ||
| - package-ecosystem: "pip" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| open-pull-requests-limit: 5 | ||
| labels: | ||
| - "dependencies" | ||
|
|
||
| # GitHub Actions used by the CI and publish workflows. | ||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| open-pull-requests-limit: 5 | ||
| labels: | ||
| - "dependencies" | ||
| - "github-actions" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| name: Publish to PyPI | ||
|
|
||
| # Tag-driven release. Push a `vX.Y.Z` tag and this builds the sdist/wheel | ||
| # (version derived from the tag by hatch-vcs) and uploads to PyPI via OIDC | ||
| # trusted publishing. See RELEASING.md. | ||
| on: | ||
| push: | ||
| tags: | ||
| - "v*" | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: Lint and type-check | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Install | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -e '.[dev]' | ||
| - name: ruff | ||
| run: ruff check snowflake_sql_api tests | ||
| - name: black | ||
| run: black --check snowflake_sql_api tests | ||
| - name: mypy | ||
| run: mypy snowflake_sql_api | ||
|
|
||
| test: | ||
| name: Test (py${{ matrix.python-version }}) | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -e '.[dev]' | ||
| - name: pytest | ||
| # See CI: `coverage run` so tracing precedes the pytest11 plugin import. | ||
| run: | | ||
| coverage run -m pytest | ||
| coverage report | ||
|
|
||
| publish: | ||
| name: Build and publish | ||
| needs: [lint, test] | ||
| runs-on: ubuntu-latest | ||
| environment: pypi | ||
| permissions: | ||
| id-token: write # OIDC trusted publishing; no API token needed | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| # hatch-vcs needs the tag (and history) to derive the version. | ||
| fetch-depth: 0 | ||
| persist-credentials: false | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Install build tooling | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install build twine | ||
| - name: Build sdist and wheel | ||
| run: python -m build | ||
| - name: Check distribution metadata | ||
| run: twine check dist/* | ||
| - name: Publish to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # Pre-commit hooks for snowflake-sql-api. Install with `pre-commit install` | ||
| # (the hook then runs on every commit); run the full set with | ||
| # `pre-commit run --all-files`. Hook versions track the `[dev]` floors in | ||
| # pyproject.toml. | ||
| repos: | ||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.15.17 | ||
| hooks: | ||
| - id: ruff-check | ||
|
|
||
| - repo: https://github.com/psf/black | ||
| # Last black that still runs on Python 3.9 (the project's runtime floor); | ||
| # 25.12.0+ require 3.10+. Kept in sync with the [dev] cap in pyproject.toml. | ||
| rev: 25.9.0 | ||
| hooks: | ||
| - id: black | ||
|
|
||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v5.0.0 | ||
| hooks: | ||
| - id: trailing-whitespace | ||
| - id: end-of-file-fixer | ||
| - id: check-yaml | ||
| - id: check-toml | ||
| - id: check-merge-conflict | ||
| - id: check-added-large-files | ||
| # Keypair auth: belt-and-braces with the *.p8 / *.pem .gitignore rules. | ||
| - id: detect-private-key | ||
|
|
||
| # mypy runs as a local hook (not the mirror) so it resolves project imports | ||
| # and stubs from the installed dev environment, matching the CI invocation. | ||
| - repo: local | ||
| hooks: | ||
| - id: mypy | ||
| name: mypy | ||
| entry: mypy snowflake_sql_api | ||
| language: system | ||
| types: [python] | ||
| pass_filenames: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.