Skip to content

Commit

Permalink
Merge branch 'master' into ci_jdk_matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
marscher committed Aug 19, 2024
2 parents 21166ba + d3cc970 commit d075ef7
Show file tree
Hide file tree
Showing 185 changed files with 2,555 additions and 2,371 deletions.
17 changes: 7 additions & 10 deletions .azure/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ jobs:
linux-3.7:
imageName: "ubuntu-latest"
python.version: '3.7'
jdk.version: '8'
linux-3.8:
imageName: "ubuntu-latest"
python.version: '3.8'
Expand All @@ -70,32 +69,30 @@ jobs:
imageName: "ubuntu-latest"
python.version: '3.11'
jdk.version: '17'
windows-3.7:
imageName: "windows-2019"
python.version: '3.7'
jdk.version: '8'
linux-3.12:
imageName: "ubuntu-latest"
python.version: '3.12'
windows-3.8:
imageName: "windows-2019"
python.version: '3.8'
jdk.version: '11'
jdk.version: '8'

windows-3.9:
imageName: "windows-2019"
python.version: '3.9'
jdk.version: '17'
#jpypetest.fast: 'true'
jdk.version: '11'
windows-3.10:
imageName: "windows-2019"
python.version: '3.10'
jdk.version: '11'
windows-3.11:
imageName: "windows-2019"
python.version: '3.11'
jdk.version: '17'
mac-3.9:
imageName: "macos-11"
python.version: '3.9'
jdk.version: '17'
jpypetest.fast: 'true'
jdk.version: '17'

pool:
vmImage: $(imageName)
Expand Down
2 changes: 1 addition & 1 deletion .azure/doc-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# TODO: consider unpinning these?
Pygments==2.7.4
Pygments==2.15.0
docutils==0.14
commonmark==0.8.1
recommonmark==0.5.0
Expand Down
18 changes: 9 additions & 9 deletions .azure/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ stages:
# python.architecture: aarch64
64Bit:
arch: x86_64
plat: manylinux2010_x86_64
image: quay.io/pypa/manylinux2010_x86_64
plat: manylinux2014_x86_64
image: quay.io/pypa/manylinux2014_x86_64
python.architecture: x64
32Bit:
arch: i686
plat: manylinux2010_i686
image: quay.io/pypa/manylinux2010_i686
plat: manylinux2014_i686
image: quay.io/pypa/manylinux2014_i686
python.architecture: x86
pool:
vmImage: "ubuntu-latest"
Expand All @@ -56,9 +56,6 @@ stages:
condition: eq(1,1)
strategy:
matrix:
Python37:
python.version: '3.7'
python.architecture: 'x64'
Python38:
python.version: '3.8'
python.architecture: 'x64'
Expand All @@ -71,6 +68,9 @@ stages:
Python311:
python.version: '3.11'
python.architecture: 'x64'
Python312:
python.version: '3.12'
python.architecture: 'x64'
pool:
vmImage: "windows-2019"
steps:
Expand All @@ -91,8 +91,6 @@ stages:
python.architecture: 'x64'
strategy:
matrix:
Python37:
python.version: '3.7'
Python38:
python.version: '3.8'
Python39:
Expand All @@ -101,6 +99,8 @@ stages:
python.version: '3.10'
Python311:
python.version: '3.11'
Python312:
python.version: '3.12'
pool:
vmImage: "macos-11"
steps:
Expand Down
7 changes: 3 additions & 4 deletions .azure/scripts/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ steps:

- script: |
python setup.py test_java
pip install gcovr pytest-cov jedi
pip install -r test-requirements.txt
pip install numpy typing_extensions
pip install gcovr pytest-cov -r test-requirements.txt
pip install numpy
displayName: 'Install requirements'

- script: |
python setup.py --enable-coverage --enable-build-jar build_ext --inplace
python setup.py develop --enable-coverage --enable-build-jar
displayName: 'Build'

- script: |
Expand Down
3 changes: 1 addition & 2 deletions .azure/scripts/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ steps:

