Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Python 3.13 #549

Merged
merged 11 commits into from
Nov 12, 2024
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
steps:
- uses: actions/checkout@v4
- name: create build environment
Expand Down Expand Up @@ -55,6 +56,8 @@ jobs:
python-version:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
steps:
- uses: actions/checkout@v4
- name: create build environment
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ dependencies:
- pygmo>=2.19.0 # dev, tests
- jupyterlab # dev, docs
- nlopt # dev, tests, docs
- pdbpp # dev
- pip # dev, tests, docs
- pytest # dev, tests
- pytest-cov # tests
Expand Down Expand Up @@ -51,3 +50,4 @@ dependencies:
- types-jinja2 # dev, tests
- sqlalchemy-stubs # dev, tests
- sphinxcontrib-mermaid # dev, tests, docs
- pdbp # dev
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
]
authors = [
Expand Down Expand Up @@ -183,7 +184,7 @@ filterwarnings = [
"ignore:The following exception was caught when calculating",
"ignore:Usage of the parameter log_options",
]
addopts = ["--doctest-modules"]
addopts = ["--doctest-modules", "--pdbcls=pdbp:Pdb"]
markers = [
"wip: Tests that are work-in-progress.",
"slow: Tests that take a long time to run and are skipped in continuous integration.",
Expand All @@ -195,9 +196,6 @@ norecursedirs = ["docs", ".tools"]
# ======================================================================================
# Misc configuration
# ======================================================================================
[tool.pytask]
infer_latex_dependencies = true

[tool.yamlfix]
line_length = 88
sequence_style = "block_style"
Expand Down Expand Up @@ -379,5 +377,6 @@ module = [
"pathos.pools",
"optimagic._version",
"annotated_types",
"pdbp",
]
ignore_missing_imports = true
6 changes: 6 additions & 0 deletions src/estimagic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import contextlib
import warnings
from dataclasses import dataclass

try:
import pdbp # noqa: F401
except ImportError:
contextlib.suppress(Exception)

from estimagic import utilities
from estimagic.bootstrap import BootstrapResult, bootstrap
from estimagic.estimate_ml import LikelihoodResult, estimate_ml
Expand Down
7 changes: 7 additions & 0 deletions src/optimagic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
from __future__ import annotations

import contextlib

try:
import pdbp # noqa: F401
except ImportError:
contextlib.suppress(Exception)

from optimagic import constraints, mark, utilities
from optimagic.algorithms import algos
from optimagic.benchmarking.benchmark_reports import (
Expand Down