platynui-provider-java 0.13.0.dev117__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- platynui_provider_java/__init__.py +53 -0
- platynui_provider_java/__main__.py +36 -0
- platynui_provider_java/__version__.py +1 -0
- platynui_provider_java/agent/README.md +4 -0
- platynui_provider_java/agent/platynui-agent.jar +0 -0
- platynui_provider_java-0.13.0.dev117.dist-info/METADATA +75 -0
- platynui_provider_java-0.13.0.dev117.dist-info/RECORD +9 -0
- platynui_provider_java-0.13.0.dev117.dist-info/WHEEL +4 -0
- platynui_provider_java-0.13.0.dev117.dist-info/entry_points.txt +6 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"""Delivery package for PlatynUI's in-JVM Java agent.
|
|
2
|
+
|
|
3
|
+
This package carries one artifact — ``platynui-agent.jar``, the agent PlatynUI loads into a target
|
|
4
|
+
JVM to read Swing/JavaFX/SWT models from the inside. It contains no automation logic of its own.
|
|
5
|
+
|
|
6
|
+
**Installing it is the consent for in-JVM instrumentation.** Without it, PlatynUI reports Java agent
|
|
7
|
+
support as unavailable and instruments nothing; uninstalling removes the capability entirely. That
|
|
8
|
+
is why it is a separate package rather than a flag: an environment either has the artifact or it
|
|
9
|
+
does not, and that decision is visible in the environment's own dependency list.
|
|
10
|
+
|
|
11
|
+
The JAR is platform- and Python-version-neutral, so this is a ``py3-none-any`` wheel — it is not
|
|
12
|
+
duplicated into the per-platform native wheels, and building those needs no JDK.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
|
|
17
|
+
from .__version__ import __version__
|
|
18
|
+
|
|
19
|
+
__all__ = ['__version__', 'agent_jar', 'provider_info']
|
|
20
|
+
|
|
21
|
+
#: Where the JAR sits inside the installed package.
|
|
22
|
+
_AGENT_JAR = Path(__file__).parent / 'agent' / 'platynui-agent.jar'
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def agent_jar() -> Path:
|
|
26
|
+
"""Return the path of the bundled agent JAR.
|
|
27
|
+
|
|
28
|
+
Raises:
|
|
29
|
+
FileNotFoundError: if the package was assembled without its artifact. That is a broken
|
|
30
|
+
install rather than a missing feature, so it is reported loudly instead of being
|
|
31
|
+
reported as "no Java support".
|
|
32
|
+
"""
|
|
33
|
+
if not _AGENT_JAR.is_file():
|
|
34
|
+
msg = (
|
|
35
|
+
f'the PlatynUI agent JAR is missing from this installation (expected at {_AGENT_JAR}) — '
|
|
36
|
+
'reinstall platynui-provider-java'
|
|
37
|
+
)
|
|
38
|
+
raise FileNotFoundError(msg)
|
|
39
|
+
return _AGENT_JAR
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def provider_info() -> dict[str, str]:
|
|
43
|
+
"""Return what a PlatynUI runtime needs to use this package.
|
|
44
|
+
|
|
45
|
+
This is the target of the ``platynui.providers`` entry point, and the one shape both discovery
|
|
46
|
+
transports read: the in-process lookup calls it directly, the standalone binaries call it
|
|
47
|
+
through a one-shot query in the environment's own interpreter.
|
|
48
|
+
|
|
49
|
+
The version travels with the path on purpose. Provider and agent must match **exactly** — an
|
|
50
|
+
agent cannot be unloaded from a JVM, so a mismatch has exactly one remedy (restart the
|
|
51
|
+
application) and is worth catching before a connection rather than mid-test.
|
|
52
|
+
"""
|
|
53
|
+
return {'agent_jar': str(agent_jar()), 'version': __version__}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"""``platynui-provider-java`` — tell the operator where the agent JAR is.
|
|
2
|
+
|
|
3
|
+
PlatynUI finds the JAR by itself; this command exists for the case PlatynUI cannot help with: a
|
|
4
|
+
target JVM where dynamic attach is blocked, so the agent has to be put on the launch command line
|
|
5
|
+
by hand.
|
|
6
|
+
|
|
7
|
+
java -javaagent:$(platynui-provider-java agent-path) -jar theirapp.jar
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import argparse
|
|
11
|
+
import json
|
|
12
|
+
import sys
|
|
13
|
+
|
|
14
|
+
from . import agent_jar, provider_info
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def main(argv: list[str] | None = None) -> int:
|
|
18
|
+
parser = argparse.ArgumentParser(prog='platynui-provider-java', description=__doc__.splitlines()[0])
|
|
19
|
+
subcommands = parser.add_subparsers(dest='command', required=True)
|
|
20
|
+
subcommands.add_parser('agent-path', help='print the path of the bundled agent JAR')
|
|
21
|
+
subcommands.add_parser('info', help='print the provider manifest as JSON')
|
|
22
|
+
|
|
23
|
+
arguments = parser.parse_args(argv)
|
|
24
|
+
try:
|
|
25
|
+
if arguments.command == 'agent-path':
|
|
26
|
+
print(agent_jar())
|
|
27
|
+
else:
|
|
28
|
+
print(json.dumps(provider_info()))
|
|
29
|
+
except FileNotFoundError as error:
|
|
30
|
+
print(error, file=sys.stderr)
|
|
31
|
+
return 1
|
|
32
|
+
return 0
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
if __name__ == '__main__':
|
|
36
|
+
sys.exit(main())
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '0.13.0-dev.117'
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# The agent JAR is a build artifact: `just build-provider-java` stages it here
|
|
2
|
+
# from java/agent/build/libs/. It is deliberately not checked in — the JAR must
|
|
3
|
+
# always match the sources it was built from, and a stale committed copy would
|
|
4
|
+
# be the one thing the exact-version handshake cannot catch.
|
|
Binary file
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: platynui-provider-java
|
|
3
|
+
Version: 0.13.0.dev117
|
|
4
|
+
Summary: In-JVM agent artifact enabling PlatynUI's Java UI toolkit support
|
|
5
|
+
Author: Daniel Biehl
|
|
6
|
+
Author-email: Daniel Biehl <daniel.biehl@imbus.de>
|
|
7
|
+
Classifier: Development Status :: 3 - Alpha
|
|
8
|
+
Classifier: Intended Audience :: Developers
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Classifier: Programming Language :: Java
|
|
14
|
+
Classifier: Topic :: Software Development :: Testing
|
|
15
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
16
|
+
Classifier: Framework :: Robot Framework
|
|
17
|
+
Classifier: Framework :: Robot Framework :: Library
|
|
18
|
+
Requires-Python: >=3.12
|
|
19
|
+
Project-URL: Homepage, https://github.com/imbus/robotframework-PlatynUI
|
|
20
|
+
Project-URL: Documentation, https://github.com/imbus/robotframework-PlatynUI#readme
|
|
21
|
+
Project-URL: Changelog, https://github.com/imbus/robotframework-PlatynUI/blob/main/CHANGELOG.md
|
|
22
|
+
Project-URL: Issues, https://github.com/imbus/robotframework-PlatynUI/issues
|
|
23
|
+
Project-URL: Source, https://github.com/imbus/robotframework-PlatynUI
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
# platynui-provider-java
|
|
27
|
+
|
|
28
|
+
Delivery package for PlatynUI's **in-JVM Java agent** — the artifact PlatynUI loads into a target
|
|
29
|
+
JVM to read Swing, JavaFX and SWT models from the inside, past what native accessibility exposes.
|
|
30
|
+
|
|
31
|
+
It carries exactly one thing: `platynui-agent.jar`. No automation logic, no dependencies.
|
|
32
|
+
|
|
33
|
+
## Installing it is the consent
|
|
34
|
+
|
|
35
|
+
Java agent support is opt-in **by installation**. Without this package PlatynUI reports Java agent
|
|
36
|
+
support as unavailable and instruments nothing; uninstalling removes the capability. That is why it
|
|
37
|
+
is a separate package rather than a flag — an environment either has the artifact or it does not,
|
|
38
|
+
and that decision is visible in its own dependency list.
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
pip install "robotframework-PlatynUI[java]" # for a test run
|
|
42
|
+
pip install "platynui-inspector[java]" # for the Inspector
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Both extras pin this package to the exact matching version. That is not pedantry: an agent cannot
|
|
46
|
+
be unloaded from a JVM, so a version mismatch has exactly one remedy — restart the application —
|
|
47
|
+
and the connection is refused rather than degraded.
|
|
48
|
+
|
|
49
|
+
The JAR is platform- and Python-version-neutral, so this ships as a `py3-none-any` wheel. It is not
|
|
50
|
+
duplicated into the per-platform native wheels, and building those needs no JDK.
|
|
51
|
+
|
|
52
|
+
## Finding the JAR
|
|
53
|
+
|
|
54
|
+
PlatynUI finds it by itself, through the `platynui.providers` entry point this package registers —
|
|
55
|
+
in-process when the runtime already runs inside Python, and through the environment's own
|
|
56
|
+
interpreter when a standalone binary (Inspector, CLI) asks.
|
|
57
|
+
|
|
58
|
+
The command line exists for the one case PlatynUI cannot help with: a target JVM where dynamic
|
|
59
|
+
attach is blocked, so the agent has to go on the launch command line by hand.
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
platynui-provider-java agent-path # → …/platynui_provider_java/agent/platynui-agent.jar
|
|
63
|
+
platynui-provider-java info # → {"agent_jar": "…", "version": "…"}
|
|
64
|
+
|
|
65
|
+
java -javaagent:$(platynui-provider-java agent-path) -jar theirapp.jar
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Building from the repository
|
|
69
|
+
|
|
70
|
+
The JAR is built by Gradle and copied in before the wheel is assembled:
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
just build-provider-java # builds the agent JAR and stages it into this package
|
|
74
|
+
just build-provider-java-wheel # → dist/
|
|
75
|
+
```
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
platynui_provider_java/__init__.py,sha256=OiN6ttSikKOLBafzGldPllfFJu_17VusrXpBiPnqH70,2370
|
|
2
|
+
platynui_provider_java/__main__.py,sha256=QBbn7wIvJarl5PO3SNrpqRr5NGdAER7C3U7X5-zs9m8,1179
|
|
3
|
+
platynui_provider_java/__version__.py,sha256=3EN1rlo7jeJBc0iP2lmBlpPF15eIPhykR5oRY5gHitw,31
|
|
4
|
+
platynui_provider_java/agent/README.md,sha256=gUGjqZ6v1N-toJsx7W4LUusa1kyDMYnmTGLYk1KSGnQ,301
|
|
5
|
+
platynui_provider_java/agent/platynui-agent.jar,sha256=sFJ19OgkMopJYs-v2m7yhdnH-tQH7SAsz7Fl3ZtVrvg,94787
|
|
6
|
+
platynui_provider_java-0.13.0.dev117.dist-info/WHEEL,sha256=l3MmIxu8qaet7ng2J9fFoJnYGj8IREj7jXTbgsuzmy4,81
|
|
7
|
+
platynui_provider_java-0.13.0.dev117.dist-info/entry_points.txt,sha256=KaQ2E3xm--Y1adzd6ZEOv0w8wrP67Q_U1Gz2MTvKupc,147
|
|
8
|
+
platynui_provider_java-0.13.0.dev117.dist-info/METADATA,sha256=3jI3lX36wdtuqqtIKhl1O_g5Nvt_o2OimHvdAGipQpI,3465
|
|
9
|
+
platynui_provider_java-0.13.0.dev117.dist-info/RECORD,,
|