Skip to content

Commit ce4941d

Browse files
authored
Managing Package Upgrades and related Dependencies (#989)
* Fix build issue during quay uploads * Upgrade Package Versions and Dependencies * specify pytz in requirements * Jira issue in UT fix
1 parent 3925f22 commit ce4941d

43 files changed

Lines changed: 275 additions & 397 deletions

Some content is hidden

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

.github/workflows/Build.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
strategy:
2020
matrix:
21-
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
21+
python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14' ]
2222
steps:
2323
- uses: actions/checkout@v6
2424
- name: Set up Python ${{ matrix.python-version }}
@@ -32,7 +32,7 @@ jobs:
3232
sudo apt-get install build-essential python3-dev libldap2-dev libsasl2-dev vim -y
3333
python -m pip install --upgrade pip
3434
pip install "setuptools<82"
35-
pip install --no-build-isolation ibm-cloud-sdk-core==3.18.0 ibm-platform-services==0.27.0 ibm-vpc==0.21.0
35+
pip install ibm-cloud-sdk-core==3.24.4 ibm-platform-services==0.75.0 ibm-vpc==0.33.0
3636
pip install flake8 pytest pytest-cov
3737
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
3838
if [ -f tests_requirements.txt ]; then pip install -r tests_requirements.txt; fi
@@ -69,7 +69,7 @@ jobs:
6969
INSTANCE_ID: ${{ steps.terraform_instance_id.outputs.INSTANCE_ID }}
7070
strategy:
7171
matrix:
72-
python-version: [ '3.13' ]
72+
python-version: [ '3.14' ]
7373
steps:
7474
- uses: actions/checkout@v6
7575
- name: Set up Python ${{ matrix.python-version }}
@@ -123,7 +123,7 @@ jobs:
123123
strategy:
124124
max-parallel: 1
125125
matrix:
126-
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
126+
python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14' ]
127127
services:
128128
elasticsearch:
129129
image: docker.elastic.co/elasticsearch/elasticsearch:7.11.0
@@ -149,7 +149,7 @@ jobs:
149149
sudo apt-get install build-essential python3-dev libldap2-dev libsasl2-dev vim -y
150150
python -m pip install --upgrade pip
151151
pip install "setuptools<82"
152-
pip install --no-build-isolation ibm-cloud-sdk-core==3.18.0 ibm-platform-services==0.27.0 ibm-vpc==0.21.0
152+
pip install ibm-cloud-sdk-core==3.24.4 ibm-platform-services==0.75.0 ibm-vpc==0.33.0
153153
pip install flake8 pytest pytest-cov
154154
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
155155
if [ -f tests_requirements.txt ]; then pip install -r tests_requirements.txt; fi
@@ -201,7 +201,7 @@ jobs:
201201
runs-on: ubuntu-latest
202202
strategy:
203203
matrix:
204-
python-version: [ '3.13' ]
204+
python-version: [ '3.14' ]
205205
steps:
206206
- uses: actions/checkout@v6
207207
- name: Set up Python ${{ matrix.python-version }}
@@ -248,7 +248,7 @@ jobs:
248248
runs-on: ubuntu-latest
249249
strategy:
250250
matrix:
251-
python-version: [ '3.13' ]
251+
python-version: [ '3.14' ]
252252
steps:
253253
- uses: actions/checkout@v6
254254
- name: Set up Python ${{ matrix.python-version }}
@@ -271,7 +271,7 @@ jobs:
271271
runs-on: ubuntu-latest
272272
strategy:
273273
matrix:
274-
python-version: [ '3.13' ]
274+
python-version: [ '3.14' ]
275275
steps:
276276
- uses: actions/checkout@v6
277277
- name: Set up Python ${{ matrix.python-version }}
@@ -288,7 +288,7 @@ jobs:
288288
sudo apt-get install build-essential python3-dev libldap2-dev libsasl2-dev vim -y
289289
python -m pip install --upgrade pip
290290
pip install "setuptools<82"
291-
pip install --no-build-isolation ibm-cloud-sdk-core==3.18.0 ibm-platform-services==0.27.0 ibm-vpc==0.21.0 ibm-schematics==1.0.1
291+
pip install ibm-cloud-sdk-core==3.24.4 ibm-platform-services==0.75.0 ibm-vpc==0.33.0 ibm-schematics==1.0.1
292292
echo '⌛ Wait till package will be updated in PyPI'
293293
# Verfiy and wait till latest cloud-governance version will be updated in Pypi (timeout 900 seconds)
294294
timeout=900
@@ -324,7 +324,7 @@ jobs:
324324
runs-on: ubuntu-latest
325325
strategy:
326326
matrix:
327-
python-version: [ '3.13' ]
327+
python-version: [ '3.14' ]
328328
steps:
329329
- uses: actions/checkout@v6
330330
- name: Set up Python ${{ matrix.python-version }}
@@ -345,7 +345,7 @@ jobs:
345345
runs-on: ubuntu-latest
346346
strategy:
347347
matrix:
348-
python-version: [ '3.13' ]
348+
python-version: [ '3.14' ]
349349
steps:
350350
- uses: actions/checkout@v6
351351
- name: Set up Python ${{ matrix.python-version }}
@@ -369,7 +369,7 @@ jobs:
369369
runs-on: ubuntu-latest
370370
strategy:
371371
matrix:
372-
python-version: [ '3.13' ]
372+
python-version: [ '3.14' ]
373373
needs: [ unittest, terraform_apply, integration, pypi_upload, pypi_validate, public_quay_upload, private_quay_upload ]
374374
steps:
375375
- uses: actions/checkout@v6

.github/workflows/PR.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
runs-on: ubuntu-latest
4444
strategy:
4545
matrix:
46-
python-version: [ '3.13' ]
46+
python-version: [ '3.14' ]
4747
outputs:
4848
INSTANCE_ID: ${{ steps.terraform_instance_id.outputs.INSTANCE_ID }}
4949
steps:
@@ -101,7 +101,7 @@ jobs:
101101
strategy:
102102
max-parallel: 1
103103
matrix:
104-
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
104+
python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14' ]
105105
services:
106106
elasticsearch:
107107
image: docker.elastic.co/elasticsearch/elasticsearch:7.11.0
@@ -131,7 +131,7 @@ jobs:
131131
sudo apt-get install -y build-essential python3-dev libldap2-dev libsasl2-dev
132132
python -m pip install --upgrade pip
133133
pip install "setuptools<82"
134-
pip install --no-build-isolation ibm-cloud-sdk-core==3.18.0 ibm-platform-services==0.27.0 ibm-vpc==0.21.0
134+
pip install ibm-cloud-sdk-core==3.24.4 ibm-platform-services==0.75.0 ibm-vpc==0.33.0
135135
pip install pytest pytest-cov
136136
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
137137
if [ -f tests_requirements.txt ]; then pip install -r tests_requirements.txt; fi
@@ -170,7 +170,7 @@ jobs:
170170
if: success() || failure()
171171
strategy:
172172
matrix:
173-
python-version: [ '3.13' ]
173+
python-version: [ '3.14' ]
174174
steps:
175175
- uses: actions/checkout@v6
176176
with:
@@ -218,7 +218,7 @@ jobs:
218218
runs-on: ubuntu-latest
219219
strategy:
220220
matrix:
221-
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
221+
python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14' ]
222222
steps:
223223
- uses: actions/checkout@v6
224224
with:
@@ -235,7 +235,7 @@ jobs:
235235
sudo apt-get install -y build-essential python3-dev libldap2-dev libsasl2-dev
236236
python -m pip install --upgrade pip
237237
pip install "setuptools<82"
238-
pip install --no-build-isolation ibm-cloud-sdk-core==3.18.0 ibm-platform-services==0.27.0 ibm-vpc==0.21.0
238+
pip install ibm-cloud-sdk-core==3.24.4 ibm-platform-services==0.75.0 ibm-vpc==0.33.0
239239
pip install pytest pytest-cov
240240
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
241241
if [ -f tests_requirements.txt ]; then pip install -r tests_requirements.txt; fi

.github/workflows/PR_Approval.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
18+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
1919
steps:
2020
- uses: actions/checkout@v6
2121
with:
@@ -31,7 +31,7 @@ jobs:
3131
sudo apt-get install -y build-essential python3-dev libldap2-dev libsasl2-dev
3232
python -m pip install --upgrade pip
3333
pip install "setuptools<82"
34-
pip install --no-build-isolation ibm-cloud-sdk-core==3.18.0 ibm-platform-services==0.27.0 ibm-vpc==0.21.0
34+
pip install ibm-cloud-sdk-core==3.24.4 ibm-platform-services==0.75.0 ibm-vpc==0.33.0
3535
pip install flake8 pytest pytest-cov
3636
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
3737
if [ -f tests_requirements.txt ]; then pip install -r tests_requirements.txt; fi

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
66

77
### Development Setup
88
```bash
9-
python3.9 -m venv .venv
9+
python3.10 -m venv .venv
1010
source ./.venv/bin/activate
1111
pip install -r requirements.txt
1212
pip install -r tests_requirements.txt
@@ -102,7 +102,7 @@ flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statist
102102
```
103103

104104
### Testing Strategy
105-
- **Unit Tests**: `pytest -v tests/unittest` - Python 3.9-3.13 matrix
105+
- **Unit Tests**: `pytest -v tests/unittest` - Python 3.10-3.14 matrix
106106
- **Integration Tests**: `pytest -v tests/integration` - Requires AWS/Azure/GCP credentials and ElasticSearch
107107
- **E2E Tests**: Cross-region policy validation using containerized deployments
108108
- **Coverage**: Uses coveralls.io for coverage reporting

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ git clone --single-branch --branch main https://github.com/redhat-performance/cl
1818
```
1919
cd cloud-governance/
2020
git checkout -b <name_of_change>
21-
python3.9 -m venv .venv
21+
python3.10 -m venv .venv
2222
source ./.venv/bin/activate
2323
pip install -r requirmenets.txt
2424
```

Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.13-slim
1+
FROM python:3.14-slim
22

33
# cloud-governance latest version
44
ARG VERSION
@@ -14,10 +14,13 @@ RUN apt-get update \
1414
&& mv gitleaks /usr/local/bin/ \
1515
&& gitleaks --version
1616

17-
# Pin setuptools<82 so pkg_resources is available when building ibm-cloud-sdk-core
17+
# Pre-install IBM packages, then use a constraints file so pip cannot
18+
# downgrade them when resolving cloud-governance's published dependencies.
1819
RUN python -m pip --no-cache-dir install --upgrade pip "setuptools>=58,<82" wheel && \
19-
pip --no-cache-dir install --no-build-isolation ibm-cloud-sdk-core==3.18.0 ibm-platform-services==0.27.0 ibm-vpc==0.21.0 ibm-schematics==1.0.1 && \
20-
pip --no-cache-dir install cloud-governance --upgrade
20+
pip --no-cache-dir install ibm-cloud-sdk-core==3.24.4 ibm-platform-services==0.75.0 ibm-vpc==0.33.0 ibm-schematics==1.0.1 && \
21+
printf 'ibm-cloud-sdk-core==3.24.4\nibm-platform-services==0.75.0\nibm-vpc==0.33.0\nibm-schematics==1.0.1\n' > /tmp/constraints.txt && \
22+
pip --no-cache-dir install cloud-governance --upgrade -c /tmp/constraints.txt && \
23+
rm /tmp/constraints.txt
2124
RUN pip3 --no-cache-dir install --upgrade awscli
2225
ADD cloud_governance/policy /usr/local/cloud_governance/policy/
2326
COPY cloud_governance/main/main.py /usr/local/cloud_governance/main.py

cloud_governance/common/clouds/aws/price/price.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
from time import strftime
33

44
import json
5-
from pkg_resources import resource_filename
5+
from pathlib import Path
6+
7+
import botocore
68

79
from cloud_governance.common.clouds.aws.utils.common_methods import get_boto3_client
810
from cloud_governance.common.logger.init_logger import logger
@@ -62,7 +64,7 @@ def get_region_name(self, region_code):
6264
@return:
6365
"""
6466
default_region = 'us-east-1'
65-
endpoint_file = resource_filename('botocore', 'data/endpoints.json')
67+
endpoint_file = str(Path(botocore.__file__).parent / 'data' / 'endpoints.json')
6668
try:
6769
with open(endpoint_file, 'r') as f:
6870
data = json.load(f)

cloud_governance/common/ldap/ldap_search.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import os
22

33
import ldap
4-
# installation for rhel/centos - python3.9
5-
# sudo dnf install -y python39-devel openldap-devel gcc
4+
# installation for rhel/centos
5+
# sudo dnf install -y python3-devel openldap-devel gcc
66

77
from cloud_governance.common.logger.init_logger import logger
88
from cloud_governance.common.utils.api_requests import APIRequests

clouds_data_ware_house/cloud_resource_orchestration/clouds/aws/instance_types_pricing.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import json
22
import os
33

4+
from pathlib import Path
5+
46
import boto3
5-
from pkg_resources import resource_filename
7+
import botocore
68

79

810
class InstanceTypes:
@@ -29,7 +31,7 @@ def get_region_name(self, region_code):
2931
@return:
3032
"""
3133
default_region = 'us-east-1'
32-
endpoint_file = resource_filename('botocore', 'data/endpoints.json')
34+
endpoint_file = str(Path(botocore.__file__).parent / 'data' / 'endpoints.json')
3335
try:
3436
with open(endpoint_file, 'r') as f:
3537
data = json.load(f)

requirements.txt

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
aiohttp==3.10.11
1+
aiohttp==3.13.3
22
attrs==21.4.0
33
azure-identity==1.16.1
44
azure-mgmt-billing==6.0.0
@@ -8,33 +8,35 @@ azure-mgmt-monitor==6.0.2
88
azure-mgmt-network==25.0.0
99
azure-mgmt-resource==23.0.1
1010
azure-mgmt-subscription==3.1.1
11-
boto3==1.33.1
12-
botocore==1.33.8
13-
elasticsearch==7.13.4 # opensearch 1.2.4 for elasticsearch
11+
boto3==1.42.89
12+
botocore==1.42.89
13+
elasticsearch==7.17.13 # opensearch 1.2.4 for elasticsearch
1414
elasticsearch-dsl==7.4.0
1515
google-api-python-client==2.57.0
1616
google-auth-httplib2==0.1.0
1717
google-auth-oauthlib==0.5.2
18-
google-cloud-bigquery==3.5.0
19-
google-cloud-billing==1.9.1
20-
ibm-cloud-sdk-core==3.18.0
21-
ibm-cos-sdk==2.13.6
22-
ibm-platform-services==0.27.0
18+
google-cloud-bigquery==3.41.0
19+
google-cloud-billing==1.19.0
20+
ibm-cloud-sdk-core==3.24.4
21+
ibm-cos-sdk==2.16.1
22+
ibm-platform-services==0.75.0
2323
ibm-schematics==1.0.1
24-
ibm-vpc==0.21.0
24+
ibm-vpc==0.33.0
2525
myst-parser==1.0.0
2626
numpy<=1.26.4 # opensearch 1.2.4 for elasticsearch
2727
oauthlib~=3.1.1
2828
pandas
29+
protobuf==5.29.6
2930
PyAthena[Pandas]==3.0.5
3031
PyGitHub==1.55
3132
python-ldap==3.4.2
32-
requests==2.32.2
33+
pytz
34+
requests==2.33.1
3335
retry==0.9.2
3436
setuptools
3537
SoftLayer==6.0.0
3638
sphinx==5.0.0
3739
sphinx-rtd-theme==1.0.0
3840
typeguard==2.13.3
3941
typing==3.7.4.3
40-
urllib3==1.26.19
42+
urllib3==2.6.3

0 commit comments

Comments
 (0)