Skip to content

Commit 9ebeea3

Browse files
committed
feat(#19): Make ThermOHL compatible with Python 3.12
- Update dependencies in order to be compatible with Python 3.12 - Update sonarCloud Actions to be runnable from fork Signed-off-by: SAINTIER Francois <[email protected]>
1 parent 20b128e commit 9ebeea3

File tree

6 files changed

+16
-44
lines changed

6 files changed

+16
-44
lines changed

.github/workflows/build-project.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
strategy:
4040
matrix:
4141
os: [ubuntu-latest, windows-latest]
42-
python-version: ["3.9", "3.10", "3.11"]
42+
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
4343

4444
steps:
4545
- uses: actions/checkout@v4

.github/workflows/cd-pypi.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
os: [ ubuntu-latest, windows-latest ]
22-
python-version: [ "3.9", "3.10", "3.11" ]
22+
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
2323

2424
steps:
2525
- name: 📃 Checkout sources

.github/workflows/cd-test-pypi.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
os: [ ubuntu-latest, windows-latest ]
23-
python-version: [ "3.9", "3.10", "3.11" ]
23+
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
2424

2525
steps:
2626
- name: 📃 Checkout sources

.github/workflows/sonarcloud-analysis.yml

+6-10
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,30 @@ name: SonarCloud analysis
1212

1313
on:
1414
workflow_run:
15-
workflows:
16-
- SonarCloud Build
17-
types:
18-
- completed
15+
workflows: [SonarCloud Build]
16+
types: [completed]
1917

2018
jobs:
2119
SonarCloudAnalysis:
2220
runs-on: ubuntu-latest
23-
if: github.event.workflow_run.conclusion == 'success'
21+
if: github.event.workflow_run && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request'
2422
timeout-minutes: 15
2523

2624
steps:
2725
- name: Download PR number artifact
28-
if: github.event.workflow_run.event == 'pull_request'
2926
uses: dawidd6/action-download-artifact@v3
3027
with:
3128
workflow: SonarCloud Build
3229
run_id: ${{ github.event.workflow_run.id }}
3330
name: PR_NUMBER
3431

3532
- name: Read PR_NUMBER.txt
36-
if: github.event.workflow_run.event == 'pull_request'
3733
id: pr_number
3834
uses: juliangruber/read-file-action@v1
3935
with:
4036
path: ./PR_NUMBER.txt
4137

4238
- name: Request GitHub API for PR data
43-
if: github.event.workflow_run.event == 'pull_request'
4439
uses: octokit/[email protected]
4540
id: get_pr_data
4641
with:
@@ -57,7 +52,6 @@ jobs:
5752
fetch-depth: 0
5853

5954
- name: Checkout base branch
60-
if: github.event.workflow_run.event == 'pull_request'
6155
run: |
6256
git remote add upstream ${{ github.event.repository.clone_url }}
6357
git fetch upstream
@@ -69,10 +63,12 @@ jobs:
6963
uses: actions/setup-python@v5
7064
with:
7165
python-version: 3.11
66+
cache: 'pip'
7267

7368
- name: Install dependencies
7469
run: |
7570
python -m pip install --upgrade pip
71+
pip install .
7672
pip install -e .[test]
7773
7874
- name: Run tests and generate coverage report
@@ -97,7 +93,7 @@ jobs:
9793
-Dsonar.scm.revision=${{ github.event.workflow_run.head_sha }}
9894
9995
- name: Run Sonar analysis (Push)
100-
if: ${{ github.event.workflow_run.event == 'push' }}
96+
if: ${{ github.event.workflow_run.event == 'push' && github.repository == 'phlowers/thermohl'}}
10197
uses: sonarsource/sonarqube-scan-action@v5
10298
env:
10399
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/sonarcloud-build.yml

+1-27
Original file line numberDiff line numberDiff line change
@@ -22,35 +22,17 @@ jobs:
2222
with:
2323
fetch-depth: 0
2424

25-
- name: Cache SonarCloud packages
26-
uses: actions/cache@v3
27-
with:
28-
path: ~/.sonar/cache
29-
key: ${{ runner.os }}-sonar
30-
restore-keys: ${{ runner.os }}-sonar
31-
3225
- name: Set up Python 3.11
3326
uses: actions/setup-python@v5
3427
with:
3528
python-version: 3.11
29+
cache: 'pip'
3630

3731
- name: Install dependencies
3832
run: |
3933
python -m pip install --upgrade pip
4034
pip install --upgrade build
4135
42-
- name: Install security check tools
43-
run: |
44-
pip install bandit safety
45-
46-
- name: Security check with bandit
47-
run: |
48-
bandit -r thermohl/ -f json -o bandit-results.json || true
49-
50-
- name: Check dependencies vulnerabilities with safety
51-
run: |
52-
safety check --json --output safety-results.json || true
53-
5436
- name: Build and analyze (Pull Request)
5537
if: ${{ github.event_name == 'pull_request' || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }}
5638
env:
@@ -75,11 +57,3 @@ jobs:
7557
with:
7658
name: PR_NUMBER
7759
path: PR_NUMBER.txt
78-
79-
- name: Archive security reports
80-
uses: actions/upload-artifact@v4
81-
with:
82-
name: security-reports
83-
path: |
84-
bandit-results.json
85-
safety-results.json

pyproject.toml

+6-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ version = "1.3.0.dev2"
1818
description = "Calculations relative to temperature and ampacity in overhead conductors."
1919
license = "MPL-2.0"
2020
readme = "README.md"
21-
requires-python = ">=3.9,<3.12"
21+
requires-python = ">=3.9,<3.13"
2222
classifiers = [
2323
"Intended Audience :: Science/Research",
2424
"Intended Audience :: Developers",
@@ -29,13 +29,15 @@ classifiers = [
2929
"Programming Language :: Python :: 3.9",
3030
"Programming Language :: Python :: 3.10",
3131
"Programming Language :: Python :: 3.11",
32+
"Programming Language :: Python :: 3.12",
3233
"Operating System :: OS Independent",
3334
]
3435
dependencies = [
35-
"numpy ~= 1.25.0",
36-
"pandas ~= 1.5.3",
36+
"numpy ~= 1.26.4",
37+
"pandas ~= 2.2.3",
3738
"scipy ~= 1.13.1",
38-
"pyyaml ~= 5.3.1",
39+
"pyyaml ~= 6.0.2",
40+
"setuptools"
3941
]
4042

4143
[project.optional-dependencies]

0 commit comments

Comments
 (0)