Skip to content

Commit 6725ccc

Browse files
committed
Add pixi and configure ci to run with pixi
RFDAP-8594
1 parent cf60225 commit 6725ccc

22 files changed

Lines changed: 4673 additions & 321 deletions

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,5 @@ Doxyfile text
5656
*.pyc binary
5757
*.pyd binary
5858
*.pyo binary
59+
# SCM syntax highlighting & preventing 3-way merges
60+
pixi.lock merge=binary linguist-language=YAML linguist-generated=true

.github/workflows/main.yml

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,55 +11,61 @@ on:
1111
pull_request:
1212

1313
jobs:
14-
build:
14+
test:
1515

1616
runs-on: ${{ matrix.os }}
1717

1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
21+
python: ["310", "311", "312", "313"]
22+
sqlalchemy: ["14"]
2223
os: [ubuntu-latest, windows-latest]
2324

2425
steps:
2526
- uses: actions/checkout@v1
26-
- name: Set up Python
27-
uses: actions/setup-python@v2
27+
- uses: prefix-dev/setup-pixi@v0.9.1
2828
with:
29-
python-version: ${{ matrix.python }}
30-
- name: Install tox
31-
run: |
32-
python -m pip install --upgrade pip
33-
python -m pip install tox tox-gh-actions
34-
- name: Test with tox
35-
run: tox
29+
pixi-version: v0.49.0
30+
- name: Test
31+
run: pixi run -e py${{ matrix.python }}-sqla${{ matrix.sqlalchemy }} test-cov
3632
- name: Upload codecov
3733
uses: codecov/codecov-action@v3
3834
with:
3935
token: ${{ secrets.CODECOV_TOKEN }}
4036
fail_ci_if_error: true
4137

38+
lint:
39+
40+
runs-on: ubuntu-latest
41+
42+
strategy:
43+
fail-fast: false
44+
45+
steps:
46+
- uses: actions/checkout@v1
47+
- uses: prefix-dev/setup-pixi@v0.9.1
48+
with:
49+
pixi-version: v0.49.0
50+
- name: Test
51+
run: pixi run lint
52+
4253
deploy:
4354

4455
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
4556

4657
runs-on: ubuntu-latest
4758

48-
needs: build
59+
needs: test
4960

5061
steps:
5162
- uses: actions/checkout@v2
52-
- name: Set up Python
53-
uses: actions/setup-python@v2
63+
- uses: prefix-dev/setup-pixi@v0.9.1
5464
with:
55-
python-version: "3.10"
56-
- name: Install wheel
57-
run: |
58-
python -m pip install --upgrade pip
59-
pip install wheel
65+
pixi-version: v0.49.0
6066
- name: Build package
6167
run: |
62-
python setup.py sdist bdist_wheel
68+
pixi run -e build build
6369
- name: Publish package to PyPI
6470
uses: pypa/gh-action-pypi-publish@release/v1
6571
with:

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,9 @@ environment.yml
7070

