Skip to content

Commit bed1e01

Browse files
committed
Use uv with flit-core backend
1 parent 3c42411 commit bed1e01

File tree

9 files changed

+3099
-115
lines changed

9 files changed

+3099
-115
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
version: 2
77
updates:
8-
- package-ecosystem: "pip" # See documentation for possible values
8+
- package-ecosystem: "uv" # See documentation for possible values
99
directory: "/" # Location of package manifests
1010
schedule:
1111
interval: "weekly"

.github/workflows/gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- uses: actions/setup-python@v2
1212
with:
1313
python-version: 3.x
14-
14+
# TODO uv (uv sync --locked --no-dev --group docs)
1515
- run: pip install flit
1616
- run: flit install --only-deps --deps develop
1717
- run: mkdocs gh-deploy --force

.github/workflows/publish-package.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v3
12+
13+
# TODO uv
1214
- name: Set up Python
1315
uses: actions/setup-python@v2
1416
with:

.github/workflows/run-codspeed-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
- name: Check out repository code
4141
uses: actions/checkout@v3
4242

43+
# TODO uv
4344
- name: Install dependencies
4445
run: |
4546
apt update

.github/workflows/run-linting-tests.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,34 @@ jobs:
2020

2121
steps:
2222
- uses: actions/checkout@v3
23-
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v2
23+
24+
- name: Install uv and set the python version
25+
uses: astral-sh/setup-uv@v5
2526
with:
27+
# It is considered best practice to pin to a specific uv version.
28+
version: "0.7.13"
2629
python-version: ${{ matrix.python-version }}
27-
- name: Install dependencies
28-
run: |
29-
python -m pip install --upgrade pip
30-
pip install flit
31-
flit install --deps develop --symlink
30+
31+
- name: Install the project
32+
run: uv sync --locked --all-extras --dev
33+
3234
- name: Check with mypy
33-
run: |
34-
mypy .
35+
run: uv run mypy .
36+
37+
# - name: Set up Python ${{ matrix.python-version }}
38+
# uses: actions/setup-python@v2
39+
# with:
40+
# python-version: ${{ matrix.python-version }}
41+
#
42+
# - name: Install dependencies
43+
# run: |
44+
# python -m pip install --upgrade pip
45+
# pip install flit
46+
# flit install --deps develop --symlink
47+
#
48+
# - name: Check with mypy
49+
# run: |
50+
# mypy .
51+
3552
- name: Run remaining pre-commit hooks
3653
uses: pre-commit/[email protected]

.github/workflows/run-unit-tests.yml

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
python-version: ['3.11', '3.12', '3.13']
1515
postgres-version: ['15', '16', '17']
1616
fail-fast: false
17-
container: python:${{ matrix.python-version }}-slim
17+
# container: python:${{ matrix.python-version }}-slim
1818
services:
1919
postgres:
2020
image: postgres:${{ matrix.postgres-version }}-alpine
@@ -38,28 +38,47 @@ jobs:
3838
--health-timeout 5s
3939
--health-retries 5
4040
steps:
41-
# Downloads a copy of the code in your repository before running CI tests
4241
- name: Check out repository code
4342
uses: actions/checkout@v3
4443

