Skip to content

Commit 5348cbd

Browse files
authored
Python upgrade to 3.11; urllib3, boto3, and qs version bump (#382)
* fix: Provide version bumps for CVEs * docs: update CHANGELOG * fix!: Upgrade to Python 3.11 * fix: change uv install to not use system for PEP 668 * fix: conditionally run validate.sh * fix: module checks github with uv * fix: uv directory pytest fix * docs: update CHANGELOG * fix: add multiple versions to ci matrix * fix: upgrade codebuild image version * fix: remove testing 3.9 and 3.13
1 parent accba08 commit 5348cbd

48 files changed

Lines changed: 185 additions & 5264 deletions

File tree

Some content is hidden

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

.github/workflows/module-checks-dev-requirements-change.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ jobs:
4646
fail-fast: false
4747
matrix:
4848
modules: ${{ fromJson(needs.get-modules.outputs.matrix) }}
49-
python-version: [3.9]
49+
python-version: ["3.11"]
5050
node-version: [18.x]
5151
runs-on: ubuntu-latest
5252
env:
5353
MODULE_PATH: 'modules/${{ matrix.modules.module_name }}'
5454
steps:
5555
- name: Checkout
56-
uses: actions/checkout@v3
56+
uses: actions/checkout@v4
5757
with:
5858
fetch-depth: 0
5959
- id: determine-language
@@ -67,10 +67,17 @@ jobs:
6767
elif [ -f $MODULE_PATH/pyproject.toml ]; then \
6868
echo "language=python" >> "$GITHUB_OUTPUT"; \
6969
fi
70-
- name: Set up Python ${{ matrix.python-version }}
71-
uses: actions/setup-python@v4
70+
- name: Set up uv
71+
if: ${{ steps.determine-language.outputs.language == 'python' }}
72+
uses: astral-sh/setup-uv@v5
7273
with:
73-
python-version: ${{ matrix.python-version }}
74+
enable-cache: true
75+
- name: Set up Python ${{ matrix.python-version }}
76+
if: ${{ steps.determine-language.outputs.language == 'python' }}
77+
run: uv python install ${{ matrix.python-version }}
78+
- name: Create virtual environment
79+
if: ${{ steps.determine-language.outputs.language == 'python' }}
80+
run: uv venv --python ${{ matrix.python-version }}
7481
- name: Set up Node ${{ matrix.node-version }}
7582
uses: actions/setup-node@v4
7683
with:
@@ -79,20 +86,23 @@ jobs:
7986
if: ${{ steps.determine-language.outputs.language == 'python' }}
8087
run: |
8188
set -x
82-
python -m pip install --upgrade pip
83-
pip install -r requirements-dev.txt
84-
pip install -r $MODULE_PATH/requirements.txt
89+
uv pip install -r requirements-dev.txt
90+
uv pip install -r $MODULE_PATH/requirements.txt
8591
- name: Install Requirements (Typescript)
8692
if: ${{ steps.determine-language.outputs.language == 'typescript' }}
8793
run: |
8894
set -x
8995
cd $MODULE_PATH
9096
npm install
91-
- name: Static checks and linting
92-
run: scripts/validate.sh --language ${{ steps.determine-language.outputs.language }} --path $MODULE_PATH/
97+
- name: Static checks and linting (Python)
98+
if: ${{ steps.determine-language.outputs.language == 'python' }}
99+
run: uv run scripts/validate.sh --language python --path $MODULE_PATH/
100+
- name: Static checks and linting (TypeScript)
101+
if: ${{ steps.determine-language.outputs.language == 'typescript' }}
102+
run: ./scripts/validate.sh --language typescript --path $MODULE_PATH/
93103
- name: Pytest
94104
if: ${{ steps.determine-language.outputs.language == 'python' }}
95-
run: cd $MODULE_PATH/ && pytest
105+
run: uv run --no-project --directory $MODULE_PATH pytest
96106
- name: NPM Test
97107
if: ${{ steps.determine-language.outputs.language == 'typescript' }}
98108
run: cd $MODULE_PATH/ && npm test

.github/workflows/module-checks.yml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,20 @@ jobs:
5858
echo 'EOF' >> $GITHUB_OUTPUT
5959
6060
test:
61-
name: Run unit tests for module ${{ matrix.modules.module_name }}
61+
name: Run unit tests for module ${{ matrix.modules.module_name }} (Python ${{ matrix.python-version }})
6262
needs: get-modules
6363
strategy:
6464
fail-fast: false
6565
matrix:
6666
modules: ${{ fromJson(needs.get-modules.outputs.matrix) }}
67-
python-version: [3.9]
67+
python-version: ["3.10", "3.11", "3.12"]
6868
node-version: [18.x]
6969
runs-on: ubuntu-latest
7070
env:
7171
MODULE_PATH: 'modules/${{ matrix.modules.module_name }}'
7272
steps:
7373
- name: Checkout
74-
uses: actions/checkout@v3
74+
uses: actions/checkout@v4
7575
with:
7676
fetch-depth: 0
7777
- id: determine-language
@@ -87,11 +87,17 @@ jobs:
8787
else \
8888
echo "language=none" >> "$GITHUB_OUTPUT"; \
8989
fi
90-
- name: Set up Python ${{ matrix.python-version }}
90+
- name: Set up uv
9191
if: ${{ steps.determine-language.outputs.language == 'python' }}
92-
uses: actions/setup-python@v4
92+
uses: astral-sh/setup-uv@v5
9393
with:
94-
python-version: ${{ matrix.python-version }}
94+
enable-cache: true
95+
- name: Set up Python ${{ matrix.python-version }}
96+
if: ${{ steps.determine-language.outputs.language == 'python' }}
97+
run: uv python install ${{ matrix.python-version }}
98+
- name: Create virtual environment
99+
if: ${{ steps.determine-language.outputs.language == 'python' }}
100+
run: uv venv --python ${{ matrix.python-version }}
95101
- name: Set up Node ${{ matrix.node-version }}
96102
if: ${{ steps.determine-language.outputs.language == 'typescript' }}
97103
uses: actions/setup-node@v4
@@ -101,21 +107,23 @@ jobs:
101107
if: ${{ steps.determine-language.outputs.language == 'python' }}
102108
run: |
103109
set -x
104-
python -m pip install --upgrade pip
105-
pip install -r requirements-dev.txt
106-
pip install -r $MODULE_PATH/requirements.txt
110+
uv pip install -r requirements-dev.txt
111+
uv pip install -r $MODULE_PATH/requirements.txt
107112
- name: Install Requirements (Typescript)
108113
if: ${{ steps.determine-language.outputs.language == 'typescript' }}
109114
run: |
110115
set -x
111116
cd $MODULE_PATH
112117
npm install
113-
- name: Static checks and linting
114-
if: ${{ steps.determine-language.outputs.language != 'none' }}
115-
run: scripts/validate.sh --language ${{ steps.determine-language.outputs.language }} --path $MODULE_PATH/
118+
- name: Static checks and linting (Python)
119+
if: ${{ steps.determine-language.outputs.language == 'python' }}
120+
run: uv run scripts/validate.sh --language python --path $MODULE_PATH/
121+
- name: Static checks and linting (TypeScript)
122+
if: ${{ steps.determine-language.outputs.language == 'typescript' }}
123+
run: ./scripts/validate.sh --language typescript --path $MODULE_PATH/
116124
- name: Pytest
117125
if: ${{ steps.determine-language.outputs.language == 'python' }}
118-
run: cd $MODULE_PATH/ && pytest
126+
run: uv run --no-project --directory $MODULE_PATH pytest
119127
- name: NPM Test
120128
if: ${{ steps.determine-language.outputs.language == 'typescript' }}
121129
run: cd $MODULE_PATH/ && npm test

.github/workflows/one-click-template-lint.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,20 @@ jobs:
3333
uses: actions/checkout@v4
3434
with:
3535
fetch-depth: 0
36-
- name: Set up Python
37-
uses: actions/setup-python@v5
36+
- name: Set up uv
37+
uses: astral-sh/setup-uv@v5
3838
with:
39-
python-version: 3.11
39+
enable-cache: true
40+
- name: Set up Python
41+
run: uv python install 3.11
42+
- name: Create virtual environment
43+
run: uv venv --python 3.11
4044
- name: Install Requirements
4145
run: |
4246
set -x
43-
python -m pip install --upgrade pip
44-
pip install -r requirements-dev.txt
47+
uv pip install -r requirements-dev.txt
4548
- name: cfn-lint
46-
run: cfn-lint --template ./one-click-launch.yaml
49+
run: uv run cfn-lint --template ./one-click-launch.yaml
4750

4851
nag:
4952
name: CFN Nag Template

.github/workflows/yaml-lint-check.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v4
2424

25+
- name: Set up uv
26+
uses: astral-sh/setup-uv@v5
27+
with:
28+
enable-cache: true
29+
2530
- name: Install yamllint
26-
run: pip install yamllint
31+
run: uv pip install --system yamllint
2732

2833
- name: Lint YAML files
2934
run: yamllint --format github -d "{extends: default, ignore: ['*chart*']}" .

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
### **Changed**
1313

14+
- update urllib3 to 2.6.3
15+
- update boto3 to 1.35.0
16+
- update qs to 6.14.1
17+
- upgrade Python version from 3.8 to 3.11
18+
- upgrade CodeBuild image from Standard 5 to Standard 7
19+
1420
## v2.1.2
1521

1622
### **Changed**

modules/eks/ray-cluster/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ exclude = [
1414
"codeseeder",
1515
]
1616
line-length = 120
17-
target-version = "py38"
17+
target-version = "py311"
1818

1919
[tool.ruff.lint]
2020
select = ["F", "I", "E", "W"]
2121
fixable = ["ALL"]
2222

2323
[tool.mypy]
24-
python_version = "3.8"
24+
python_version = "3.11"
2525
strict = true
2626
ignore_missing_imports = true
2727
disallow_untyped_decorators = false

modules/eks/ray-operator/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ exclude = [
1414
"codeseeder",
1515
]
1616
line-length = 120
17-
target-version = "py38"
17+
target-version = "py311"
1818

1919
[tool.ruff.lint]
2020
select = ["F", "I", "E", "W"]
2121
fixable = ["ALL"]
2222

2323
[tool.mypy]
24-
python_version = "3.8"
24+
python_version = "3.11"
2525
strict = true
2626
ignore_missing_imports = true
2727
disallow_untyped_decorators = false

modules/eks/ray-orchestrator/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ exclude = [
1414
"codeseeder",
1515
]
1616
line-length = 120
17-
target-version = "py38"
17+
target-version = "py311"
1818

1919
[tool.ruff.lint]
2020
select = ["F", "I", "E", "W"]
2121
fixable = ["ALL"]
2222

2323
[tool.mypy]
24-
python_version = "3.8"
24+
python_version = "3.11"
2525
strict = true
2626
ignore_missing_imports = true
2727
disallow_untyped_decorators = false

modules/examples/airflow-dags/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ exclude = [
1515
"codeseeder.out",
1616
]
1717
line-length = 120
18-
target-version = "py38"
18+
target-version = "py311"
1919

2020
[tool.ruff.lint]
2121
select = ["F", "I", "E", "W"]
2222
fixable = ["ALL"]
2323

2424
[tool.mypy]
25-
python_version = "3.8"
25+
python_version = "3.11"
2626
strict = true
2727
disallow_untyped_decorators = false
2828
exclude = "codeseeder.out/|dags/"
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
aws-cdk-lib~=2.137.0
22
cdk-nag~=2.28.89
3-
boto3~=1.34.84
3+
boto3>=1.35.0
44
attrs~=23.2.0
55
pydantic~=2.7.4
66
pydantic-settings~=2.3.3
7+
urllib3>=2.6.3

0 commit comments

Comments
 (0)