Skip to content

Commit dbf1504

Browse files
committed
Remove GraalPy configuration properties and related options for simplification and cleanup.
1 parent 53299d7 commit dbf1504

File tree

4 files changed

+2
-126
lines changed

4 files changed

+2
-126
lines changed

executor/graalpy/python-executor-graalpy-executor-autoconfigure/src/main/java/io/maksymuimanov/python/autoconfigure/GraalPyProperties.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,6 @@ public class GraalPyProperties {
1919
* Defines the variable name of the result returned from Python to Java.
2020
*/
2121
private String resultAppearance = "r4java";
22-
/**
23-
* Path to GraalPy core library.
24-
*/
25-
private String coreHome = "";
26-
/**
27-
* Path to Python home or virtual environment.
28-
*/
29-
private String pythonHome = "";
30-
/**
31-
* How to check .pyc hash files ("default", "never").
32-
*/
33-
private String checkHashPycsMode = "default";
34-
/**
35-
* Whether to show experimental feature warnings.
36-
*/
37-
private boolean warningExperimentalFeatures = false;
38-
/**
39-
* POSIX module backend ("native" or "java").
40-
*/
41-
private String posixModuleBackend = "native";
42-
/**
43-
* Python executable path identifier.
44-
*/
45-
private String executable = "";
46-
/**
47-
* The sys.base_prefix override.
48-
*/
49-
private String sysBasePrefix = "";
5022
/**
5123
* Defines host access level for GraalPy scripts.
5224
*/

executor/graalpy/python-executor-graalpy-executor-autoconfigure/src/main/java/io/maksymuimanov/python/autoconfigure/GraalPythonExecutorAutoConfiguration.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@ public class GraalPythonExecutorAutoConfiguration {
1717
@ConditionalOnMissingBean(GraalInterpreterFactory.class)
1818
public GraalInterpreterFactory graalInterpreterFactory(GraalPyProperties properties) {
1919
return new GraalInterpreterFactory(
20-
properties.getCoreHome(),
21-
properties.getPythonHome(),
22-
properties.getCheckHashPycsMode(),
23-
properties.isWarningExperimentalFeatures(),
24-
properties.getPosixModuleBackend(),
25-
properties.getExecutable(),
26-
properties.getSysBasePrefix(),
2720
properties.getHostAccess().getValue(),
2821
properties.isAllowValueSharing(),
2922
properties.isAllowExperimentalOptions(),

executor/graalpy/python-executor-graalpy-executor-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -20,48 +20,6 @@
2020
"defaultValue": "r4java",
2121
"description": "Defines the variable name of the result returned from Python to Java."
2222
},
23-
{
24-
"name": "spring.python.executor.graalpy.core-home",
25-
"type": "java.lang.String",
26-
"defaultValue": "",
27-
"description": "Path to the GraalPy core library directory."
28-
},
29-
{
30-
"name": "spring.python.executor.graalpy.python-home",
31-
"type": "java.lang.String",
32-
"defaultValue": "",
33-
"description": "Path to the Python home or virtual environment used by GraalPy."
34-
},
35-
{
36-
"name": "spring.python.executor.graalpy.check-hash-pycs-mode",
37-
"type": "java.lang.String",
38-
"defaultValue": "default",
39-
"description": "Sets the method used to validate .pyc file hashes (e.g., \"default\", \"never\")."
40-
},
41-
{
42-
"name": "spring.python.executor.graalpy.warning-experimental-features",
43-
"type": "java.lang.Boolean",
44-
"defaultValue": false,
45-
"description": "Enables or disables warnings for experimental GraalPy features."
46-
},
47-
{
48-
"name": "spring.python.executor.graalpy.posix-module-backend",
49-
"type": "java.lang.String",
50-
"defaultValue": "native",
51-
"description": "Defines the POSIX module backend implementation (\"native\" or \"java\")."
52-
},
53-
{
54-
"name": "spring.python.executor.graalpy.executable",
55-
"type": "java.lang.String",
56-
"defaultValue": "",
57-
"description": "The Python executable identifier exposed inside the GraalPy context."
58-
},
59-
{
60-
"name": "spring.python.executor.graalpy.sys-base-prefix",
61-
"type": "java.lang.String",
62-
"defaultValue": "",
63-
"description": "Overrides the sys.base_prefix value in the GraalPy runtime."
64-
},
6523
{
6624
"name": "spring.python.executor.graalpy.host-access",
6725
"type": "io.maksymuimanov.python.autoconfigure.GraalPyProperties$HostAccessHolder",
@@ -96,32 +54,6 @@
9654
}
9755
]
9856
},
99-
{
100-
"name": "spring.python.executor.graalpy.check-hash-pycs-mode",
101-
"values": [
102-
{
103-
"value": "default",
104-
"description": "Use GraalPy’s default .pyc hash checking mode."
105-
},
106-
{
107-
"value": "never",
108-
"description": "Disable .pyc hash checking completely."
109-
}
110-
]
111-
},
112-
{
113-
"name": "spring.python.executor.graalpy.posix-module-backend",
114-
"values": [
115-
{
116-
"value": "native",
117-
"description": "Use the default native POSIX backend (recommended)."
118-
},
119-
{
120-
"value": "java",
121-
"description": "Use the Java-based POSIX backend instead of the native one."
122-
}
123-
]
124-
},
12557
{
12658
"name": "spring.python.executor.graalpy.host-access",
12759
"values": [

executor/graalpy/python-executor-graalpy-executor-core/src/main/java/io/maksymuimanov/python/interpreter/GraalInterpreterFactory.java

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,6 @@
1010

1111
@RequiredArgsConstructor
1212
public class GraalInterpreterFactory implements PythonInterpreterFactory<Context> {
13-
public static final String PYTHON_CORE_HOME = "python.CoreHome";
14-
public static final String PYTHON_HOME = "python.PythonHome";
15-
public static final String PYTHON_CHECK_HASH_PYCS_MODE = "python.CheckHashPycsMode";
16-
public static final String PYTHON_WARNING_EXPERIMENTAL_FEATURES = "python.WarningExperimentalFeatures";
17-
public static final String PYTHON_POSIX_MODULE_BACKEND = "python.PosixModuleBackend";
18-
public static final String PYTHON_EXECUTABLE = "python.Executable";
19-
public static final String PYTHON_SYS_BASE_PREFIX = "python.SysBasePrefix";
20-
private final String coreHome;
21-
private final String pythonHome;
22-
private final String checkHashPycsMode;
23-
private final boolean warningExperimentalFeatures;
24-
private final String posixModuleBackend;
25-
private final String executable;
26-
private final String sysBasePrefix;
2713
private final HostAccess hostAccess;
2814
private final boolean allowValueSharing;
2915
private final boolean allowExperimentalOptions;
@@ -32,27 +18,20 @@ public class GraalInterpreterFactory implements PythonInterpreterFactory<Context
3218
@Override
3319
public Context create() {
3420
Context.Builder builder = Context.newBuilder(GraalPythonExecutor.PYTHON);
35-
this.putOption(builder, PYTHON_CORE_HOME, this.coreHome);
36-
this.putOption(builder, PYTHON_HOME, this.pythonHome);
37-
this.putOption(builder, PYTHON_CHECK_HASH_PYCS_MODE, this.checkHashPycsMode);
38-
this.putOption(builder, PYTHON_WARNING_EXPERIMENTAL_FEATURES, String.valueOf(this.warningExperimentalFeatures));
39-
this.putOption(builder, PYTHON_POSIX_MODULE_BACKEND, this.posixModuleBackend);
40-
this.putOption(builder, PYTHON_EXECUTABLE, this.executable);
41-
this.putOption(builder, PYTHON_SYS_BASE_PREFIX, this.sysBasePrefix);
4221
builder.allowHostAccess(this.hostAccess);
4322
builder.allowValueSharing(this.allowValueSharing);
4423
builder.allowExperimentalOptions(this.allowExperimentalOptions);
4524
this.putProperties(builder, this.additionalOptions);
4625
return builder.build();
4726
}
4827

49-
private void putProperties(Context.Builder builder, @Nullable Properties properties) {
28+
protected void putProperties(Context.Builder builder, @Nullable Properties properties) {
5029
if (properties != null && !properties.isEmpty()) {
5130
properties.forEach((key, value) -> this.putOption(builder, key.toString(), value.toString()));
5231
}
5332
}
5433

55-
private void putOption(Context.Builder builder, String key, @Nullable String value) {
34+
protected void putOption(Context.Builder builder, String key, @Nullable String value) {
5635
if (value != null && !value.isBlank()) {
5736
builder.option(key, value);
5837
}

0 commit comments

Comments
 (0)