45-
- name: Install dependencies
46-
run: |
47-
apt update
48-
apt install curl git build-essential libpq-dev libffi-dev -y
49-
python -m pip install --upgrade pip
50-
pip install flit
51-
flit install --deps develop --symlink
52-
echo "GIT_COMMIT_HASH=\"test\"" > orchestrator/version.py
53-
env:
54-
FLIT_ROOT_INSTALL: 1
55-
- name: Run Unit tests
56-
run: CACHE_URI=redis://redis DATABASE_URI=postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST/$POSTGRES_DB pytest --cov-branch --cov=orchestrator --cov-report=xml --ignore=test --ignore=orchestrator/devtools --ignore=examples --ignore=docs --ignore=orchestrator/vendor
44+
- name: Install uv and set the python version
45+
uses: astral-sh/setup-uv@v5
46+
with:
47+
# It is considered best practice to pin to a specific uv version.
48+
version: "0.7.13"
49+
python-version: ${{ matrix.python-version }}
50+
51+
- name: Install the project
52+
run: uv sync --locked --all-extras --dev
53+
54+
- name: Run tests
55+
run: CACHE_URI=redis://redis DATABASE_URI=postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST/$POSTGRES_DB uv run pytest --cov-branch --cov=orchestrator --cov-report=xml --ignore=test --ignore=orchestrator/devtools --ignore=examples --ignore=docs
5756
env:
5857
POSTGRES_DB: orchestrator-core-test
5958
POSTGRES_USER: nwa
6059
POSTGRES_PASSWORD: nwa
6160
POSTGRES_HOST: postgres
6261
ENVIRONMENT: TESTING
62+
63+
# - name: Install dependencies
64+
# run: |
65+
# apt update
66+
# apt install curl git build-essential libpq-dev libffi-dev -y
67+
# python -m pip install --upgrade pip
68+
# pip install flit
69+
# flit install --deps develop --symlink
70+
# echo "GIT_COMMIT_HASH=\"test\"" > orchestrator/version.py
71+
# env:
72+
# FLIT_ROOT_INSTALL: 1
73+
74+
# - name: Run Unit tests
75+
# run: CACHE_URI=redis://redis DATABASE_URI=postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST/$POSTGRES_DB pytest --cov-branch --cov=orchestrator --cov-report=xml --ignore=test --ignore=orchestrator/devtools --ignore=examples --ignore=docs --ignore=orchestrator/vendor
76+
# env:
77+
# POSTGRES_DB: orchestrator-core-test
78+
# POSTGRES_USER: nwa
79+
# POSTGRES_PASSWORD: nwa
80+
# POSTGRES_HOST: postgres
81+
# ENVIRONMENT: TESTING
6382
- name: "Upload coverage to Codecov"
6483
uses: codecov/codecov-action@v3
6584
with:

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ RUN apt-get update \
55
&& apt-get install -y --no-install-recommends git build-essential \
66
&& rm -rf /var/lib/apt/lists/*
77
COPY . .
8+
# TODO uv
89
RUN pip install --upgrade pip --no-cache-dir
910
RUN pip install build --no-cache-dir
1011
RUN python -m build --wheel --outdir dist

pyproject.toml

Lines changed: 89 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,143 +1,142 @@
1-
# See: https://stackoverflow.com/questions/69711606/how-to-install-a-package-using-pip-in-editable-mode-with-pyproject-toml
2-
[build-system]
3-
build-backend = "flit_core.buildapi"
4-
requires = ["flit_core >=3.2,<4"]
5-
61
[project]
72
name = "orchestrator-core"
8-
dynamic = ['version', 'description']
9-
author = "SURF"
10-
author-email = "[email protected]"
11-
home-page = "https://github.com/workfloworchestrator/orchestrator-core"
3+
dynamic = ["version", "description"]
4+
readme = "README.md"
5+
license = "Apache-2.0"
6+
license-files = ["LICENSE"]
7+
authors = [
8+
{ name = "SURF", email = "[email protected]" }
9+
]
10+
requires-python = ">=3.11,<3.14"
1211
classifiers = [
12+
"Development Status :: 5 - Production/Stable",
13+
"Environment :: Web Environment",
14+
"Framework :: AsyncIO",
15+
"Framework :: FastAPI",
16+
"Intended Audience :: Developers",
1317
"Intended Audience :: Information Technology",
1418
"Intended Audience :: System Administrators",
19+
"Intended Audience :: Telecommunications Industry",
1520
"Operating System :: OS Independent",
21+
"Programming Language :: Python :: 3 :: Only",
1622
"Programming Language :: Python :: 3",
23+
"Programming Language :: Python :: 3.11",
24+
"Programming Language :: Python :: 3.12",
25+
"Programming Language :: Python :: 3.13",
1726
"Programming Language :: Python",
27+
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
28+
"Topic :: Internet :: WWW/HTTP",
1829
"Topic :: Internet",
1930
"Topic :: Software Development :: Libraries :: Application Frameworks",
2031
"Topic :: Software Development :: Libraries :: Python Modules",
2132
"Topic :: Software Development :: Libraries",
2233
"Topic :: Software Development",
2334
"Typing :: Typed",
24-
"Development Status :: 5 - Production/Stable",
25-
"Environment :: Web Environment",
26-
"Framework :: AsyncIO",
27-
"Framework :: FastAPI",
28-
"Intended Audience :: Developers",
29-
"Intended Audience :: Telecommunications Industry",
30-
"License :: OSI Approved :: Apache Software License",
31-
"Programming Language :: Python :: 3 :: Only",
32-
"Programming Language :: Python :: 3.13",
33-
"Programming Language :: Python :: 3.12",
34-
"Programming Language :: Python :: 3.11",
35-
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
36-
"Topic :: Internet :: WWW/HTTP",
3735
]
3836
dependencies = [
3937
"alembic==1.16.1",
4038
"anyio>=3.7.0",
4139
"click==8.*",
42-
"deprecated",
4340
"deepmerge==2.0",
41+
"deprecated>=1.2.18",
4442
"fastapi~=0.115.2",
4543
"fastapi-etag==0.4.0",
44+
"itsdangerous>=2.2.0",
45+
"jinja2==3.1.6",
4646
"more-itertools~=10.7.0",
47-
"itsdangerous",
48-
"Jinja2==3.1.6",
47+
"nwa-stdlib~=1.9.0",
48+
"oauth2-lib~=2.4.0",
4949
"orjson==3.10.18",
5050
"prometheus-client==0.22.0",
5151
"psycopg2-binary==2.9.10",
52-
"pydantic[email]~=2.8.2",
52+
"pydantic-forms>=1.4.0,<=2.1.0",
5353
"pydantic-settings~=2.9.1",
54+
"pydantic[email]~=2.8.2",
5455
"python-dateutil==2.8.2",
5556
"python-rapidjson>=1.18,<1.21",
5657
"pytz==2025.2",
5758
"redis==5.1.1",
5859
"schedule==1.1.0",
5960
"semver==3.0.4",
6061
"sentry-sdk[fastapi]~=2.29.1",
61-
"SQLAlchemy==2.0.41",
62-
"SQLAlchemy-Utils==0.41.2",
63-
"structlog",
62+
"sqlalchemy==2.0.41",
63+
"sqlalchemy-utils==0.41.2",
64+
"strawberry-graphql>=0.246.2",
65+
"structlog>=25.4.0",
66+
"tabulate==0.9.0",
6467
"typer==0.15.4",
6568
"uvicorn[standard]~=0.34.0",
66-
"nwa-stdlib~=1.9.0",
67-
"oauth2-lib~=2.4.0",
68-
"tabulate==0.9.0",
69-
"strawberry-graphql>=0.246.2",
70-
"pydantic-forms>=1.4.0, <=2.1.0",
7169
]
7270

73-
description-file = "README.md"
74-
requires-python = ">=3.11,<3.14"
75-
7671
[project.urls]
77-
Documentation = "https://workfloworchestrator.org/orchestrator-core/"
72+
Documentation = "https://workfloworchestrator.org/orchestrator-core"
73+
Homepage = "https://workfloworchestrator.org/orchestrator-core"
7874
Source = "https://github.com/workfloworchestrator/orchestrator-core"
7975

76+
# Published optional dependencies, or "extras"
8077
[project.optional-dependencies]
8178
celery = [
82-
"celery~=5.5.1"
79+
"celery~=5.5.1",
8380
]
8481

85-
test = [
86-
"apache-license-check",
87-
"black",
88-
"blinker",
89-
"deepdiff",
90-
"dirty-equals",
91-
"jsonref",
82+
# Local dependencies for development
83+
[dependency-groups]
84+
docs = [
85+
"mkdocs>=1.6.1",
86+
"mkdocs-embed-external-markdown>=3.0.2",
87+
"mkdocs-include-markdown-plugin>=7.1.6",
88+
"mkdocs-macros-plugin>=1.3.7",
89+
"mkdocs-material[imaging]>=9.6.14",
90+
"mkdocs-open-in-new-tab>=1.0.8",
91+
"mkdocs-render-swagger-plugin>=0.1.2",
92+
"mkdocstrings[python]>=0.29.1",
93+
]
94+
dev = [
95+
"apache-license-check>=1.0.0",
96+
"black>=25.1.0",
97+
"blinker>=1.9.0",
98+
"deepdiff>=8.5.0",
99+
"dirty-equals>=0.9.0",
100+
"jsonref>=1.1.0",
92101
"mypy==1.9",
93-
"pyinstrument",
102+
"mypy-extensions>=1.1.0",
103+
"pre-commit>=4.2.0",
104+
"pydocstyle>=6.3.0",
105+
"pyinstrument>=5.0.2",
94106
"pytest==8.3.5",
95107
"pytest-asyncio==0.21.2",
96-
"pytest-codspeed",
97-
"pytest-cov",
98-
"pytest-httpx",
99-
"pytest-xdist",
100-
"requests-mock",
101-
"ruff",
102-
"sqlalchemy[mypy]",
103-
"urllib3-mock",
104-
"types-Deprecated",
105-
"types-Jinja2",
106-
"types-aiofiles",
107-
"types-certifi",
108-
"types-click",
109-
"types-itsdangerous",
110-
"types-orjson",
111-
"types-python-dateutil",
112-
"types-pytz",
113-
"types-redis",
114-
"types-requests",
115-
"types-setuptools",
116-
"types-tabulate",
117-
"types-toml",
118-
"types-ujson",
119-
"types-PyYAML",
120-
]
121-
doc = [
122-
"mkdocs",
123-
"mkdocs-material[imaging]",
124-
"mkdocs-render-swagger-plugin",
125-
"mkdocs-include-markdown-plugin",
126-
"mkdocstrings[python]",
127-
"mkdocs-open-in-new-tab",
128-
"mkdocs-macros-plugin",
129-
"mkdocs-embed-external-markdown"
130-
]
131-
dev = [
132-
"toml",
133-
"bumpversion",
134-
"mypy_extensions",
135-
"pre-commit",
136-
"pydocstyle",
137-
"python-dotenv",
138-
"watchdog",
108+
"pytest-codspeed>=3.2.0",
109+
"pytest-cov>=6.2.1",
110+
"pytest-httpx>=0.29.0",
111+
"pytest-xdist>=3.7.0",
112+
"requests-mock>=1.12.1",
113+
"ruff>=0.12.0",
114+
"sqlalchemy[mypy]>=2.0.41",
115+
"toml>=0.10.2",
116+
"types-aiofiles>=24.1.0.20250606",
117+
"types-certifi>=2021.10.8.3",
118+
"types-click>=7.1.8",
119+
"types-deprecated>=1.2.15.20250304",
120+
"types-itsdangerous>=1.1.6",
121+
"types-jinja2>=2.11.9",
122+
"types-orjson>=3.6.2",
123+
"types-python-dateutil>=2.9.0.20250516",
124+
"types-pytz>=2025.2.0.20250516",
125+
"types-pyyaml>=6.0.12.20250516",
126+
"types-redis>=4.6.0.20241004",
127+
"types-requests>=2.32.4.20250611",
128+
"types-setuptools>=80.9.0.20250529",
129+
"types-tabulate>=0.9.0.20241207",
130+
"types-toml>=0.10.8.20240310",
131+
"types-ujson>=5.10.0.20250326",
132+
"urllib3-mock>=0.3.3",
133+
"watchdog>=6.0.0",
139134
]
140135

136+
[build-system]
137+
requires = ["flit_core>=3.2,<4"]
138+
build-backend = "flit_core.buildapi"
139+
141140
[tool.flit.module]
142141
name = "orchestrator"
143142

0 commit comments

Comments
 (0)