Skip to content

Commit 9e3b0e2

Browse files
committed
Update minimum Python version to 3.8
I want to use the f"{foo=}" f-string feature.
1 parent b8a3fb0 commit 9e3b0e2

5 files changed

Lines changed: 6 additions & 21 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ jobs:
2222
macos-latest
2323
]
2424
python-version: [
25-
'3.7',
2625
'3.8',
2726
'3.9',
2827
'3.10'

dev-environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ channels:
1919
- conda-forge
2020
- defaults
2121
dependencies:
22-
- python >= 3.7
22+
- python >= 3.8
2323
# Project dependencies
2424
- jpype1 >= 1.3.0
2525
- jgo

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ channels:
2020
- conda-forge
2121
- defaults
2222
dependencies:
23-
- python >= 3.7
23+
- python >= 3.8
2424
# Project dependencies
2525
- jpype1 >= 1.3.0
2626
- jgo

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ classifiers = [
1616
"Intended Audience :: Education",
1717
"Intended Audience :: Science/Research",
1818
"Programming Language :: Python :: 3 :: Only",
19-
"Programming Language :: Python :: 3.7",
2019
"Programming Language :: Python :: 3.8",
2120
"Programming Language :: Python :: 3.9",
2221
"Programming Language :: Python :: 3.10",
@@ -31,7 +30,7 @@ classifiers = [
3130
]
3231

3332
# NB: Keep this in sync with environment.yml AND dev-environment.yml!
34-
requires-python = ">=3.7"
33+
requires-python = ">=3.8"
3534
dependencies = [
3635
"jpype1 >= 1.3.0",
3736
"jgo",
@@ -77,7 +76,7 @@ exclude = ["bin", "build", "dist"]
7776
extend-ignore = ["E203"]
7877
# See https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8
7978
max-line-length = 88
80-
min_python_version = "3.7"
79+
min_python_version = "3.8"
8180

8281
[tool.isort]
8382
profile = "black"

src/scyjava/_versions.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44

55
import logging
6-
from importlib.util import find_spec
6+
from importlib.metadata import version
77

88
from ._java import isjava, jimport
99

@@ -32,20 +32,7 @@ def get_version(java_class_or_python_package) -> str:
3232
return str(VersionUtils.getVersion(java_class_or_python_package))
3333

3434
# Assume we were given a Python package name.
35-
36-
if find_spec("importlib.metadata"):
37-
# Fastest, but requires Python 3.8+.
38-
from importlib.metadata import version
39-
40-
return version(java_class_or_python_package)
41-
42-
if find_spec("pkg_resources"):
43-
# Slower, but works on Python 3.7.
44-
from pkg_resources import get_distribution
45-
46-
return get_distribution(java_class_or_python_package).version
47-
48-
raise RuntimeError("Cannot determine version! Is pkg_resources installed?")
35+
return version(java_class_or_python_package)
4936

5037

5138
def is_version_at_least(actual_version: str, minimum_version: str) -> bool:

0 commit comments

Comments
 (0)