Files
Reinier van der LeerandClaude Opus 4.5 1ab5acd5af fix: Make CI Green Again (#2)
- Drop Python 3.9 support
- Add Python 3.13 support
- Update URLs in docs where relevant (e.g.
`RobertCraigie/prisma-client-py/issues` ->
`Significant-Gravitas/prisma-client-py/issues`)

CI:
- Fix `pip` caching in CI jobs
- Update `actions/upload-artifact@v3` to v6
- Update `actions/cache@v3` to v5
- Update `actions/download-artifact@v3` to v4
- Update `geekyeggo/delete-artifact@v2` to v5
- Upgrade test `Dockerfile` base image to `python:3.12-slim-bookworm`

Code & Dependencies:
- Upgrade `click` to `>=8.2.0`
  - Fix resulting type/deprecation errors
- Upgrade `typer` to `>=0.15.0`
- Upgrade `rtoml` to `==0.13.0`
- Upgrade `mypy` to `==1.19.1`
  - Fix typing issues in `prisma._sync_http` and `prisma._async_http`
  - Fix typing issues in `prisma.cli.commands.dev`
- Upgrade `pyright` to `==1.1.408`
  - Update type error snapshots
- Update tests to work with newer environment

## Checklist

- [x] Unit tests for the changes exist
- [x] Tests pass without significant drop in coverage
- [x] Documentation reflects changes where applicable
- [x] Test snapshots have been
[updated](https://prisma-client-py.readthedocs.io/en/latest/contributing/contributing/#snapshot-tests)
if applicable

## Agreement

By submitting this pull request, I confirm that you can use, modify,
copy and redistribute this contribution, under the terms of your choice.

---------

Co-authored-by: Claude Opus 4.5 <[email protected]>
2026-01-12 18:40:06 +01:00

67 lines
2.1 KiB
Python

import re
from pathlib import Path
from prisma import config
ROOTDIR = Path(__file__).parent.parent
DOCS_DIR = ROOTDIR / 'docs'
SHOWCASE_GIF = 'https://raw.githubusercontent.com/Significant-Gravitas/prisma-client-py/main/docs/showcase.gif'
# TODO: make this nicer
def main() -> None:
# TODO: this should be a mkdocs plugin
# then we don't have to run this every time the README is updated
# and remove docs/index.md from version control
content = ROOTDIR.joinpath('README.md').read_text()
if SHOWCASE_GIF not in content:
raise RuntimeError('Could not find showcase GIF in README, has it been updated?')
content, n = re.subn(
r'(<img src="https:\/\/img\.shields\.io\/static\/v1\?label=prisma&message)=(\d?.)+(&color=blue&logo=prisma" alt="Supported Prisma version is) (\d?.)+">',
r'\1=' + config.prisma_version + r'\3 ' + config.prisma_version + '">',
content,
)
assert n > 0, "Didn't make any replacements"
ROOTDIR.joinpath('README.md').write_text(content)
content = re.sub(r'\(docs(\/.*)\.md(#.*)?\)', r'(\1/\2)', content)
content = content.replace(SHOWCASE_GIF, './showcase.gif')
ROOTDIR.joinpath('docs/index.md').write_text(content)
# update the referenced PRISMA_VERSION to the latest version we support
binaries_doc = DOCS_DIR / 'reference' / 'binaries.md'
assert binaries_doc.exists()
content = binaries_doc.read_text()
content = re.sub(
r'(git clone https://github.com/prisma/prisma-engines --branch)=(\d+\.\d+\.\d+)',
r'\1' + '=' + config.prisma_version,
content,
)
binaries_doc.write_text(content)
# ensure all config defaults are up to date
config_doc = DOCS_DIR / 'reference' / 'config.md'
assert config_doc.exists()
content = config_doc.read_text()
content = re.sub(
r'(`PRISMA_VERSION` \| )`(.*)`',
r'\1' + '`' + config.prisma_version + '`',
content,
)
content = re.sub(
r'(`PRISMA_EXPECTED_ENGINE_VERSION` \| )`(.*)`',
r'\1' + '`' + config.expected_engine_version + '`',
content,
)
config_doc.write_text(content)
if __name__ == '__main__':
main()