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
9 changes: 0 additions & 9 deletions .github/dependabot.yaml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
"group:allNonMajor",
":maintainLockFilesMonthly",
"schedule:weekly",
":automergeMinor"
],
"labels": ["dependencies"],
"rangeStrategy": "bump"
}
3 changes: 2 additions & 1 deletion .github/workflows/benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ jobs:
python-version: "3.10"
cache: true
- name: Install dependencies
run: pdm install --no-lock
run: pdm install --frozen-lock
- name: Run tests
run: pdm benchmark
- name: Store benchmark result
if: github.event_name != 'pull_request'
uses: benchmark-action/github-action-benchmark@v1
with:
tool: "pytest"
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,27 @@ name: Upload Python Package
on:
release:
types: [published]
workflow_dispatch:

jobs:
deploy:
name: Upload release
name: Upload to PyPI
runs-on: ubuntu-latest
environment:
name: publish
url: https://pypi.org/p/sqlalchemy-sessionload
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write

steps:
- uses: actions/checkout@v4
- name: Setup PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: "3.10"
cache: true
- name: Install dependencies
run: pdm install --frozen-lock
- name: Build
run: pdm build
- name: Publish
run: pdm publish
run: pdm publish --no-build
35 changes: 5 additions & 30 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Setup PDM
Expand All @@ -23,35 +23,10 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: true
- name: Install dependencies
run: pdm install --no-lock
run: pdm install --frozen-lock
- name: Run tests
run: pdm test_14
run: pdm cov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
with:
directory: coverage
files: ./coverage/coverage.xml

Test20:
name: Test SA 2.0
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Setup PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
cache: true
- name: Install nox
run: pip install nox
- name: Run tests
run: pdm test_20
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
directory: coverage
files: ./coverage/coverage_20.xml
token: ${{ secrets.CODECOV_TOKEN }}
30 changes: 10 additions & 20 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,57 +1,47 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.19.0
hooks:
- id: pyupgrade
args:
- --py38-plus
- --py39-plus
- repo: https://github.com/hadialqattan/pycln
rev: v2.4.0
hooks:
- id: pycln
args:
- "--config=pyproject.toml"
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/jvllmr/pyaphid
rev: v0.3.1
hooks:
- id: pyaphid
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- id: black
- repo: https://github.com/adamchainz/blacken-docs
rev: v1.12.1 # replace with latest tag on GitHub
rev: 1.19.1 # replace with latest tag on GitHub
hooks:
- id: blacken-docs
additional_dependencies:
- black
- repo: https://github.com/asottile/yesqa
rev: v1.5.0
hooks:
- id: yesqa
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.9"
rev: "v0.8.0"
hooks:
- id: ruff
args:
- --fix
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
additional_dependencies: [prettier@latest, prettier-plugin-toml@latest]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.8.0"
rev: "v1.13.0"
hooks:
- id: mypy
exclude: ^tests/.*
additional_dependencies:
- "sqlalchemy<2.0"
- "sqlalchemy2-stubs"
- sqlalchemy>=2.0.0
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"python.testing.autoTestDiscoverOnSaveEnabled": true,
"python.terminal.activateEnvInCurrentTerminal": true,
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
"editor.defaultFormatter": "charliermarsh.ruff"
},
"ruff.enable": true,
"mypy-type-checker.preferDaemon": true,
Expand Down
20 changes: 2 additions & 18 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,8 @@

os.environ.update({"PDM_IGNORE_SAVED_PYTHON": "1"})

lib_path = "src/sqlalchemy_sessionload"
coverage_path = "coverage"


@nox.session
def tests(session: nox.Session):
session.run_always("pdm", "install", "--no-lock", external=True)
session.run(
"pytest", f"--cov={lib_path}", f"--cov-report=xml:{coverage_path}/coverage.xml"
)


@nox.session
def tests_20(session: nox.Session):
session.run_always("pdm", "install", "--no-lock", external=True)
session.install("sqlalchemy>2.0")
session.run(
"pytest",
f"--cov={lib_path}",
f"--cov-report=xml:{coverage_path}/coverage_20.xml",
)
session.run_always("pdm", "install", "--frozen-lock", external=True)
session.run("pytest", "--cov", "--cov-report=xml")
Loading