7171
# mypy
7272
.mypy_cache/
73+
# pixi environments
74+
.pixi/*
75+
!.pixi/config.toml
76+
77+
# Generated version file
78+
src/serialchemy/_version.py

pixi.lock

Lines changed: 4447 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pixi.toml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
[workspace]
2+
authors = ["ESSS <foss@esss.co>"]
3+
channels = ["conda-forge"]
4+
name = "serialchemy"
5+
platforms = ["linux-64", "win-64"]
6+
7+
[tasks]
8+
test="pytest"
9+
test-cov="pytest --cov=src/serialchemy --cov-report=xml"
10+
setup="pre-commit install -f"
11+
lint="pre-commit run --all --show-diff-on-failure"
12+
build="python -m build"
13+
14+
[feature.test.dependencies]
15+
pytest="*"
16+
pytest-cov="*"
17+
pytest-datadir="*"
18+
pytest-mock=">=1.10"
19+
pytest-regressions=">=1.0.0"
20+
pytest-freezegun=">=0.4.2"
21+
sqlalchemy-utc=">=0.10"
22+
sqlalchemy-utils=">=0.33"
23+
24+
[feature.lint.dependencies]
25+
black=">=19.3b0"
26+
mypy="*"
27+
pre-commit="*"
28+
29+
[feature.build.pypi-dependencies]
30+
build="*"
31+
32+
[feature.python310.dependencies]
33+
python="3.10.*"
34+
35+
[feature.python311.dependencies]
36+
python="3.11.*"
37+
38+
[feature.python312.dependencies]
39+
python="3.12.*"
40+
41+
[feature.python313.dependencies]
42+
python="3.13.*"
43+
44+
[feature.sqla14.dependencies]
45+
sqlalchemy="1.4.*"
46+
47+
[feature.sqla20.dependencies]
48+
sqlalchemy="2.0.*"
49+
50+
51+
[environments]
52+
default = { features=["python310", "sqla14", "test", "lint", "build"]}
53+
build = { features=["python312", "build"]}
54+
55+
py310-sqla14 = { features=["test", "python310", "sqla14"]}
56+
py310-sqla20 = { features=["test", "python310", "sqla20"]}
57+
58+
py311-sqla14 = { features=["test", "python311", "sqla14"]}
59+
py311-sqla20 = { features=["test", "python311", "sqla20"]}
60+
61+
py312-sqla14 = { features=["test", "python312", "sqla14"]}
62+
py312-sqla20 = { features=["test", "python312", "sqla20"]}
63+
64+
py313-sqla14 = { features=["test", "python313", "sqla14"]}
65+
py313-sqla20 = { features=["test", "python313", "sqla20"]}

pyproject.toml

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,63 @@
11
[build-system]
22
requires = [
3-
"setuptools>=45",
4-
"setuptools_scm[toml]>=6.2",
3+
"setuptools>=77.0.3",
4+
"setuptools_scm[toml]>=8",
55
"wheel",
66
]
77
build-backend = "setuptools.build_meta"
88

9+
[tool.setuptools.packages.find]
10+
where = ["src"]
11+
912
[tool.setuptools_scm]
10-
git_describe_command = "git describe --dirty --tags --long --exclude RFDAP*"
13+
version_file = "src/serialchemy/_version.py"
14+
15+
[tool.setuptools_scm.scm.git]
16+
pre_parse = "fail_on_missing_submodules"
17+
describe_command = "git describe --dirty --tags --long --match v*"
18+
19+
20+
[project]
21+
name = "serialchemy"
22+
dynamic = ["version"]
23+
authors = [
24+
{ name="ESSS", email="foss@esss.co" },
25+
]
26+
description = "Serializers for SQLAlchemy models."
27+
readme = "README.rst"
28+
keywords=["serialchemy", "serializer", "sqlalchemy"]
29+
requires-python = ">=3.10"
30+
classifiers = [
31+
"Development Status :: 3 - Alpha",
32+
"Intended Audience :: Developers",
33+
"Programming Language :: Python :: 3.10",
34+
"Programming Language :: Python :: 3.11",
35+
"Programming Language :: Python :: 3.12",
36+
"Programming Language :: Python :: 3.13",
37+
]
38+
license = "MIT"
39+
license-files = ["LICEN[CS]E*"]
40+
dependencies = ["sqlalchemy>=1.4,<2.0"]
41+
42+
[project.optional-dependencies]
43+
docs=["sphinx >= 1.4", "sphinx_rtd_theme", "sphinx-autodoc-typehints", "typing_extensions"]
44+
testing=[
45+
"codecov",
46+
"mypy",
47+
"pytest",
48+
"pytest-cov",
49+
"pytest-regressions",
50+
"pytest-freezegun",
51+
"pre-commit",
52+
"setuptools",
53+
"sqlalchemy_utils",
54+
"tox",
55+
]
56+
57+
[project.urls]
58+
Repository = "https://github.com/ESSS/serialchemy"
59+
Issues = "https://github.com/ESSS/serialchemy/issues"
60+
1161

1262
[tool.black]
1363
line-length = 100

setup.py

Lines changed: 0 additions & 56 deletions
This file was deleted.

src/serialchemy/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
from .enum_field import EnumKeyField
22
from .field import Field
33
from .model_serializer import ModelSerializer
4-
from .nested_fields import (
5-
NestedAttributesField, NestedModelField, NestedModelListField, PrimaryKeyField)
4+
from .nested_fields import NestedAttributesField
5+
from .nested_fields import NestedModelField
6+
from .nested_fields import NestedModelListField
7+
from .nested_fields import PrimaryKeyField
68
from .polymorphic_serializer import PolymorphicModelSerializer
7-
from .serializer import ColumnSerializer, Serializer
9+
from .serializer import ColumnSerializer
10+
from .serializer import Serializer

0 commit comments

Comments
 (0)