diff --git a/.github/labeler.yml b/.github/labeler.yml deleted file mode 100644 index fbbe9f28ef..0000000000 --- a/.github/labeler.yml +++ /dev/null @@ -1,24 +0,0 @@ -docs: - - all: - - changed-files: - - any-glob-to-any-file: - - docs/** - - docs_src/** - - all-globs-to-all-files: - - '!sqlmodel/**' - - '!pyproject.toml' - -internal: - - all: - - changed-files: - - any-glob-to-any-file: - - .github/** - - scripts/** - - .gitignore - - .pre-commit-config.yaml - - requirements*.txt - - uv.lock - - all-globs-to-all-files: - - '!docs/**' - - '!sqlmodel/**' - - '!pyproject.toml' diff --git a/.github/workflows/add-to-project.yml b/.github/workflows/add-to-project.yml deleted file mode 100644 index 0308d7a07f..0000000000 --- a/.github/workflows/add-to-project.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Add to Project - -on: - pull_request_target: - issues: - types: - - opened - - reopened - -jobs: - add-to-project: - name: Add to project - runs-on: ubuntu-latest - steps: - - uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e # v1.0.2 - with: - project-url: https://github.com/orgs/fastapi/projects/2 - github-token: ${{ secrets.PROJECTS_TOKEN }} diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml deleted file mode 100644 index 31c3d73fdc..0000000000 --- a/.github/workflows/deploy-docs.yml +++ /dev/null @@ -1,82 +0,0 @@ -name: Deploy Docs -on: - workflow_run: - workflows: - - Build Docs - types: - - completed - -permissions: - deployments: write - issues: write - pull-requests: write - statuses: write - -jobs: - deploy-docs: - runs-on: ubuntu-latest - steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Set up Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version-file: ".python-version" - - name: Setup uv - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - with: - enable-cache: true - cache-dependency-glob: | - pyproject.toml - uv.lock - - name: Install GitHub Actions dependencies - run: uv sync --locked --no-dev --group github-actions - - name: Deploy Docs Status Pending - run: uv run ./scripts/deploy_docs_status.py - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COMMIT_SHA: ${{ github.event.workflow_run.head_sha }} - RUN_ID: ${{ github.run_id }} - STATE: "pending" - - name: Clean site - run: | - rm -rf ./site - mkdir ./site - - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - path: ./site/ - pattern: docs-site - merge-multiple: true - github-token: ${{ secrets.GITHUB_TOKEN }} - run-id: ${{ github.event.workflow_run.id }} - - name: Deploy to Cloudflare Pages - # hashFiles returns an empty string if there are no files - if: hashFiles('./site/*') - id: deploy - env: - PROJECT_NAME: sqlmodel - BRANCH: ${{ ( github.event.workflow_run.head_repository.full_name == github.repository && github.event.workflow_run.head_branch == 'main' && 'main' ) || ( github.event.workflow_run.head_sha ) }} - uses: cloudflare/wrangler-action@9acf94ace14e7dc412b076f2c5c20b8ce93c79cd # v3.15.0 - with: - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - command: pages deploy ./site --project-name=${{ env.PROJECT_NAME }} --branch=${{ env.BRANCH }} - - name: Deploy Docs Status Error - if: failure() - run: uv run ./scripts/deploy_docs_status.py - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COMMIT_SHA: ${{ github.event.workflow_run.head_sha }} - RUN_ID: ${{ github.run_id }} - STATE: "error" - - name: Comment Deploy - run: uv run ./scripts/deploy_docs_status.py - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - DEPLOY_URL: ${{ steps.deploy.outputs.deployment-url }} - COMMIT_SHA: ${{ github.event.workflow_run.head_sha }} - RUN_ID: ${{ github.run_id }} - STATE: "success" diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml deleted file mode 100644 index 6ba567399b..0000000000 --- a/.github/workflows/labeler.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Labels -on: - pull_request_target: - types: - - opened - - synchronize - - reopened - # For label-checker - - labeled - - unlabeled - -jobs: - labeler: - permissions: - contents: read - pull-requests: write - runs-on: ubuntu-latest - steps: - - uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1 - if: ${{ github.event.action != 'labeled' && github.event.action != 'unlabeled' }} - - run: echo "Done adding labels" - # Run this after labeler applied labels - check-labels: - needs: - - labeler - permissions: - pull-requests: read - runs-on: ubuntu-latest - steps: - - uses: agilepathway/label-checker@c3d16ad512e7cea5961df85ff2486bb774caf3c5 # v1.6.65 - with: - one_of: breaking,security,feature,bug,refactor,upgrade,docs,lang-all,internal - repo_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6180501bbf..473c026346 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,34 +2,43 @@ name: Publish on: release: - types: - - created - workflow_dispatch: - inputs: - debug_enabled: - description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' - required: false - default: 'false' + types: [published] jobs: publish: - runs-on: ubuntu-latest + if: ${{ github.repository == 'Dandelion-Science/sqlmodel' }} permissions: id-token: write - contents: read + contents: write + runs-on: ubuntu-latest + timeout-minutes: 10 steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Set up Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version-file: ".python-version" - - name: Install uv - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - - name: Build distribution - run: uv build - - name: Publish - run: uv publish + - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 + - run: uv build + - uses: softprops/action-gh-release@v2 + with: + files: | + dist/*.whl + dist/*.tar.gz + tag_name: ${{ github.event.release.tag_name }} + - uses: aws-actions/configure-aws-credentials@v6 + with: + aws-region: ${{ vars.AWS_REGION }} + role-to-assume: ${{ vars.ARN_IAM_ROLE_GHA_CORE }} + - name: Get CodeArtifact authorization token + run: | + AWS_CODEARTIFACT_TOKEN=$(aws codeartifact get-authorization-token \ + --domain ${{ vars.CODEARTIFACT_DOMAIN }} \ + --domain-owner ${{ vars.CODEARTIFACT_DOMAIN_OWNER }} \ + --query authorizationToken \ + --output text) + echo "AWS_CODEARTIFACT_TOKEN=$AWS_CODEARTIFACT_TOKEN" >> $GITHUB_ENV + - run: uv publish + env: + UV_PUBLISH_USERNAME: aws + UV_PUBLISH_PASSWORD: ${{ env.AWS_CODEARTIFACT_TOKEN }} + UV_PUBLISH_URL: ${{ vars.CODEARTIFACT_PYPI_STORE_REPOSITORY_URL }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8cce657cec..8ac9663789 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -84,6 +84,38 @@ jobs: path: coverage include-hidden-files: true + test-sqlalchemy-prerelease: + # Run tests against the latest SQLAlchemy pre-release to catch compatibility + # issues early. This job is intentionally not required by alls-green. + runs-on: ubuntu-latest + env: + UV_PYTHON: "3.14" + UV_RESOLUTION: highest + UV_PRERELEASE: allow + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Set up Python + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + with: + python-version: "3.14" + - name: Setup uv + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 + with: + enable-cache: true + cache-dependency-glob: | + pyproject.toml + uv.lock + - name: Install Dependencies + run: uv sync --no-dev --group tests --upgrade-package sqlalchemy + - name: Show SQLAlchemy version + run: uv run python -c "import sqlalchemy; print(f'SQLAlchemy {sqlalchemy.__version__}')" + - run: mkdir coverage + - name: Test + run: uv run bash scripts/test.sh + env: + COVERAGE_FILE: coverage/.coverage.sqlalchemy-prerelease + CONTEXT: sqlalchemy-prerelease + coverage-combine: needs: - test diff --git a/pyproject.toml b/pyproject.toml index 3bc56a16a1..2add5e2515 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ classifiers = [ ] dependencies = [ - "SQLAlchemy >=2.0.14,<2.1.0", + "SQLAlchemy >=2.0.14,<2.2.0", "pydantic>=2.11.0", "typing-extensions>=4.5.0", ] diff --git a/sqlmodel/__init__.py b/sqlmodel/__init__.py index 8e3cdaae3b..ba58041629 100644 --- a/sqlmodel/__init__.py +++ b/sqlmodel/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.0.38" +__version__ = "0.0.38.post1" # Re-export from SQLAlchemy from sqlalchemy.engine import create_engine as create_engine diff --git a/uv.lock b/uv.lock index f82dae8aa1..640d5ddc61 100644 --- a/uv.lock +++ b/uv.lock @@ -1842,7 +1842,7 @@ tests = [ [package.metadata] requires-dist = [ { name = "pydantic", specifier = ">=2.11.0" }, - { name = "sqlalchemy", specifier = ">=2.0.14,<2.1.0" }, + { name = "sqlalchemy", specifier = ">=2.0.14,<2.2.0" }, { name = "typing-extensions", specifier = ">=4.5.0" }, ]