Skip to content

Commit 5713499

Browse files
ywatanabe1989claude
andcommitted
feat(#206): add 11 standalone packages as dependencies, clean direct imports
All 11 packages from #51 refactoring are now published on PyPI: scitex-core, scitex-db, scitex-scholar, scitex-parallel, scitex-types, scitex-path, scitex-repro, scitex-compat, scitex-etc, scitex-gists, scitex-audit. Reverted try/except fallbacks to clean direct imports (no-fallbacks rule). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b110cc8 commit 5713499

9 files changed

Lines changed: 70 additions & 189 deletions

File tree

pyproject.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,18 @@ dependencies = [
7070
"scitex-stats>=0.2.0",
7171
"scitex-audio>=0.1.0",
7272
"scitex-notification>=0.1.0",
73+
# Delegated modules from #51 standalonization
74+
"scitex-core>=0.2.0",
75+
"scitex-db>=0.1.0",
76+
"scitex-scholar>=0.1.0",
77+
"scitex-parallel>=0.1.0",
78+
"scitex-types>=0.1.0",
79+
"scitex-path>=0.1.0",
80+
"scitex-repro>=0.1.0",
81+
"scitex-compat>=0.1.0",
82+
"scitex-etc>=0.1.0",
83+
"scitex-gists>=0.1.0",
84+
"scitex-audit>=0.1.0",
7385
]
7486

7587
[project.urls]

src/scitex/audit/__init__.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
#!/usr/bin/env python3
2-
"""SciTeX audit module — delegates to scitex-audit if available."""
2+
"""SciTeX audit module — delegates to scitex-audit."""
33

4-
try:
5-
from scitex_audit import audit
6-
7-
_BACKEND = "scitex-audit"
8-
except ImportError:
9-
from ._runner import audit
10-
11-
_BACKEND = "local"
4+
from scitex_audit import audit
125

136
__all__ = ["audit"]
147

src/scitex/compat/__init__.py

Lines changed: 2 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,7 @@
11
#!/usr/bin/env python3
2-
"""SciTeX compat module — delegates to scitex-compat if available."""
2+
"""SciTeX compat module — delegates to scitex-compat."""
33

4-
from __future__ import annotations
5-
6-
import warnings
7-
from functools import wraps
8-
from typing import Callable
9-
10-
try:
11-
from scitex_compat import deprecated, notify, notify_async
12-
13-
_BACKEND = "scitex-compat"
14-
except ImportError:
15-
16-
def deprecated(new_name: str, removal_version: str = "2.0"):
17-
"""Decorator to mark functions as deprecated."""
18-
19-
def decorator(func: Callable) -> Callable:
20-
@wraps(func)
21-
def wrapper(*args, **kwargs):
22-
warnings.warn(
23-
f"{func.__name__} is deprecated. "
24-
f"Use {new_name} instead. "
25-
f"Will be removed in v{removal_version}.",
26-
DeprecationWarning,
27-
stacklevel=2,
28-
)
29-
return func(*args, **kwargs)
30-
31-
return wrapper
32-
33-
return decorator
34-
35-
def notify(*args, **kwargs):
36-
"""Deprecated: Use scitex.notify.alert() instead."""
37-
warnings.warn(
38-
"scitex.compat.notify is deprecated. Use scitex.notify.alert instead.",
39-
DeprecationWarning,
40-
stacklevel=2,
41-
)
42-
from scitex.notify import alert
43-
44-
return alert(*args, **kwargs)
45-
46-
async def notify_async(*args, **kwargs):
47-
"""Deprecated: Use scitex.notify.alert_async() instead."""
48-
warnings.warn(
49-
"scitex.compat.notify_async is deprecated. Use scitex.notify.alert_async instead.",
50-
DeprecationWarning,
51-
stacklevel=2,
52-
)
53-
from scitex.notify import alert_async
54-
55-
return await alert_async(*args, **kwargs)
56-
57-
_BACKEND = "local"
4+
from scitex_compat import deprecated, notify, notify_async
585

596
__all__ = [
607
"deprecated",

src/scitex/etc/__init__.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
#!/usr/bin/env python3
2-
"""SciTeX etc module — delegates to scitex-etc if available."""
2+
"""SciTeX etc module — delegates to scitex-etc."""
33

4-
try:
5-
from scitex_etc import count, wait_key
6-
7-
_BACKEND = "scitex-etc"
8-
except ImportError:
9-
from .wait_key import count, wait_key
10-
11-
_BACKEND = "local"
4+
from scitex_etc import count, wait_key
125

136
__all__ = ["wait_key", "count"]
147

src/scitex/gists/__init__.py

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
11
#!/usr/bin/env python3
2-
"""SciTeX gists module — delegates to scitex-gists if available."""
2+
"""SciTeX gists module — delegates to scitex-gists."""
33

4-
try:
5-
from scitex_gists import (
6-
SigMacro_processFigure_S,
7-
SigMacro_toBlue,
8-
sigmacro_process_figure_s,
9-
sigmacro_to_blue,
10-
)
11-
12-
_BACKEND = "scitex-gists"
13-
except ImportError:
14-
from ._SigMacro_processFigure_S import (
15-
SigMacro_processFigure_S,
16-
sigmacro_process_figure_s,
17-
)
18-
from ._SigMacro_toBlue import SigMacro_toBlue, sigmacro_to_blue
19-
20-
_BACKEND = "local"
4+
from scitex_gists import (
5+
SigMacro_processFigure_S,
6+
SigMacro_toBlue,
7+
sigmacro_process_figure_s,
8+
sigmacro_to_blue,
9+
)
2110

2211
__all__ = [
2312
"SigMacro_processFigure_S",

src/scitex/parallel/__init__.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
#!/usr/bin/env python3
2-
"""SciTeX parallel module — delegates to scitex-parallel if available."""
2+
"""SciTeX parallel module — delegates to scitex-parallel."""
33

4-
try:
5-
from scitex_parallel import run
6-
7-
_BACKEND = "scitex-parallel"
8-
except ImportError:
9-
from ._run import run
10-
11-
_BACKEND = "local"
4+
from scitex_parallel import run
125

136
__all__ = [
147
"run",

src/scitex/path/__init__.py

Lines changed: 24 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,29 @@
11
#!/usr/bin/env python3
2-
"""SciTeX path module — delegates to scitex-path if available."""
2+
"""SciTeX path module — delegates to scitex-path."""
33

4-
try:
5-
from scitex_path import (
6-
clean,
7-
create_relative_symlink,
8-
find_dir,
9-
find_file,
10-
find_git_root,
11-
find_latest,
12-
fix_broken_symlinks,
13-
get_data_path_from_a_package,
14-
get_spath,
15-
get_this_path,
16-
getsize,
17-
increment_version,
18-
is_symlink,
19-
list_symlinks,
20-
mk_spath,
21-
readlink,
22-
resolve_symlinks,
23-
split,
24-
symlink,
25-
this_path,
26-
unlink_symlink,
27-
)
28-
29-
_BACKEND = "scitex-path"
30-
except ImportError:
31-
from ._clean import clean
32-
from ._find import find_dir, find_file, find_git_root
33-
from ._get_module_path import get_data_path_from_a_package
34-
from ._get_spath import get_spath
35-
from ._getsize import getsize
36-
from ._increment_version import increment_version
37-
from ._mk_spath import mk_spath
38-
from ._path import get_this_path, this_path
39-
from ._split import split
40-
from ._symlink import (
41-
create_relative_symlink,
42-
fix_broken_symlinks,
43-
is_symlink,
44-
list_symlinks,
45-
readlink,
46-
resolve_symlinks,
47-
symlink,
48-
unlink_symlink,
49-
)
50-
from ._this_path import get_this_path, this_path # noqa: F811
51-
from ._version import find_latest, increment_version # noqa: F811
52-
53-
_BACKEND = "local"
4+
from scitex_path import (
5+
clean,
6+
create_relative_symlink,
7+
find_dir,
8+
find_file,
9+
find_git_root,
10+
find_latest,
11+
fix_broken_symlinks,
12+
get_data_path_from_a_package,
13+
get_spath,
14+
get_this_path,
15+
getsize,
16+
increment_version,
17+
is_symlink,
18+
list_symlinks,
19+
mk_spath,
20+
readlink,
21+
resolve_symlinks,
22+
split,
23+
symlink,
24+
this_path,
25+
unlink_symlink,
26+
)
5427

5528
__all__ = [
5629
"clean",

src/scitex/repro/__init__.py

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
"""SciTeX repro module — delegates to scitex-repro if available.
2+
"""SciTeX repro module — delegates to scitex-repro.
33
44
Provides tools for reproducible scientific computing:
55
- Random state management (RandomStateManager)
@@ -8,26 +8,16 @@
88
- Array hashing (hash_array)
99
"""
1010

11-
try:
12-
from scitex_repro import (
13-
RandomStateManager,
14-
gen_ID,
15-
gen_id,
16-
gen_timestamp,
17-
get,
18-
hash_array,
19-
reset,
20-
timestamp,
21-
)
22-
23-
_BACKEND = "scitex-repro"
24-
except ImportError:
25-
from ._gen_ID import gen_ID, gen_id
26-
from ._gen_timestamp import gen_timestamp, timestamp
27-
from ._hash_array import hash_array
28-
from ._RandomStateManager import RandomStateManager, get, reset
29-
30-
_BACKEND = "local"
11+
from scitex_repro import (
12+
RandomStateManager,
13+
gen_ID,
14+
gen_id,
15+
gen_timestamp,
16+
get,
17+
hash_array,
18+
reset,
19+
timestamp,
20+
)
3121

3222

3323
# Legacy function for backward compatibility (user-confirmed fallback)

src/scitex/types/__init__.py

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
11
#!/usr/bin/env python3
2-
"""SciTeX types module — delegates to scitex-types if available."""
2+
"""SciTeX types module — delegates to scitex-types."""
33

4-
try:
5-
from scitex_types import (
6-
ArrayLike,
7-
ColorLike,
8-
is_array_like,
9-
is_list_of_type,
10-
is_listed_X,
11-
)
12-
13-
_BACKEND = "scitex-types"
14-
except ImportError:
15-
from ._ArrayLike import ArrayLike, is_array_like
16-
from ._ColorLike import ColorLike
17-
from ._is_listed_X import is_list_of_type, is_listed_X
18-
19-
_BACKEND = "local"
4+
from scitex_types import (
5+
ArrayLike,
6+
ColorLike,
7+
is_array_like,
8+
is_list_of_type,
9+
is_listed_X,
10+
)
2011

2112
__all__ = [
2213
"ArrayLike",

0 commit comments

Comments
 (0)