- script: |
sudo apt install gdb
python setup.py sdist
pip install dist/*
pip install ./
displayName: 'Build module'

- script: python -c "import jpype"
Expand Down
9 changes: 6 additions & 3 deletions .azure/scripts/osx-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ case $PYTHON_VERSION in
INSTALLER_NAME=python-$FULL_VERSION-macosx10.9.pkg
;;
3.10)
FULL_VERSION=3.10.4
FULL_VERSION=3.10.11
INSTALLER_NAME=python-$FULL_VERSION-macos11.pkg
;;
3.11)
FULL_VERSION=3.11.0
FULL_VERSION=3.11.7
INSTALLER_NAME=python-$FULL_VERSION-macos11.pkg
;;
3.12)
FULL_VERSION=3.12.0
INSTALLER_NAME=python-$FULL_VERSION-macos11.pkg
esac

URL=https://www.python.org/ftp/python/$FULL_VERSION/$INSTALLER_NAME
Expand All @@ -35,7 +38,7 @@ curl $URL > $INSTALLER_NAME

sudo installer -pkg $INSTALLER_NAME -target /

sudo rm /usr/local/bin/python
sudo rm -f /usr/local/bin/python
sudo ln -s /usr/local/bin/python$PYTHON_VERSION /usr/local/bin/python

which python
Expand Down
4 changes: 2 additions & 2 deletions .azure/scripts/sdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ steps:
inputs:
versionSpec: '3.8'
- script: |
python -m pip install setuptools
python setup.py sdist
python -m pip install build
python -m build ./ --sdist
displayName: Build sdist
- task: PublishPipelineArtifact@0
inputs:
Expand Down
1 change: 1 addition & 0 deletions .azure/scripts/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ steps:
version: '$(jdk.version)'

- script: |
python -m pip install --upgrade pytest setuptools
python setup.py build_ext --inplace
displayName: 'Build module'

Expand Down
2 changes: 1 addition & 1 deletion .azure/scripts/tracing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ steps:
inputs:
versionSpec: '3.8'
- script: |
python setup.py --enable-tracing --enable-build-jar build_ext --inplace
python setup.py develop --enable-tracing --enable-build-jar
displayName: 'Build'

2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.5.0_dev0
current_version = 1.5.1_dev0
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\_(?P<release>[a-z]+)(?P<build>\d+))?
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Mypy

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
name: mypy
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.11
uses: actions/setup-python@v1
with:
python-version: 3.11
- name: Install Dependencies
run: |
pip install mypy numpy types-pyinstaller pytest packaging
- name: mypy
run: |
mypy ./jpype/ ./test/jpypetest/
5 changes: 3 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ sphinx:

# Optionally set the version of Python and requirements required to build your docs
python:
version: "3.8"
install:
- method: pip
path: .
extra_requirements:
- docs

build:
image: latest
tools:
python: "3.8"
os: ubuntu-22.04
apt_packages:
- openjdk-8-jdk

Expand Down
37 changes: 35 additions & 2 deletions doc/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,45 @@ Changelog
This changelog *only* contains changes from the *first* pypi release (0.5.4.3) onwards.

Latest Changes:
- **1.5.0_dev0 - 2023-04-03**

- **1.5.1_dev0 - 2023-12-15**
- Fixed uncaught exception while setting traceback causing issues in Python 3.11/3.12.
- Use PEP-518 and PEP-660 configuration for the package, allowing editable and
configurable builds using modern Python packaging tooling.
Where before ``python setup.py --enable-tracing develop``, now can be done with
``pip install --editable ./ --config-setting="--install-option=--enable-tracing"``.
The old setup.py usage remains, but is discouraged, and the arguments are now passed
after the command (previously they were specified before).

- Use PEP-518 configuration for the package, allowing
configurable builds using more up-to-date Python packaging tooling.
For editable installs, ``python setup.py --enable-tracing develop``
must now be done with ``python setup.py develop --enable-tracing``.

- Update for tests for numpy 2.0.

- Support of np.float16 conversion with arrays.


- **1.5.0 - 2023-04-03**

- Support for Python 3.12

- Switched ``__eq__`` and ``__ne__`` operator to use ``equals`` rather than
``compareTo`` for comparable objects to avoid exception when comparing
object of different types.

- Fixed segmentation fault when comparing Java Comparable to primitives.

- Java exceptions that occur in inequality comparisons now map to Python
TypeError.

- **1.4.2_dev0 - 2022-10-26**

- Fixed crash when calling subscript on JArray.

- Fixed direct byte buffers not reporting nbytes correctly when cast to memoryview.
- Fixed direct byte buffers not reporting nbytes correctly when cast to
memoryview.

- Expand the defintion for Functional interface to include classes without
FunctionInterface annotation.
Expand Down
10 changes: 9 additions & 1 deletion doc/develguide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ must be enabled with a compiler switch to activate. To active the logger, touch
one of the cpp files in the native directory to mark the build as dirty, then
compile the ``jpype`` module with: ::

python setup.py --enable-tracing develop
python setup.py develop --enable-tracing

Once built run a short test program that demonstrates the problem and capture the
output of the terminal to a file. This should allow the developer to isolate
Expand All @@ -959,6 +959,14 @@ To use the Python tracing, start Python with... ::
python -m trace --trace myscript.py


Coverage
--------
Some of the tests require additional instrumentation to run, this can be enabled
with the ``enable-coverage`` option::

python setup.py develop --enable-coverage


Debugging issues
----------------

Expand Down
23 changes: 14 additions & 9 deletions doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,27 +83,32 @@ from `PyPi <http://pypi.python.org/pypi/JPype1>`__.

**2. Build the source with desired options**

Compile JPype using the included ``setup.py`` script: ::
Compile JPype using the `build <https://pypi.org/project/build/>` module (this will produce a wheel): ::

python setup.py build
python -m build /path/to/source

The setup script recognizes several arguments.
A number of additional argument may be provided.

--enable-build-jar Force setup to recreate the jar from scratch.
--enable-tracing Build a verison of JPype with full logging to the
console. This can be used to diagnose tricky JNI
issues.

For example::

python -m build /path/to/source -C--global-option=build_ext -C--global-option="--enable-tracing"

After building, JPype can be tested using the test bench. The test
bench requires JDK to build.

**3. Test JPype with (optional):** ::
**3. Install the built wheel with:** ::

pip install /path/to/wheel

python setup.py test
**4. Test JPype with (optional):** ::

**4. Install JPype with:** ::
python -m pytest

python setup.py install


If it fails...
Expand All @@ -116,7 +121,7 @@ happens, preform the following steps:
1. Identify the location of your systems JDK installation and explicitly passing
it to setup.py. ::

JAVA_HOME=/usr/lib/java/jdk1.8.0/ python setup.py install
JAVA_HOME=/usr/lib/java/jdk1.8.0/ python -m build .

2. If that setup.py still fails please create an Issue `on
github <https://github.com/jpype-project/jpype/issues?state=open>`__ and
Expand All @@ -138,7 +143,7 @@ Debian/Ubuntu
Debian/Ubuntu users will have to install ``g++`` and ``python-dev``.
Use:

sudo apt-get install g++ python-dev python3-dev
sudo apt-get install g++ python3-dev

Windows
:::::::
Expand Down
5 changes: 5 additions & 0 deletions doc/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ Full process:
``git checkout release``
- [ ] Make a new branch for the release cycle
``git checkout -b releases/{version}``
- [ ] Check the .azure scripts to see if they are up to date.
Look on https://devguide.python.org/versions/ to see what versions can be dropped
Check Python versions for Windows
Check Python versions for OSX
Check the manylinux image for Linux
- [ ] Merge the current master with the release
``git pull origin master``
- [ ] Start a release
Expand Down
Loading

0 comments on commit d075ef7

Please sign in to comment.