Skip to content
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ jobs:
name: python-package-distributions
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@v1.2.3
uses: sigstore/gh-action-sigstore-python@v3.0.1
with:
inputs: >-
inputs: |
./dist/*.tar.gz
./dist/*.whl
- name: Upload artifact signatures to GitHub Release
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/test_on_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: [ubuntu-22.04]
strategy:
matrix:
sqlalchemy: [ "1.4", "2.0" ]
uv-group: [ "matrix-1-4", "matrix-2-0" ]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

# Service containers to run with `container-job`
Expand Down Expand Up @@ -45,12 +45,13 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.8.0"
- name: Install requirements
# Устанавливаем зависимости
run: pip install -r tests/requirements.txt
- name: Install explicit sqlalchemy
run: pip install sqlalchemy~=${{ matrix.sqlalchemy }}
run: uv sync --locked --group=${{matrix.uv-group}}
- name: Run tests
run: pytest
run: uv run pytest
env:
DATABASE_URI: postgresql://postgres:postgres@localhost:5432/postgres
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ FROM python:latest

COPY ./alembic_postgresql_enum ./alembic_postgresql_enum
COPY ./tests ./tests
COPY ./pyproject.toml ./pyproject.toml
COPY ./uv.lock ./uv.lock
COPY ./README.md ./README.md

WORKDIR ./tests

RUN pip install -r requirements.txt
COPY --from=ghcr.io/astral-sh/uv:0.8.0 /uv /uvx /bin/
RUN uv sync --group matrix-2-0

ENTRYPOINT pytest
ENTRYPOINT uv run pytest
72 changes: 51 additions & 21 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,36 +1,66 @@
[tool.poetry]
[project]
name = "alembic-postgresql-enum"
version = "1.8.0"
description = "Alembic autogenerate support for creation, alteration and deletion of enums"
authors = ["RustyGuard", "AlexandrovRoman"]
license = "MIT"
authors = [
{ name = "RustyGuard" },
{ name = "AlexandrovRoman" },
]
requires-python = ">=3.7.0"
readme = "README.md"
packages = [{ include = "alembic_postgresql_enum" }]
license = "MIT"
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = [
"SQLAlchemy>=1.4",
"alembic>=1.7",
]

[tool.poetry.urls]
[project.urls]
"Source code" = "https://github.com/Pogchamp-company/alembic-postgresql-enum"

[tool.poetry.dependencies]
python = "^3.7"
SQLAlchemy = ">=1.4"
alembic = ">=1.7"
[tool.hatch.build.targets.sdist]
include = ["alembic_postgresql_enum"]

[tool.hatch.build.targets.wheel]
include = ["alembic_postgresql_enum"]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.uv]
conflicts = [
[
{ group = "matrix-1-4" },
{ group = "matrix-2-0" },
],
]

[dependency-groups]
dev = [
"psycopg2-binary>=2.9.9",
"pytest>=7.4.4",
]
matrix-1-4 = [
"alembic>=1.12.1",
"sqlalchemy~=1.4.0",
]
matrix-2-0 = [
"alembic>=1.12.1",
"sqlalchemy~=2.0.0",
]


[tool.black]
line-length = 120
2 changes: 1 addition & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ docker compose up --build --exit-code-from run-tests

## Create database

Start postgres through docker compose:
Start a postgres instance

## Env variables

Expand Down
4 changes: 0 additions & 4 deletions tests/requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion tests/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def get_schema_by_declared_enum_values(target: DeclaredEnumValues) -> MetaData:
*(
_enum_column_factory(target, column_name, enum_name, column_type)
for column_name, enum_name, column_type in columns_with_enum_names
)
),
)

return schema
Loading