diff --git a/.github/workflows/test-jvm.yml b/.github/workflows/test-jvm.yml index 7667ffd..36ba90e 100644 --- a/.github/workflows/test-jvm.yml +++ b/.github/workflows/test-jvm.yml @@ -805,7 +805,7 @@ jobs: echo "**Legs**: a push to main, the nightly run, a manual run, a release and a pull request with the label ci:full run every platform. The jobs of this run list its legs." >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "ℹ️ **Note**: Some platform/Python combinations are excluded from testing on every event:" >> $GITHUB_STEP_SUMMARY - echo "- Windows ARM64 (GitHub-hosted windows-11-arm runners exist, but jpype1 1.8.0 ships no win_arm64 wheel and GraalVM CE 25.4.4.1.1 has no Windows ARM64 build, so neither package can be built there)" >> $GITHUB_STEP_SUMMARY + echo "- Windows ARM64 (GitHub-hosted windows-11-arm runners exist, but jpype1 1.8.1 ships no win_arm64 wheel and GraalVM CE 25.4.4.1.1 has no Windows ARM64 build, so neither package can be built there)" >> $GITHUB_STEP_SUMMARY echo "- macOS x86_64 (temporarily disabled)" >> $GITHUB_STEP_SUMMARY else echo "❌ **Some legs failed testing**" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/test-native.yml b/.github/workflows/test-native.yml index dc11800..6310b2a 100644 --- a/.github/workflows/test-native.yml +++ b/.github/workflows/test-native.yml @@ -747,9 +747,9 @@ jobs: # Linux and macOS stay strict. The harness marks a passing retry FLAKY-CRASH and the crash-report job logs it. retry=() if [ "$RUNNER_OS" = Windows ]; then retry=(--retry-crash); fi - # jpype1 1.8.0 ends the process on CPython 3.11 (issue 536); the cap of pyproject.toml does not reach this install, so - # it is repeated here. Remove both together, when a newer jpype1 passes tests/test_jpype_bare_exceptions.py on 3.11. - jpype=(--with "jpype1<1.8; python_version < '3.12'" --with "jpype1; python_version >= '3.12'") + # jpype1 1.8.0 ends the process on CPython 3.11 (issue 536) and 1.8.1 fixes it; the exclusion of pyproject.toml does + # not reach this install, so it is repeated here. Remove both together. + jpype=(--with "jpype1!=1.8.0") # macOS runs bash 3.2: under set -u an empty "${limit[@]}" is "unbound variable", so expand it only when set uv run --no-project --python "$PY" --with "$w" --with pytest --with setuptools --with numpy --with requests "${jpype[@]}" --with pyarrow \ --with polars --with pandas --with duckdb --with networkx --with "psycopg[binary]" --with adbc-driver-postgresql \ diff --git a/README.md b/README.md index 90ef0f6..a58c881 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ uv add arcadedb-jvm # JVM, for heavy long-running loads > Old names: `arcadedb-jvm` was formerly `arcadedb-embedded`, and `arcadedb` was formerly `arcadedb-embedded-native` (archived on PyPI). The last `arcadedb-embedded` release, 26.11.1, is a deprecation shim: it installs `arcadedb`, the native build, and warns once at import. It does not install `arcadedb-jvm`. -- Python: both packages support 3.11 to 3.15 (`requires-python` is `>=3.11`, with no upper bound). On Python 3.15 `arcadedb-jvm` installs JPype 1.8.0 or later. On Python 3.11 it installs JPype below 1.8, because 1.8.0 can crash the process there; with a release up to 26.11.1.post4, run `uv add "jpype1<1.8"` in your project. Each release builds and tests both packages on Python 3.11 to 3.15 on all four platforms below. Between releases, `main` and the nightly run test `arcadedb` on 3.12 and 3.15 on every platform (with a short subset on 3.11, 3.13, and 3.14), and `arcadedb-jvm` on 3.11 to 3.15 on Linux x86-64 and on 3.11 and 3.15 on the other three. A pull request runs Linux x86-64 only, and the other platforms when it carries the label `ci:full` ([CONTRIBUTING](https://github.com/ArcadeData/arcadedb-python/blob/main/CONTRIBUTING.md#what-ci-runs)). The examples are not run on 3.15 yet: three compiled dependencies of `py7zr`, which they use, have no 3.15 wheel. +- Python: both packages support 3.11 to 3.15 (`requires-python` is `>=3.11`, with no upper bound). On Python 3.15 `arcadedb-jvm` installs JPype 1.8.1 or later. On Python 3.11 it leaves out JPype 1.8.0, which can crash the process there (1.8.1 fixes it); with a release up to 26.11.1.post4, run `uv add "jpype1!=1.8.0"` in your project (it replaces the `jpype1<1.8` limit that this page gave before). Each release builds and tests both packages on Python 3.11 to 3.15 on all four platforms below. Between releases, `main` and the nightly run test `arcadedb` on 3.12 and 3.15 on every platform (with a short subset on 3.11, 3.13, and 3.14), and `arcadedb-jvm` on 3.11 to 3.15 on Linux x86-64 and on 3.11 and 3.15 on the other three. A pull request runs Linux x86-64 only, and the other platforms when it carries the label `ci:full` ([CONTRIBUTING](https://github.com/ArcadeData/arcadedb-python/blob/main/CONTRIBUTING.md#what-ci-runs)). The examples are not run on 3.15 yet: three compiled dependencies of `py7zr`, which they use, have no 3.15 wheel. - Linux x86_64 and ARM64, macOS on Apple Silicon, Windows x86_64, for both packages. The Windows wheel of `arcadedb` is the newest. - Import name: `arcadedb`. Check which package you have with `python -c "import arcadedb; print(arcadedb.__backend__)"`. It prints `native` or `jvm`. - Optional extras: `arrow`, `pandas`, `polars`, `vector` for `arcadedb-jvm`; `numpy`, `arrow`, `pandas`, `polars` for `arcadedb`. diff --git a/docs/modules/ROOT/pages/development/ci.adoc b/docs/modules/ROOT/pages/development/ci.adoc index 53f258d..cc4c2ca 100644 --- a/docs/modules/ROOT/pages/development/ci.adoc +++ b/docs/modules/ROOT/pages/development/ci.adoc @@ -65,7 +65,7 @@ The wheel of `arcadedb-jvm` is tagged `py3-none-` (`setup.py`), like t * `Build arcadedb-jvm wheel ()` builds the wheel once for each platform and uploads it as `wheel-`. `scripts/verify_wheel_tag.py` fails the build when the wheel is not `py3-none-`. * `Test arcadedb (, Python )` downloads that wheel and runs the tests on one Python in a throwaway `uv run --no-project --with "[test]" python -m pytest` environment. It builds nothing. The release publishes these same four files. -The `requires-python` of the package is `>=3.11`, with no upper bound. The classifiers and `scripts/select_matrix.py` say which Pythons are tested. `pyproject.toml` asks for `jpype1` 1.8.0 or later on 3.15, so that an installer never compiles JPype from its source archive there. +The `requires-python` of the package is `>=3.11`, with no upper bound. The classifiers and `scripts/select_matrix.py` say which Pythons are tested. `pyproject.toml` asks for `jpype1` 1.8.1 or later on 3.15, so that an installer never compiles JPype from its source archive there. [[what-runs]] == What runs when diff --git a/docs/modules/ROOT/pages/installation.adoc b/docs/modules/ROOT/pages/installation.adoc index 8bd17f7..d83b2e5 100644 --- a/docs/modules/ROOT/pages/installation.adoc +++ b/docs/modules/ROOT/pages/installation.adoc @@ -31,15 +31,15 @@ NOTE: *First release.* The first release of this layout is 26.11.1, and both pac // REMOVE WHEN: the old arcadedb-embedded* shims are retired and two releases have shipped with the two-package layout allow-old-name NOTE: *Old names.* The JVM package was formerly `arcadedb-embedded`. It is now `{jvm-pkg-name}`, the same build. The native package was formerly `arcadedb-embedded-native`. It is now `{native-pkg-name}`, and the old project is archived. The last `arcadedb-embedded` release, 26.11.1, is a shim that installs `{native-pkg-name}` and warns once at import. It does not install `{jvm-pkg-name}`. See xref:which-package.adoc#old-names[Old names]. -The JVM package is self-contained. It carries a Java 25 runtime for its platform, so you do not install Java. Its only Python dependency is `JPype1` 1.5.0 or later (the Java-Python bridge), which `uv add` installs with it. On Python 3.11 it stays below 1.8: there `JPype1` 1.8.0 ends the process with a segmentation fault when Python raises certain exceptions inside it, for example when Ctrl-C arrives during a query. The native package needs no Java and no JPype. Optional extras install the columnar helpers of the native package: `[numpy]`, `[arrow]`, `[pandas]` and `[polars]`. +The JVM package is self-contained. It carries a Java 25 runtime for its platform, so you do not install Java. Its only Python dependency is `JPype1` 1.5.0 or later (the Java-Python bridge), which `uv add` installs with it. On Python 3.11 it leaves out `JPype1` 1.8.0, which ends the process there with a segmentation fault when Python raises certain exceptions inside it, for example when Ctrl-C arrives during a query. `JPype1` 1.8.1 fixes it. The native package needs no Java and no JPype. Optional extras install the columnar helpers of the native package: `[numpy]`, `[arrow]`, `[pandas]` and `[polars]`. -// REMOVE WHEN: 26.12.1 is old enough that no supported release accepts JPype1 1.8 on Python 3.11 -NOTE: *Releases up to 26.11.1.post4 on Python 3.11.* These releases of `{jvm-pkg-name}`, the 26.12.1 pre-releases up to 26.12.1.dev2, and the releases under the former JVM package name (xref:which-package.adoc#old-names[Old names]) up to 26.10.2.post1 (also on Python 3.10) accept `JPype1` 1.8.0. Add the limit to your own project with `uv add "jpype1<1.8"`. Python 3.12 and later do not need it. +// REMOVE WHEN: 26.12.1 is old enough that no supported release accepts JPype1 1.8.0 on Python 3.11 +NOTE: *Releases up to 26.11.1.post4 on Python 3.11.* These releases of `{jvm-pkg-name}`, the 26.12.1 pre-releases up to 26.12.1.dev2, and the releases under the former JVM package name (xref:which-package.adoc#old-names[Old names]) up to 26.10.2.post1 (also on Python 3.10) accept `JPype1` 1.8.0. PyPI has yanked 1.8.0, so a new install takes 1.8.1 or later, which has the fix; a project that pins 1.8.0 exactly or holds it in a lock file keeps it. To keep 1.8.0 out of your own project, run `uv add "jpype1!=1.8.0"`; it also replaces the `jpype1<1.8` limit that this page gave before. Python 3.12 and later do not need it. [[requirements]] == Requirements -* Python 3.11 to 3.15 for both packages. On 3.15, `{jvm-pkg-name}` needs JPype 1.8.0 or later, the first JPype release with 3.15 wheels, and the package requires it by itself. Versions of `{jvm-pkg-name}` before 26.12.1 declare `requires-python` `<3.15`. A release tests both packages on all five versions on every platform; the runs between releases test fewer combinations (xref:development/ci.adoc[Continuous integration]). +* Python 3.11 to 3.15 for both packages. On 3.15, `{jvm-pkg-name}` needs JPype 1.8.1 or later, and the package requires it by itself. JPype 1.8.0, the first release with 3.15 wheels, is yanked on PyPI. Versions of `{jvm-pkg-name}` before 26.12.1 declare `requires-python` `<3.15`. A release tests both packages on all five versions on every platform; the runs between releases test fewer combinations (xref:development/ci.adoc[Continuous integration]). * One of the four platforms below. The Windows wheel of the native build is the newest, and its test run is the least proven of the four. It needs the Microsoft Visual C++ runtime (`VCRUNTIME140.dll`), which every CPython for Windows already brings. Every wheel is platform-specific and built on a native runner of its platform, so the installer needs no hint to pick the right one. Each package is one file for each platform, tagged `py3-none-`, and it serves every Python version it supports. The native wheel does so because it loads its library with `ctypes`. The JVM wheel carries a JRE for its platform, and nothing in it is compiled against CPython: JPype, its dependency, has its own wheel for each Python version. diff --git a/docs/modules/ROOT/pages/which-package.adoc b/docs/modules/ROOT/pages/which-package.adoc index 1f94347..5810dd0 100644 --- a/docs/modules/ROOT/pages/which-package.adoc +++ b/docs/modules/ROOT/pages/which-package.adoc @@ -127,7 +127,7 @@ The API is the same. The runtime is not. These are the differences you can plan | Python versions | 3.11 to 3.15. -| 3.11 to 3.15. On 3.15 it needs JPype 1.8.0 or later, which the package requires by itself. +| 3.11 to 3.15. On 3.15 it needs JPype 1.8.1 or later, which the package requires by itself. | Platforms | Linux x86_64 and aarch64 (glibc 2.28 or later), macOS arm64, Windows x64. The Windows wheel is the newest: it is built in CI, and its test run is the least proven of the four. Not built: Intel Mac, Alpine (musl), Windows on ARM. See xref:installation.adoc#requirements[Requirements]. diff --git a/pyproject.toml b/pyproject.toml index 126797e..a6a1f82 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,16 +38,19 @@ classifiers = [ "Topic :: Software Development :: Libraries :: Python Modules", ] -# CAP on CPython 3.11: jpype1 1.8.0 ends the process with a segmentation fault there when an exception that CPython -# holds without an instance goes through JPype, such as the KeyboardInterrupt of a Ctrl-C while a query calls a Python -# function, or the StopIteration of next(). CPython 3.12 and later always hold an instance and are not affected. -# REMOVE THE CAP when a newer jpype1 passes tests/test_jpype_bare_exceptions.py on Python 3.11. -# FLOOR on CPython 3.15: jpype1 1.8.0 is the first release with cp315 wheels. The floor keeps a resolver from taking an -# older jpype1 on 3.15, which has only a source archive there and would be compiled on the user's machine. +# EXCLUSION on CPython 3.11: jpype1 1.8.0 ends the process with a segmentation fault there when an exception that +# CPython holds without an instance goes through JPype, such as the KeyboardInterrupt of a Ctrl-C while a query calls a +# Python function, or the StopIteration of next() (issue 536, jpype-project/jpype#1612). CPython 3.12 and later always +# hold an instance and are not affected. jpype1 1.8.1 fixes it (tests/test_jpype_bare_exceptions.py checks it), so only +# 1.8.0 is left out: a resolver or a lock file that still holds 1.8.0 on 3.11 moves off it. +# REMOVE THE EXCLUSION when the floor on 3.11 rises above 1.8.0. +# FLOOR on CPython 3.15: jpype1 1.8.0 was the first release with cp315 wheels, and PyPI has yanked it for the fault +# above, so the floor is 1.8.1. It keeps a resolver from taking an older jpype1 on 3.15, which has only a source +# archive there and would be compiled on the user's machine. dependencies = [ - "jpype1>=1.5.0,<1.8; python_version < '3.12'", + "jpype1>=1.5.0,!=1.8.0; python_version < '3.12'", "jpype1>=1.5.0; python_version >= '3.12' and python_version < '3.15'", - "jpype1>=1.8.0; python_version >= '3.15'", + "jpype1>=1.8.1; python_version >= '3.15'", ] [tool.uv] diff --git a/scripts/select_matrix.py b/scripts/select_matrix.py index 1f59db6..4abefc0 100644 --- a/scripts/select_matrix.py +++ b/scripts/select_matrix.py @@ -47,7 +47,7 @@ import sys # Temporarily limited to four platforms: macOS x86_64 (runner macos-15-intel) is off. Windows ARM64 (runner -# windows-11-arm exists) is off because neither package can be built there: jpype1 1.8.0 ships no win_arm64 wheel +# windows-11-arm exists) is off because neither package can be built there: jpype1 1.8.1 ships no win_arm64 wheel # (win_amd64 only) and GraalVM CE 25.4.4.1.1 has no Windows ARM64 build (windows-x64 only). This is the platform # column both workflows had before this script. RUNNERS = { diff --git a/tests/test_jpype_bare_exceptions.py b/tests/test_jpype_bare_exceptions.py index 7924965..2346a41 100644 --- a/tests/test_jpype_bare_exceptions.py +++ b/tests/test_jpype_bare_exceptions.py @@ -2,8 +2,8 @@ jpype1 1.8.0 on CPython 3.11 ends the process with a segmentation fault when such an exception goes through JPype's own code: the ``KeyboardInterrupt`` of a Ctrl-C, or the ``StopIteration`` of -``next()``. CPython 3.12 and later always hold an instance. ``pyproject.toml`` keeps jpype1 below -1.8 on CPython 3.11, and this test fails when the installed JPype has the fault. +``next()``. CPython 3.12 and later always hold an instance. jpype1 1.8.1 fixes it, ``pyproject.toml`` +leaves out 1.8.0 on CPython 3.11, and this test fails when the installed JPype has the fault. Each case runs in a child process, because the fault ends the process it happens in. Nothing depends on timing: ``signal.raise_signal`` and ``next()`` raise at a fixed point. diff --git a/tests/test_select_matrix.py b/tests/test_select_matrix.py index 9686856..b568d4f 100644 --- a/tests/test_select_matrix.py +++ b/tests/test_select_matrix.py @@ -227,16 +227,16 @@ def test_pythons_match_the_classifiers_of_pyproject(): assert project["requires-python"] == f">={sm.PYTHONS[0]}" -def test_jpype1_is_capped_below_python_3_12_and_floored_on_python_3_15(): - # Below 3.12, jpype1 1.8.0 can end the process (tests/test_jpype_bare_exceptions.py). 1.8.0 is also the first jpype1 - # with cp315 wheels: an older one on 3.15 would be compiled from its source archive. +def test_jpype1_skips_1_8_0_below_python_3_12_and_is_floored_on_python_3_15(): + # Below 3.12, jpype1 1.8.0 can end the process and 1.8.1 fixes it (tests/test_jpype_bare_exceptions.py). 1.8.0 was + # also the first jpype1 with cp315 wheels and is yanked: one older than 1.8.1 on 3.15 is 1.8.0 or a source archive. project = tomllib.loads((ROOT / "pyproject.toml").read_text(encoding="utf-8"))[ "project" ] assert project["dependencies"] == [ - "jpype1>=1.5.0,<1.8; python_version < '3.12'", + "jpype1>=1.5.0,!=1.8.0; python_version < '3.12'", "jpype1>=1.5.0; python_version >= '3.12' and python_version < '3.15'", - "jpype1>=1.8.0; python_version >= '3.15'", + "jpype1>=1.8.1; python_version >= '3.15'", ]