Skip to content

Commit d990e74

Browse files
tomswinburneclaude
andcommitted
Add backwards-compatible POPSRegression import shim
Allows existing code using `from POPSRegression import POPSRegression` to continue working after the rename to popsregression, with a DeprecationWarning pointing users to the new import path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2792792 commit d990e74

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

POPSRegression.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Backwards compatibility shim. Remove in a future release.
2+
import warnings
3+
4+
warnings.warn(
5+
"Importing from 'POPSRegression' is deprecated. "
6+
"Use 'from popsregression import POPSRegression' instead.",
7+
DeprecationWarning,
8+
stacklevel=2,
9+
)
10+
11+
from popsregression import POPSRegression # noqa: F401, E402
12+
13+
__all__ = ["POPSRegression"]

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ classifiers = [
3434
Homepage = "https://github.com/tomswinburne/popsregression"
3535
Issues = "https://github.com/tomswinburne/popsregression/issues"
3636

37+
[tool.setuptools]
38+
py-modules = ["POPSRegression"]
39+
3740
[tool.setuptools_scm]
3841
version_file = "popsregression/_version.py"
3942

0 commit comments

Comments
 (0)