Skip to content

Commit

Permalink
Merge pull request #1234 from jpype-project/releases/1.5.1
Browse files Browse the repository at this point in the history
Releases/1.5.1
  • Loading branch information
marscher authored Nov 18, 2024
2 parents d837337 + 98d7acf commit 7b1abed
Show file tree
Hide file tree
Showing 20 changed files with 122 additions and 57 deletions.
4 changes: 2 additions & 2 deletions .azure/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ jobs:
jdk.version: '21'
# OSX, we only test an old Python version with JDK8 and recent Py with recent JDK.
mac_py38_jdk8:
imageName: "macos-12"
imageName: "macos-13"
python.version: '3.8' # todo: 3.8 will be EOL on October 31, 2024
jpypetest.fast: 'true'
jdk.version: '8'
mac_py312_jdk17:
imageName: "macos-12"
imageName: "macos-13"
python.version: '3.12'
jpypetest.fast: 'true'
jdk.version: '17'
Expand Down
47 changes: 32 additions & 15 deletions .azure/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# JPype Release pipeline
trigger: none
pr:
pr:
branches:
include:
- releases/*
Expand All @@ -10,40 +10,51 @@ pr:
- .azure/release.yml

variables:
package_name: JPype1
package_name: jpype1

stages:
- stage: Initial
jobs:
- job: SourceDistribution
pool:
pool:
vmImage: "ubuntu-latest"
steps:
- template: scripts/sdist.yml
parameters:
artifact: true
- template: scripts/ivy.yml

- stage: Package
jobs:
# From https://iscinumpy.gitlab.io/post/azure-devops-python-wheels/
- job: ManyLinux
condition: eq(1,1)
timeoutInMinutes: 360
strategy:
matrix:
# Disabled because it is fetching beta images
# 64Bit2014:
# arch: aarch64
# plat: manylinux2014_aarch64
# image: quay.io/pypa/manylinux2014_aarch64
# python.architecture: aarch64
64Bit:
aarch64:
arch: aarch64
plat: manylinux2014_aarch64
image: quay.io/pypa/manylinux2014_aarch64
python.architecture: aarch64
#arm64Bit:
# arch: armv71
# plat: musllinux_1_2
# image: quay.io/pypa/musllinux_1_2_armv7l
# python.architecture: armv71
x86_64:
arch: x86_64
plat: manylinux2014_x86_64
image: quay.io/pypa/manylinux2014_x86_64
# plat: musllinux_1_2
# image: quay.io/pypa/musllinux_1_2_x86_64
python.architecture: x64
32Bit:
i686:
arch: i686
plat: manylinux2014_i686
image: quay.io/pypa/manylinux2014_i686
# plat: musllinux_1_2
# image: quay.io/pypa/musllinux_1_2_i686
python.architecture: x86
pool:
vmImage: "ubuntu-latest"
Expand Down Expand Up @@ -71,13 +82,17 @@ stages:
Python312:
python.version: '3.12'
python.architecture: 'x64'
Python313:
python.version: '3.13'
python.architecture: 'x64'
pool:
# vmImage: "windows-2022"
vmImage: "windows-2019"
steps:
- template: scripts/deps.yml
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
- template: scripts/python.yml
parameters:
version: '$(python.version)'
architecture: '$(python.architecture)'
- template: scripts/jdk.yml
parameters:
Expand All @@ -101,8 +116,10 @@ stages:
python.version: '3.11'
Python312:
python.version: '3.12'
Python313:
python.version: '3.13'
pool:
vmImage: "macos-11"
vmImage: "macos-13"
steps:
- template: scripts/deps.yml
- script: .azure/scripts/osx-python.sh '$(python.version)'
Expand Down
3 changes: 2 additions & 1 deletion .azure/scripts/build-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ set -e -x
# Collect the pythons
pys=(/opt/python/cp*/bin)

