Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Releases/1.5.1 #1234

Merged
merged 45 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
4d864a6
Update release
Thrameos Nov 10, 2024
67890f4
Merge remote-tracking branch 'origin' into releases/v1.5.1
Thrameos Nov 10, 2024
0f58ace
Work on bumpversion
Thrameos Nov 10, 2024
0693b9b
Another bumpversion change
Thrameos Nov 10, 2024
2f48527
Bump version: 1.5.1.dev0 → 1.5.1
Thrameos Nov 10, 2024
528863e
Proposed changelog
Thrameos Nov 10, 2024
634bb64
Roll back some of the options
Thrameos Nov 16, 2024
6040496
Reduce size of matrix
Thrameos Nov 16, 2024
7859017
Working around case issue
Thrameos Nov 16, 2024
d07579d
Still dealing with lowercase
Thrameos Nov 17, 2024
ece255d
Try yet again
Thrameos Nov 17, 2024
8e0abe3
Still not working
Thrameos Nov 17, 2024
fb1bea3
Merge remote-tracking branch 'origin/master' into releases/1.5.1
Thrameos Nov 17, 2024
89de434
Merge conflict
Thrameos Nov 17, 2024
793dede
OSX change
Thrameos Nov 17, 2024
5b63912
Testing release
Thrameos Nov 17, 2024
52e2c07
Try manylinux2014
Thrameos Nov 17, 2024
0905eb0
Run the site installed package not the local one
Thrameos Nov 17, 2024
5d0c0ec
Fix for lineno
Thrameos Nov 17, 2024
c07b225
[ci/test] use pip to produce a development install
marscher Nov 17, 2024
85edcff
fix
marscher Nov 17, 2024
af12a14
[ci/test] install setuptools in stage "install test"
marscher Nov 17, 2024
35a1342
[ci/test] install setuptools in stage "install test" (the right file...)
marscher Nov 17, 2024
34a0c6d
split stages test_java and requirements installation
marscher Nov 17, 2024
b1c5f73
[ci/releases] add aarch64 to matrix (manylinux)
marscher Nov 17, 2024
28e9ccd
fix typo
marscher Nov 17, 2024
5c1de82
update python version in pyproject.toml
marscher Nov 17, 2024
fbe74cd
[ci] wrap UsePythonVersion as template
marscher Nov 17, 2024
7334fef
pass vars not as strings
marscher Nov 17, 2024
8da632e
variable access pattern
marscher Nov 17, 2024
550e207
fix gh token var
marscher Nov 18, 2024
b255301
fix default arch
marscher Nov 18, 2024
d6bca21
fix check
marscher Nov 18, 2024
ecc9062
exclude python 3.7 from wheel creation
marscher Nov 18, 2024
5676c22
add Python 3.13 to osx-python.sh
marscher Nov 18, 2024
90e2ff6
set timeout to 360 min for manylinux
marscher Nov 18, 2024
81f5ee6
re-enable win jobs
marscher Nov 18, 2024
e8f6ed3
Squashed commit of the following:
marscher Nov 18, 2024
b76471e
add twine check to sdist
marscher Nov 18, 2024
16ef2f7
add twine check to sdist and use it both in build and release pipelines
marscher Nov 18, 2024
9e597e4
updated macos image to 13 (12 is deprecated)
marscher Nov 18, 2024
b93b0e0
scaled logo to small version and use it readme
marscher Nov 18, 2024
50fa58d
testing from dist install does not work, use editable install again
marscher Nov 18, 2024
7c31d02
guard refcnt for nogil python
marscher Nov 18, 2024
98d7acf
fix param
marscher Nov 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
publish: 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
marscher marked this conversation as resolved.
Show resolved Hide resolved
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
marscher marked this conversation as resolved.
Show resolved Hide resolved
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
marscher marked this conversation as resolved.
Show resolved Hide resolved
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
9 changes: 8 additions & 1 deletion native/common/include/jp_gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,15 @@ class JPGarbageCollection
bool java_triggered;
PyObject *python_gc;
jclass _SystemClass;
jclass _ContextClass;
jmethodID _gcMethodID;

jmethodID _totalMemoryID;
jmethodID _freeMemoryID;
jmethodID _maxMemoryID;
jmethodID _usedMemoryID;
jmethodID _heapMemoryID;

size_t last_python;
size_t last_java;
size_t low_water;
Expand All @@ -69,4 +76,4 @@ class JPGarbageCollection
int python_triggered;
} ;

#endif /* JP_GC_H */
#endif /* JP_GC_H */
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;

Comment on lines +566 to +569
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marscher this was a hidden two line fix. The problem it is addressing is that pytest is trying to do arithmetic. On linux systems we get -1 they subtract one then add one. No problem.

On windows system with the same version when we pass -1 to an integer field, we get None in the field. -2 works, 0 works, but -1 gives None. Then Pytest fails.

I think that we can fix this back in Java where we pass a line number 0 rather than -1. But it was easier to patch at this level in case there was some other way that we get invalid line numbers.

This seems like a typical left hand/right hand. Making -1 which was supposed to mean "line number not available" as None is completely reasonable. Trying to check the line numbers in the file (which happens to be 0 counting) for the audit display is perfectly reasonable in pytest. But both changes can't live together.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the heck is this platform dependent? Oo

last_traceback = tb_create(last_traceback, dict, filename.c_str(),
method.c_str(), lineNum);
frame.DeleteLocalRef(jclassname);
Expand Down
Loading
Loading