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
14 changes: 14 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: CI/CD

permissions:
contents: read

on:
push:
branches: [ version-0 ]
Expand All @@ -14,6 +17,17 @@ on:
type: string

jobs:
validate-build:
name: Validate build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Build
run: uv build

integration-tests:
name: Python v${{ matrix.python-version }} - Django ${{ matrix.django-version }}
runs-on: ubuntu-latest
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[project]
name = "aurora_dsql_django"
dynamic = ["version"]
dynamic = ["version", "readme"]
description = "Aurora DSQL adapter for Django"
readme = "README.md"
license = {text = "Apache License 2.0"}
authors = [{name = "Amazon Web Services"}]
requires-python = ">=3.8"
Expand Down
35 changes: 35 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import re

from setuptools import setup
from setuptools_scm import get_version

GITHUB_URL = "https://github.com/awslabs/aurora-dsql-django"
version = get_version()

# Use default branch for dev versions, tag for releases.
if "dev" in version:
ref = "version-0"
else:
ref = f"v{version}"

readme_content = open("README.md").read()


def convert_relative_link(match):
link_text = match.group(1)
old_url = match.group(2)
if old_url.startswith("./") or old_url.startswith("../"):
raise ValueError(f"Relative links starting with './' or '../' are not allowed: {old_url}")
new_url = f"{GITHUB_URL}/blob/{ref}/{old_url}"
print(f"Converting: {old_url} -> {new_url}")
return f"[{link_text}]({new_url})"


# Links on PyPI require absolute URLs. Replace relative URLs with absolute ones.
long_description = re.sub(
r"\[([^]]+)]\(((?!https?:)[^)]+)\)",
convert_relative_link,
readme_content,
)

setup(long_description=long_description)