Skip to content

Commit 7b9df36

Browse files
committed
Centralize Python dependency and tooling configuration by introducing a uv workspace in apps.
It consolidates Python version pinning, dev tools, and lockfile management, and updates CI to run checks at the workspace level. It also removes redundant per-project .python-version files.
1 parent a868a49 commit 7b9df36

File tree

53 files changed

+2936
-3830
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2936
-3830
lines changed

.github/workflows/ci-python.yml

Lines changed: 38 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
paths:
66
- "**/*.py"
7-
- "**/*requirement*.txt"
7+
- "**/pyproject.toml"
88
- "**/uv.lock"
99
- ".github/workflows/ci-python.yml"
1010

@@ -13,65 +13,57 @@ on:
1313
env:
1414
BASE_COMMIT: ""
1515
GH_TOKEN: ${{ github.token }}
16+
# Pin tool versions to match workspace configuration
17+
PYTHON_VERSION: "3.13"
18+
UV_VERSION: "0.5.18"
1619

1720
jobs:
18-
matrix-pytest:
21+
workspace-checks:
22+
name: Workspace Tests & Checks
1923
runs-on: ubuntu-24.04
20-
strategy:
21-
matrix:
22-
projects: [
23-
{
24-
projectName: "sftp-outbound-transfer-lambda",
25-
projectRoot: "ops/services/02-eft/lambda_src/sftp_outbound_transfer",
26-
testsRoot: "ops/services/02-eft/lambda_src/sftp_outbound_transfer/tests",
27-
uvCommand: "uv sync",
28-
pytestCommand: "uv run pytest",
29-
pythonVersion: "3.13",
30-
},
31-
{
32-
projectName: "locust",
33-
projectRoot: "apps/utils/locust_tests",
34-
testsRoot: "apps/utils/locust_tests",
35-
uvCommand: "uv sync --group lambda-run-locust",
36-
# no tests
37-
pytestCommand: "echo 'no tests'",
38-
pythonVersion: "3.13",
39-
},
40-
{
41-
projectName: "idr-pipeline",
42-
projectRoot: "apps/bfd-pipeline/bfd-pipeline-idr",
43-
testsRoot: "apps/bfd-pipeline/bfd-pipeline-idr",
44-
uvCommand: "uv sync",
45-
pytestCommand: "uv run pytest",
46-
pythonVersion: "3.13",
47-
},
48-
]
49-
fail-fast: false
5024
steps:
5125
- name: Checkout code
5226
id: code-checkout
5327
uses: actions/checkout@v4
5428
with:
5529
ref: ${{ inputs.branch }}
56-
# Maven is needed to run the migrator
30+
31+
# Maven is needed to run the migrator for bfd-pipeline-idr tests
5732
- name: "Setup JDK"
5833
uses: actions/setup-java@v4
5934
with:
6035
java-version: "25"
6136
distribution: "corretto"
62-
- uses: astral-sh/setup-uv@v6
63-
- name: Run Python Tests per project
64-
id: run-pytest-set
37+
38+
- name: Setup uv
39+
uses: astral-sh/setup-uv@v6
40+
with:
41+
version: ${{ env.UV_VERSION }}
42+
43+
- name: Set up Python
44+
run: uv python install ${{ env.PYTHON_VERSION }}
45+
46+
- name: Install workspace dependencies
47+
run: |
48+
cd ${{ github.workspace }}/apps
49+
uv sync --all-groups
50+
51+
- name: Run linting (ruff check)
6552
run: |
66-
echo "Testing ${{ matrix.projects.projectName }}"
67-
cd ${{ github.workspace }}/${{ matrix.projects.projectRoot }}
68-
uv python install
69-
${{ matrix.projects.uvCommand }}
70-
# check linting
53+
cd ${{ github.workspace }}/apps
7154
uv run ruff check
72-
# check formatting
55+
56+
- name: Run formatting check (ruff format)
57+
run: |
58+
cd ${{ github.workspace }}/apps
7359
uv run ruff format --check
74-
# check types
75-
uv run pyright .
76-
# tests
77-
${{ matrix.projects.pytestCommand }} ${{ github.workspace }}/${{ matrix.projects.testsRoot }}
60+
61+
- name: Run type checking (pyright)
62+
run: |
63+
cd ${{ github.workspace }}/apps
64+
uv run pyright
65+
66+
- name: Run tests (pytest)
67+
run: |
68+
cd ${{ github.workspace }}/apps
69+
uv run pytest

apps/bfd-pipeline/bfd-pipeline-idr/.python-version renamed to .python-version

File renamed without changes.

apps/bfd-model-idr/pyproject.toml

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,60 +3,9 @@ name = "generator"
33
version = "0.1.0"
44
description = "Add your description here"
55
readme = "README.md"
6-
requires-python = ">=3.13"
76
dependencies = [
87
"faker>=37.1.0",
98
"pandas>=2.2.3",
109
"xlsxwriter>=3.2.5",
1110
"pyyaml>=6.0.2",
1211
]
13-
14-
[dependency-groups]
15-
dev = ["ruff>=0.12.9", "uv>=0.8.10", "pyright>=1.1.403"]
16-
17-
[tool.ruff]
18-
# Set the maximum line length to 100.
19-
line-length = 100
20-
21-
[tool.ruff.lint]
22-
select = [
23-
"D", # pydocstyle
24-
"E501",
25-
# pycodestyle
26-
"E",
27-
# Pyflakes
28-
"F",
29-
# pyupgrade
30-
"UP",
31-
# flake8-bugbear
32-
"B",
33-
# flake8-simplify
34-
"SIM",
35-
# isort
36-
"I",
37-
# "ANN",
38-
"LOG",
39-
"G",
40-
"PT",
41-
"RSE",
42-
"PIE",
43-
"RET",
44-
"SLF",
45-
"ARG",
46-
"PTH",
47-
"PLE",
48-
"PLW",
49-
"PERF",
50-
"FURB",
51-
"RUF",
52-
]
53-
# Don't require docstrings
54-
ignore = ["D100", "D101", "D102", "D103", "D104", "D105", "D107"]
55-
56-
[tool.ruff.lint.pydocstyle]
57-
convention = "pep257"
58-
59-
[tool.ruff.format]
60-
quote-style = "double"
61-
indent-style = "space"
62-
docstring-code-format = true

0 commit comments

Comments
 (0)