Skip to content

Commit c304215

Browse files
chore: Rename files to prevent them from being included in star imports (#35)
1 parent fb72d9c commit c304215

26 files changed

+56
-56
lines changed

timefold-solver-python-core/src/main/python/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import timefold.solver.test as test
1515
import timefold.solver.valuerange as valuerange
1616

17-
from .timefold_java_interop import init, set_class_output_directory
17+
from ._timefold_java_interop import init, set_class_output_directory
1818

1919
__all__ = [# Subpackages
2020
'api', 'annotation', 'config', 'constraint', 'test', 'valuerange',

timefold-solver-python-core/src/main/python/jpype_type_conversions.py renamed to timefold-solver-python-core/src/main/python/_jpype_type_conversions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def _convert_to_java_compatible_object(item):
197197

198198
@JConversion('java.lang.Class', exact=type)
199199
def _convert_type_to_class(jcls, type_obj):
200-
from .timefold_java_interop import get_class
200+
from ._timefold_java_interop import get_class
201201
from java.lang import Object
202202
out = get_class(type_obj)
203203
if out == Object and type_obj != Object:
@@ -209,7 +209,7 @@ def _convert_type_to_class(jcls, type_obj):
209209

210210
@JConversion('java.lang.Class', exact=FunctionType)
211211
def _convert_function_to_class(jcls, function_obj):
212-
from .timefold_java_interop import get_class
212+
from ._timefold_java_interop import get_class
213213
from java.lang import Object
214214
out = get_class(function_obj)
215215
if out == Object and function_obj != Object:

timefold-solver-python-core/src/main/python/timefold_java_interop.py renamed to timefold-solver-python-core/src/main/python/_timefold_java_interop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from jpype.types import *
55
import importlib.resources
66
from typing import cast, List, Type, TypeVar, Callable, Union, TYPE_CHECKING
7-
from .jpype_type_conversions import PythonSupplier, ConstraintProviderFunction
7+
from ._jpype_type_conversions import PythonSupplier, ConstraintProviderFunction
88

99
if TYPE_CHECKING:
1010
# These imports require a JVM to be running, so only import if type checking
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from .annotations import *
1+
from ._annotations import *

timefold-solver-python-core/src/main/python/annotation/annotations.py renamed to timefold-solver-python-core/src/main/python/annotation/_annotations.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import jpype
22

33
from ..constraint import ConstraintFactory
4-
from ..timefold_java_interop import ensure_init, _generate_constraint_provider_class, register_java_class
4+
from .._timefold_java_interop import ensure_init, _generate_constraint_provider_class, register_java_class
55
from jpyinterpreter import JavaAnnotation
66
from jpype import JImplements, JOverride
77
from typing import Union, List, Callable, Type, TYPE_CHECKING, TypeVar
@@ -79,7 +79,7 @@ def __init__(self, *,
7979
source_variable_name: str,
8080
source_entity_class: Type = None):
8181
ensure_init()
82-
from ..timefold_java_interop import get_class
82+
from .._timefold_java_interop import get_class
8383
from ai.timefold.jpyinterpreter import PythonClassTranslator
8484
from ai.timefold.solver.core.api.domain.variable import (
8585
ShadowVariable as JavaShadowVariable)
@@ -229,7 +229,7 @@ def __init__(self, a_list):
229229
from ai.timefold.solver.core.api.domain.entity import PlanningEntity as JavaPlanningEntity
230230

231231
def planning_entity_wrapper(entity_class_argument):
232-
from ..timefold_java_interop import _generate_planning_entity_class
232+
from .._timefold_java_interop import _generate_planning_entity_class
233233
from ai.timefold.solver.core.api.domain.entity import PinningFilter
234234
from jpyinterpreter import add_class_annotation, translate_python_bytecode_to_java_bytecode
235235
from typing import get_type_hints, get_origin, Annotated
@@ -294,7 +294,7 @@ def __init__(self, a_list):
294294
"""
295295
ensure_init()
296296
from jpyinterpreter import add_class_annotation
297-
from ..timefold_java_interop import _generate_planning_solution_class
297+
from .._timefold_java_interop import _generate_planning_solution_class
298298
from ai.timefold.solver.core.api.domain.solution import PlanningSolution as JavaPlanningSolution
299299
out = add_class_annotation(JavaPlanningSolution)(planning_solution_class)
300300
_generate_planning_solution_class(planning_solution_class)
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from .problem_change import *
2-
from .solver import *
3-
from .solver_factory import *
4-
from .solver_manager import *
5-
from .solution_manager import *
1+
from ._problem_change import *
2+
from ._solver import *
3+
from ._solver_factory import *
4+
from ._solver_manager import *
5+
from ._solution_manager import *

timefold-solver-python-core/src/main/python/api/future.py renamed to timefold-solver-python-core/src/main/python/api/_future.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from ..jpype_type_conversions import PythonBiFunction
1+
from .._jpype_type_conversions import PythonBiFunction
22
from typing import Awaitable, TypeVar, TYPE_CHECKING
33
from asyncio import Future, get_event_loop, CancelledError
44

timefold-solver-python-core/src/main/python/api/problem_change.py renamed to timefold-solver-python-core/src/main/python/api/_problem_change.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from ..timefold_java_interop import get_class
1+
from .._timefold_java_interop import get_class
22

33
from abc import ABC, abstractmethod
44
from typing import TypeVar, Optional, Callable, TYPE_CHECKING, Generic

timefold-solver-python-core/src/main/python/api/solution_manager.py renamed to timefold-solver-python-core/src/main/python/api/_solution_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from .solver_factory import SolverFactory
2-
from ..timefold_java_interop import get_class
1+
from ._solver_factory import SolverFactory
2+
from .._timefold_java_interop import get_class
33

44
from typing import TypeVar, Union, TYPE_CHECKING
55

0 commit comments

Comments
 (0)