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

Cycle #919

Merged
merged 7 commits into from
Jan 4, 2021
Merged

Cycle #919

Show file tree
Hide file tree
Changes from all commits
Commits
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/scripts/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ steps:
- script: |
python -m pytest -v --junit-xml=build/test/test.xml test/jpypetest --checkjni
displayName: 'Test JDK 11'
condition: eq(variables.jpyptest.fast, 'false')
condition: eq(variables['jpypetest.fast'], 'false')

- script: |
python -m pytest -v --junit-xml=build/test/test.xml test/jpypetest --checkjni --fast
displayName: 'Test JDK 11 (fast)'
condition: eq(variables.jpyptest.fast, 'true')
condition: eq(variables['jpypetest.fast'], 'true')

# presence of jpype/ seems to confuse entry_points so `cd` elsewhere
- script: |
Expand Down
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.2.1_dev0
current_version = 1.2.2_dev0
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\_(?P<release>[a-z]+)(?P<build>\d+))?
Expand Down
7 changes: 6 additions & 1 deletion doc/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ Changelog
This changelog *only* contains changes from the *first* pypi release (0.5.4.3) onwards.

Latest Changes:
- **1.2.1_dev0 - 2020-11-29**
- **1.2.2_dev0 - 2021-01-03**
- **1.2.1 - 2021-01-02**

- Missing stub files added.

- Python 3.9 issues are resolved on Windows.

- JPype scans jar files and rebuilding missing directories to allow imports
from stripped and obfuscated jar files.
Expand Down
2 changes: 1 addition & 1 deletion jpype/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
__all__.extend(_jcustomizer.__all__)
__all__.extend(_gui.__all__)

__version__ = "1.2.1_dev0"
__version__ = "1.2.2_dev0"
__version_info__ = __version__.split('.')


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.2.1_dev0";
public final String VERSION = "1.2.2_dev0";

private static JPypeContext INSTANCE = new JPypeContext();
// This is the C++ portion of the context.
Expand Down
15 changes: 6 additions & 9 deletions native/java/org/jpype/classloader/DynamicClassLoader.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.jpype.classloader;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.net.URLClassLoader;
import java.net.URLConnection;
Expand All @@ -14,7 +14,6 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.PathMatcher;
import java.nio.file.Paths;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
Expand All @@ -26,8 +25,6 @@
import java.util.Set;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.logging.Level;
import java.util.logging.Logger;

public class DynamicClassLoader extends ClassLoader
{
Expand Down Expand Up @@ -207,17 +204,17 @@ public void scanJar(Path p1)
try ( JarFile jf = new JarFile(p1.toFile()))
{
Enumeration<JarEntry> entries = jf.entries();
Path abs = p1.toAbsolutePath();
URI abs = p1.toAbsolutePath().toUri();
Set urls = new java.util.HashSet();
while (entries.hasMoreElements())
{
JarEntry next = entries.nextElement();
String name = next.getName();

// Skip over META-INF
if (name.startsWith("META-INF/"))
continue;

if (next.isDirectory())
{
// If we find a directory entry then the jar has directories already
Expand All @@ -232,15 +229,15 @@ public void scanJar(Path p1)
if (i == -1)
break;
String name2 = name.substring(0, i);

i++;

// Already have an entry no problem
if (urls.contains(name2))
continue;

// Add a new entry for the missing directory
String jar = "jar:file:" + abs + "!/" + name2 + "/";
String jar = "jar:" + abs + "!/" + name2 + "/";
urls.add(name2);
this.addResource(name2, new URL(jar));
}
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 @@ -716,7 +716,7 @@ PyMODINIT_FUNC PyInit__jpype()
// PyJPModule = module;
Py_INCREF(module);
PyJPModule = module;
PyModule_AddStringConstant(module, "__version__", "1.2.1_dev0");
PyModule_AddStringConstant(module, "__version__", "1.2.2_dev0");

PyJPClassMagic = PyDict_New();
// Initialize each of the python extension types
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

setup(
name='JPype1',
version='1.2.1_dev0',
version='1.2.2_dev0',
description='A Python to Java bridge.',
long_description=open('README.rst').read(),
license='License :: OSI Approved :: Apache Software License',
Expand Down
2 changes: 2 additions & 0 deletions test/jpypetest/test_jedi.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
except:
pass

# FIXME: some jedi version is causing an issue jpype-project/jpype#920 so we pretend not to have jedi, until it is resolved.
have_jedi = False

class JediTestCase(common.JPypeTestCase):
"""Test tab completion on JPype objects
Expand Down