Skip to content

Commit a67d711

Browse files
authored
Support python 3.13 (#721)
1 parent 6946835 commit a67d711

File tree

9 files changed

+34
-21
lines changed

9 files changed

+34
-21
lines changed

.github/workflows/integration.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
17-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
17+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
1818
os: [ubuntu-latest, windows-latest]
1919
include:
2020
- os: macos-latest
2121
python-version: '3.8'
2222
- os: macos-latest
23-
python-version: '3.12'
23+
python-version: '3.13'
2424
steps:
2525
- uses: actions/checkout@v4
2626
- name: Set up Python ${{ matrix.python-version }}
@@ -32,10 +32,16 @@ jobs:
3232
run: |
3333
brew install libomp
3434
echo 'export DYLD_LIBRARY_PATH=$(brew --prefix libomp)/lib:$DYLD_LIBRARY_PATH' >> $GITHUB_ENV
35-
- name: Install dependencies
35+
- if: matrix.python-version != 3.13
36+
name: Install dependencies
3637
run: |
3738
python -m pip install --upgrade pip
3839
python -m pip install invoke .[pomegranate,xgboost,test]
40+
- if: matrix.python-version == 3.13
41+
name: Install dependencies
42+
run: |
43+
python -m pip install --upgrade pip
44+
python -m pip install invoke .[xgboost,test]
3945
- name: Run integration tests
4046
run: invoke integration
4147

.github/workflows/minimum.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
17-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
17+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
1818
os: [ubuntu-latest, windows-latest]
1919
include:
2020
- os: macos-latest
2121
python-version: '3.8'
2222
- os: macos-latest
23-
python-version: '3.12'
23+
python-version: '3.13'
2424
steps:
2525
- uses: actions/checkout@v4
2626
- name: Set up Python ${{ matrix.python-version }}

.github/workflows/readme.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ${{ matrix.os }}
1111
strategy:
1212
matrix:
13-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
13+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
1414
os: [ubuntu-latest, macos-latest] # skip windows bc rundoc fails
1515
steps:
1616
- uses: actions/checkout@v4

.github/workflows/unit.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
17-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
17+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
1818
os: [ubuntu-latest, windows-latest]
1919
include:
2020
- os: macos-latest
2121
python-version: '3.8'
2222
- os: macos-latest
23-
python-version: '3.12'
23+
python-version: '3.13'
2424
steps:
2525
- uses: actions/checkout@v4
2626
- name: Set up Python ${{ matrix.python-version }}
@@ -39,7 +39,7 @@ jobs:
3939
- name: Run unit tests
4040
run: invoke unit
4141

42-
- if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12
42+
- if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.13
4343
name: Upload unit codecov report
4444
uses: codecov/codecov-action@v4
4545
with:

INSTALL.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Requirements
44

5-
**SDMetrics** has been developed and tested on [Python 3.8, 3.9, 3.10, 3.11 and 3.12](https://www.python.org/downloads/)
5+
**SDMetrics** has been developed and tested on [Python 3.8, 3.9, 3.10, 3.11, 3.12 and 3.13](https://www.python.org/downloads/)
66

77
Also, although it is not strictly required, the usage of a [virtualenv](
88
https://virtualenv.pypa.io/en/latest/) is highly recommended in order to avoid

pyproject.toml

+13-7
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,32 @@ classifiers = [
1313
'Programming Language :: Python :: 3.10',
1414
'Programming Language :: Python :: 3.11',
1515
'Programming Language :: Python :: 3.12',
16+
'Programming Language :: Python :: 3.13',
1617
]
1718
keywords = ['sdmetrics', 'sdmetrics', 'SDMetrics']
1819
dynamic = ['version']
1920
license = { text = 'MIT license' }
20-
requires-python = ">=3.8,<3.13"
21+
requires-python = ">=3.8,<3.14"
2122
readme = 'README.md'
2223
dependencies = [
2324
"numpy>=1.21.0;python_version<'3.10'",
2425
"numpy>=1.23.3;python_version>='3.10' and python_version<'3.12'",
25-
"numpy>=1.26.0;python_version>='3.12'",
26+
"numpy>=1.26.0;python_version>='3.12' and python_version<'3.13'",
27+
"numpy>=2.1.0;python_version>='3.13'",
2628
"pandas>=1.4.0;python_version<'3.11'",
2729
"pandas>=1.5.0;python_version>='3.11' and python_version<'3.12'",
28-
"pandas>=2.1.1;python_version>='3.12'",
30+
"pandas>=2.1.1;python_version>='3.12' and python_version<'3.13'",
31+
"pandas>=2.2.3;python_version>='3.13'",
2932
"scikit-learn>=1.0.2;python_version<'3.10'",
3033
"scikit-learn>=1.1.0;python_version>='3.10' and python_version<'3.11'",
3134
"scikit-learn>=1.1.3;python_version>='3.11' and python_version<'3.12'",
32-
"scikit-learn>=1.3.1;python_version>='3.12'",
35+
"scikit-learn>=1.3.1;python_version>='3.12' and python_version<'3.13'",
36+
"scikit-learn>=1.5.2;python_version>='3.13'",
3337
"scipy>=1.7.3;python_version<'3.10'",
3438
"scipy>=1.9.2;python_version>='3.10' and python_version<'3.12'",
35-
"scipy>=1.12.0;python_version>='3.12'",
36-
'copulas>=0.11.0',
39+
"scipy>=1.12.0;python_version>='3.12' and python_version<'3.13'",
40+
"scipy>=1.14.1;python_version>='3.13'",
41+
'copulas>=0.12.1',
3742
'tqdm>=4.29',
3843
'plotly>=5.19.0',
3944
]
@@ -52,7 +57,8 @@ sdmetrics = { main = 'sdmetrics.cli.__main__:main' }
5257
torch = [
5358
"torch>=1.8.0;python_version<'3.10'",
5459
"torch>=2.0.0;python_version>='3.10' and python_version<'3.12'",
55-
"torch>=2.2.0;python_version>='3.12'",
60+
"torch>=2.2.0;python_version>='3.12' and python_version<'3.13'",
61+
"torch>=2.6.0;python_version>='3.13'",
5662
]
5763
pomegranate = ['pomegranate>=0.15,<1.0']
5864
xgboost = ['xgboost>=2.1.3']

sdmetrics/single_table/bayesian_network.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def _likelihoods(cls, real_data, synthetic_data, metadata=None, structure=None):
2020
from pomegranate import BayesianNetwork
2121
except ImportError:
2222
raise ImportError(
23-
'Please install pomegranate with `pip install sdmetrics[pomegranate]`'
23+
'Please install pomegranate with `pip install sdmetrics[pomegranate]`. '
24+
'Python 3.13 is not supported.'
2425
)
2526

2627
real_data, synthetic_data, metadata = cls._validate_inputs(

tests/unit/single_table/test_bayesian_network.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def test_compute(self, bad_pomegranate):
2424
metric = BNLikelihood()
2525

2626
# Act and Assert
27-
expected_message = r'Please install pomegranate with `pip install sdmetrics\[pomegranate\]`'
27+
expected_message = r'Please install pomegranate with `pip install sdmetrics\[pomegranate\]`\. Python 3\.13 is not supported\.'
2828
with pytest.raises(ImportError, match=expected_message):
2929
metric.compute(Mock(), Mock())
3030

@@ -36,6 +36,6 @@ def test_compute(self, bad_pomegranate):
3636
metric = BNLogLikelihood()
3737

3838
# Act and Assert
39-
expected_message = r'Please install pomegranate with `pip install sdmetrics\[pomegranate\]`'
39+
expected_message = r'Please install pomegranate with `pip install sdmetrics\[pomegranate\]`\. Python 3\.13 is not supported\.'
4040
with pytest.raises(ImportError, match=expected_message):
4141
metric.compute(Mock(), Mock())

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py39-lint, py3{8,9,10,11,12}-{readme,integration,unit,minimum}
2+
envlist = py39-lint, py3{8,9,10,11,12,13}-{readme,integration,unit,minimum}
33

44
[testenv]
55
skipsdist = false

0 commit comments

Comments
 (0)