# Exclude specific Pythons (3.6)
# Exclude specific Pythons (3.6, 3.7)
pys=(${pys[@]//*36*/})
pys=(${pys[@]//*37*/})

# Compile wheels
for PYBIN in "${pys[@]}"; do
Expand Down
4 changes: 4 additions & 0 deletions .azure/scripts/osx-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ case $PYTHON_VERSION in
3.12)
FULL_VERSION=3.12.0
INSTALLER_NAME=python-$FULL_VERSION-macos11.pkg
;;
3.13)
FULL_VERSION=3.13.0
INSTALLER_NAME=python-$FULL_VERSION-macos11.pkg
esac

URL=https://www.python.org/ftp/python/$FULL_VERSION/$INSTALLER_NAME
Expand Down
21 changes: 21 additions & 0 deletions .azure/scripts/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
parameters:
- name: version
type: string
default: '3.12'

- name: architecture
type: string
default: 'x64'

steps:
- task: UsePythonVersion@0
inputs:
architecture: ${{ parameters.architecture }}
versionSpec: ${{ parameters.version }}
disableDownloadFromRegistry: false # boolean. Disable downloading releases from the GitHub registry. Default: false.
allowUnstable: true # boolean. Optional. Use when disableDownloadFromRegistry = false. Allow downloading unstable releases. Default: false.
githubToken: $(githubToken) # global (secret) variable to allow API access to Github (for not hitting a rate limit while downloading).
- bash: |
echo AGENT_JOBSTATUS = $AGENT_JOBSTATUS
if [[ "$AGENT_JOBSTATUS" == "SucceededWithIssues" ]]; then exit 1; fi
displayName: Python ${{ parameters.version }} set as interpreter.
14 changes: 11 additions & 3 deletions .azure/scripts/sdist.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
parameters:
- name: artifact
type: boolean
default: false

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'
versionSpec: '3.10'
- script: |
python -m pip install build
python -m pip install build twine
python -m build ./ --sdist
displayName: Build sdist
twine check dist/*
displayName: Build sdist and check with twine

- task: PublishPipelineArtifact@0
condition: and(succeeded(), eq('${{ parameters.artifact }}', true))
inputs:
artifactName: 'artifact_SourceDistribution'
targetPath: 'dist'
Expand Down
18 changes: 9 additions & 9 deletions .azure/scripts/test.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# This task tests individual platforms and versions
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
disableDownloadFromRegistry: false # boolean. Disable downloading releases from the GitHub registry. Default: false.
allowUnstable: true # boolean. Optional. Use when disableDownloadFromRegistry = false. Allow downloading unstable releases. Default: false.
githubToken: '$(githubToken)'

- template: python.yml
parameters:
version: '$(python.version)'

- template: jdk.yml
parameters:
version: '$(jdk.version)'

- template: sdist.yml

- script: |
python -m pip install setuptools
python setup.py develop
displayName: 'Build module'
python -m pip install -e .
displayName: 'Build/install module'

- script: |
pip install numpy jedi typing_extensions
python -c "import jpype"
displayName: 'Check module'

- script: |
pip install setuptools
python setup.py test_java
pip install -r test-requirements.txt
displayName: 'Install test'
Expand Down
3 changes: 0 additions & 3 deletions .azure/scripts/wheels-linux.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'

- task: DownloadPipelineArtifact@2
inputs:
Expand Down
17 changes: 9 additions & 8 deletions .azure/scripts/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,38 @@
steps:
- script: |
mkdir -p dist
python -m pip install --upgrade pip
python -m pip install --upgrade pip setuptools -r test-requirements.txt
displayName: 'Install dependencies'

- script: |
python -m pip wheel . -w wheelhouse/
displayName: 'Build wheel'
inputs:
PathtoPublish: 'wheelhouse'
ArtifactName: 'python-wheels'
publishLocation: 'Container'

- script: |
ls -lh wheelhouse
cp wheelhouse/$(package_name)* dist/.
displayName: 'Show wheelhouse'

- script: |
python -m pip install JPype1 --no-index -f wheelhouse
python -m pip install jpype1 --no-index -f wheelhouse
displayName: 'Install module'

- script: |
python setup.py test_java
python -m pip install -r test-requirements.txt
displayName: 'Install test'
displayName: 'Build java tests'

- script: |
ls -l
ls lib/
displayName: 'Check deps'

- task: PublishPipelineArtifact@0
inputs:
artifactName: 'artifact_$(Agent.JobName)_$(Agent.OS)_$(python.architecture)'
targetPath: 'dist'

- script: |
rm -Rf jpype
python -m pytest -v --junit-xml=build/test/test.xml test/jpypetest --checkjni --fast
displayName: 'Test module'

8 changes: 4 additions & 4 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[bumpversion]
current_version = 1.5.1_dev0
current_version = 1.5.1
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\_(?P<release>[a-z]+)(?P<build>\d+))?
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<build>\d+))?
serialize =
{major}.{minor}.{patch}_{release}{build}
{major}.{minor}.{patch}.{release}{build}
{major}.{minor}.{patch}

[bumpversion:part:release]
Expand All @@ -16,7 +16,7 @@ values =

[bumpversion:part:build]

[bumpversion:file:setup.py]
[bumpversion:file:pyproject.toml]

[bumpversion:file:native/python/pyjp_module.cpp]

Expand Down
3 changes: 1 addition & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.. image:: doc/logo.png
:scale: 50 %
.. image:: doc/logo_small.png
:alt: JPype logo
:align: center

Expand Down
5 changes: 4 additions & 1 deletion doc/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ Changelog
This changelog *only* contains changes from the *first* pypi release (0.5.4.3) onwards.

Latest Changes:
- **1.5.1 - 2024-11-09**

- **1.5.1_dev0 - 2023-12-15**
- Future proofing for Python 3.14

- Support for Python 3.13

- Allow access to default methods implemented in interfaces when using ``@JImplements``.

Expand Down
Binary file added doc/logo_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion jpype/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
__all__.extend(_jcustomizer.__all__) # type: ignore[name-defined]
__all__.extend(_gui.__all__) # type: ignore[name-defined]

__version__ = "1.5.1_dev0"
__version__ = "1.5.1"
__version_info__ = __version__.split('.')


Expand Down
4 changes: 4 additions & 0 deletions native/common/jp_exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,10 @@ JPPyObject PyTrace_FromJavaException(JPJavaFrame& frame, jthrowable th, jthrowab
jint lineNum =
frame.CallIntMethodA(frame.GetObjectArrayElement(obj, i + 3), context->_java_lang_Integer->m_IntValueID, nullptr);

// sending -1 will cause issues on Windows
if (lineNum<0)
lineNum = 0;

last_traceback = tb_create(last_traceback, dict, filename.c_str(),
method.c_str(), lineNum);
frame.DeleteLocalRef(jclassname);
Expand Down
8 changes: 7 additions & 1 deletion native/common/jp_tracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,13 @@ void JPypeTracer::tracePythonObject(const char* msg, PyObject* ref)
if (ref != nullptr)
{
std::stringstream str;
str << msg << " " << (void*) ref << " " << Py_REFCNT(ref) << " " << Py_TYPE(ref)->tp_name;
str << msg << " " << (void*) ref << " "<<
#ifndef Py_GIL_DISABLED
Py_REFCNT(ref)
#else
-1
#endif
<< " " << Py_TYPE(ref)->tp_name;
JPypeTracer::trace1("PY", str.str().c_str());

} else
Expand Down
2 changes: 1 addition & 1 deletion native/java/org/jpype/JPypeContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
public class JPypeContext
{

public final String VERSION = "1.5.1_dev0";
public final String VERSION = "1.5.1";

private static JPypeContext INSTANCE = new JPypeContext();
// This is the C++ portion of the context.
Expand Down
4 changes: 4 additions & 0 deletions native/python/jp_pythontypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

static void assertValid(PyObject *obj)
{
#ifndef Py_GIL_DISABLED
if (Py_REFCNT(obj) >= 1)
return;

Expand All @@ -34,6 +35,9 @@ static void assertValid(PyObject *obj)
JP_TRACE_PY("pyref FAULT", obj);
JP_RAISE(PyExc_SystemError, "Deleted reference");
// GCOVR_EXCL_STOP
#else
return; // GIL is disabled; we assume obj is valid
#endif
}

/**
Expand Down
2 changes: 1 addition & 1 deletion native/python/pyjp_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ PyMODINIT_FUNC PyInit__jpype()
#ifdef Py_GIL_DISABLED
PyUnstable_Module_SetGIL(module, Py_MOD_GIL_NOT_USED);
#endif
PyModule_AddStringConstant(module, "__version__", "1.5.1_dev0");
PyModule_AddStringConstant(module, "__version__", "1.5.1");

// Our module will be used for PyFrame object and it is a requirement that
// we have a builtins in our dictionary.
Expand Down
Loading

0 comments on commit 7b1abed

Please sign in to comment.