From 0cac06429538ea683c4769c071c71b01e38b7612 Mon Sep 17 00:00:00 2001 From: Tim Mensinger Date: Thu, 7 Nov 2024 17:00:11 +0100 Subject: [PATCH] Use pdbp instead of pdbpp --- environment.yml | 2 +- pyproject.toml | 3 ++- src/estimagic/__init__.py | 6 ++++++ src/optimagic/__init__.py | 7 +++++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/environment.yml b/environment.yml index da24f2ee1..89514bbba 100644 --- a/environment.yml +++ b/environment.yml @@ -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 @@ -51,3 +50,4 @@ dependencies: - types-jinja2 # dev, tests - sqlalchemy-stubs # dev, tests - sphinxcontrib-mermaid # dev, tests, docs + - pdbp # dev diff --git a/pyproject.toml b/pyproject.toml index 9ff79ea1e..442daa7e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -184,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", "-s"] markers = [ "wip: Tests that are work-in-progress.", "slow: Tests that take a long time to run and are skipped in continuous integration.", @@ -380,5 +380,6 @@ module = [ "pathos.pools", "optimagic._version", "annotated_types", + "pdbp", ] ignore_missing_imports = true diff --git a/src/estimagic/__init__.py b/src/estimagic/__init__.py index 44a640486..056f823e4 100644 --- a/src/estimagic/__init__.py +++ b/src/estimagic/__init__.py @@ -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 diff --git a/src/optimagic/__init__.py b/src/optimagic/__init__.py index 28e912234..e1cbd6a3c 100644 --- a/src/optimagic/__init__.py +++ b/src/optimagic/__init__.py @@ -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 (