Skip to content

Commit 1101748

Browse files
committed
init v1.8.0
1 parent 70118eb commit 1101748

8 files changed

Lines changed: 38 additions & 35 deletions

File tree

.github/workflows/Python-check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
strategy:
2828
matrix:
2929
platform: [ubuntu-latest, macos-latest] # windows-latest
30-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
30+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
3131

3232
steps:
3333
- uses: actions/checkout@v4

python/dalex/NEWS.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
## Changelog
22

3-
### development
3+
### v1.8.0 (2026-01-19)
44

5-
...
5+
* remove the `pkg_resources` dependency breaking `dalex` ([#579](https://github.com/ModelOriented/DALEX/issues/579))
6+
* increase the dependency to `python>=3.9` and add `python==3.13` to CI
7+
* increase the `plotly` dependency to `>=6.0.0` and fix compatibility issues with the new version, e.g. `titlefont` is now `title_font` ([#573](https://github.com/ModelOriented/DALEX/issues/573))
68

79
### v1.7.2 (2025-02-12)
810

python/dalex/dalex/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from .aspect import Aspect
1010

1111

12-
__version__ = '1.7.2.9000'
12+
__version__ = '1.8.0'
1313

1414
__all__ = [
1515
"Arena",

python/dalex/dalex/_explainer/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ def is_y_in_data(data, y):
1313

1414

1515
def get_model_info(model):
16-
model_package = re.search("(?<=<class ').*?(?=\.)", str(type(model)))[0]
16+
model_package = re.search(r"(?<=<class ').*?(?=\.)", str(type(model)))[0]
1717
return {'model_package': model_package}

python/dalex/dalex/_global_checks.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import pkg_resources
21
from importlib import import_module
2+
from importlib.metadata import version, PackageNotFoundError
3+
from packaging.version import parse
34
from re import search
45

56
# WARNING: below code is parsed by setup.py
@@ -41,13 +42,13 @@ def global_check_import(name=None, functionality=None):
4142
else:
4243
import_module(name)
4344

44-
installed_version = pkg_resources.parse_version(pkg_resources.get_distribution(name).version)
45-
needed_version = pkg_resources.parse_version(OPTIONAL_DEPENDENCIES[name])
45+
installed_version = parse(version(name))
46+
needed_version = parse(OPTIONAL_DEPENDENCIES[name])
4647
if installed_version < needed_version:
4748
raise ImportWarning("Outdated version of optional dependency '" + name + "'. " +
4849
("Update '" + name + "' for " + functionality + ". ") if functionality else "" +
4950
"Use pip or conda to update '" + name + "' to avoid potential errors.")
50-
except ImportError:
51+
except (ImportError, PackageNotFoundError):
5152
raise ImportError("Missing optional dependency '" + name + "'. " +
5253
("Install '" + name + "' for " + functionality + ". ") if functionality else "" +
5354
"Use pip or conda to install '" + name + "'.")

python/dalex/dalex/fairness/_group_fairness/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def _fairness_theme(title):
194194
'template': 'plotly_white',
195195
'title_x': 0.5,
196196
'title_y': 0.99,
197-
'titlefont': {'size': 25},
197+
'title_font': {'size': 25},
198198
'font': {'color': "#371ea3"},
199199
'margin': {'t': 78, 'b': 71, 'r': 30}}
200200

python/dalex/setup.py

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
1-
import codecs
21
import os
2+
import ast
33

44

55
this_directory = os.path.abspath(os.path.dirname(__file__))
6-
with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
7-
readme = f.read()
8-
9-
with open(os.path.join(this_directory, 'NEWS.md'), encoding='utf-8')as f:
10-
news = f.read()
11-
126

137
# https://packaging.python.org/guides/single-sourcing-package-version/
148
def read(rel_path):
15-
with codecs.open(os.path.join(this_directory, rel_path), 'r') as fp:
9+
"""Read a file relative to the setup.py location."""
10+
with open(os.path.join(this_directory, rel_path), encoding='utf-8') as fp:
1611
return fp.read()
1712

13+
readme = read('README.md')
14+
news = read('NEWS.md')
1815

1916
def get_version(rel_path):
17+
"""Extract __version__ from a file without importing it."""
2018
for line in read(rel_path).splitlines():
2119
if line.startswith('__version__'):
2220
delimiter = '"' if '"' in line else "'"
2321
return line.split(delimiter)[1]
2422

25-
2623
def get_optional_dependencies(rel_path):
24+
"""Parse OPTIONAL_DEPENDENCIES dict from a python file securely."""
2725
# read _global_checks.py and construct a list of optional dependencies
2826
flag = False
2927
to_parse = "{"
3028

3129
for line in read(rel_path).splitlines():
3230
if flag:
33-
if line == "}": # end
31+
if line == "}": # end of dict
3432
to_parse += line
3533
break
3634
to_parse += line.strip()
37-
if line.startswith('OPTIONAL_DEPENDENCIES'): # start
35+
if line.startswith('OPTIONAL_DEPENDENCIES'): # start of dict
3836
flag = True
3937

40-
od_dict = eval(to_parse)
41-
od_list = [k + ">=" + v for k, v in od_dict.items()]
42-
del od_list[0] # remove artificial dependency used in test_global.py
38+
# Use ast.literal_eval instead of eval for safety
39+
od_dict = ast.literal_eval(to_parse)
40+
od_list = [f"{k}>={v}" for k, v in od_dict.items()]
41+
# remove artificial dependency used in test_global.py
42+
if 'dalex' in od_list:
43+
del od_list['dalex']
4344
return od_list
4445

45-
4646
def run_setup():
4747
# fixes warning https://github.com/pypa/setuptools/issues/2230
4848
from setuptools import setup, find_packages
4949

50-
extras_require = get_optional_dependencies("dalex/_global_checks.py")
50+
full_dependencies = get_optional_dependencies("dalex/_global_checks.py")
5151

5252
setup(
5353
name="dalex",
@@ -57,7 +57,7 @@ def run_setup():
5757
author_email="przemyslaw.biecek@gmail.com",
5858
version=get_version("dalex/__init__.py"),
5959
description="Responsible Machine Learning in Python",
60-
long_description=u"\n\n".join([readme, news]),
60+
long_description="\n\n".join([readme, news]),
6161
long_description_content_type="text/markdown",
6262
url="https://dalex.drwhy.ai/",
6363
project_urls={
@@ -70,26 +70,27 @@ def run_setup():
7070
"Topic :: Scientific/Engineering",
7171
"Topic :: Scientific/Engineering :: Artificial Intelligence",
7272
"Programming Language :: Python :: 3",
73-
"Programming Language :: Python :: 3.8",
7473
"Programming Language :: Python :: 3.9",
7574
"Programming Language :: Python :: 3.10",
7675
"Programming Language :: Python :: 3.11",
7776
"Programming Language :: Python :: 3.12",
77+
"Programming Language :: Python :: 3.13",
7878
"License :: OSI Approved",
7979
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
8080
"Operating System :: OS Independent",
8181
],
8282
install_requires=[
8383
'setuptools',
84+
'packaging',
8485
'pandas>=1.5.3',
8586
'numpy>=1.23.3',
8687
'scipy>=1.6.3',
87-
'plotly>=5.1.0,<6.0.0',
88+
'plotly>=6.0.0',
8889
'tqdm>=4.61.2',
8990
],
90-
extras_require={'full': extras_require},
91+
extras_require={'full': full_dependencies},
9192
packages=find_packages(include=["dalex", "dalex.*"]),
92-
python_requires='>=3.8',
93+
python_requires='>=3.9',
9394
include_package_data=True
9495
)
9596

tox.ini

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
[tox]
2-
envlist = py{38,39,310,311,312}
2+
envlist = py{39,310,311,312,313}
33
toxworkdir={toxinidir}/python/dalex/.tox
44
temp_dir={toxinidir}/python/dalex/.tmp
55
setupdir={toxinidir}/python/dalex/
66
skip_missing_interpreters=true
77

88
[gh-actions]
99
python =
10-
3.8: py38
1110
3.9: py39
1211
3.10: py310
1312
3.11: py311
1413
3.12: py312
14+
3.13: py313
1515

1616
[testenv]
1717
changedir = {toxinidir}/python/dalex/test
@@ -28,5 +28,4 @@ deps =
2828
ipython
2929
ipywidgets
3030
ppscore
31-
kaleido
32-
numpy<=1.26.4
31+
kaleido

0 commit comments

Comments
 (0)