Skip to content

Commit 0b43168

Browse files
fix(python 3.12): compatibility
1 parent 20e3f94 commit 0b43168

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.github/workflows/CICD.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v4
1414
- uses: actions/setup-python@v5
1515
with:
16-
python-version: "3.9"
16+
python-version: "3.12"
1717
- name: Test
1818
run: |
1919
pip install -r requirements.txt

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ authors = [
1212
]
1313
description = "OpenGeodeWeb-Back is an open source framework that proposes handy python functions and wrappers for the OpenGeode ecosystem"
1414
readme = "README.md"
15-
requires-python = ">=3.8"
15+
requires-python = ">=3.12"
1616
classifiers = [
1717
"Programming Language :: Python :: 3",
1818
"License :: OSI Approved :: MIT License",

src/opengeodeweb_back/utils_functions.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import flask
99
from jsonschema import validate
1010
from jsonschema.exceptions import ValidationError
11-
import pkg_resources
11+
import importlib.metadata as metadata
1212

1313
# Local application imports
1414

@@ -72,9 +72,11 @@ def versions(list_packages: list):
7272
list_with_versions.append(
7373
{
7474
"package": package,
75-
"version": pkg_resources.get_distribution(package).version,
75+
"version": metadata.distribution(package).version
76+
7677
}
7778
)
79+
print(f"{package} version: {metadata.distribution(package)}", flush=True)
7880
return list_with_versions
7981

8082

0 commit comments

Comments
 (0)