diff --git a/.gitignore b/.gitignore index b00e07c..fa3e178 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /py4j-0.10.tar.gz /py4j-0.10.1.tar.gz /py4j-0.10.2.1.tar.gz +/py4j-0.10.3.tar.gz diff --git a/py4j-0.10.2.1-Base64-java8.patch b/py4j-0.10.2.1-Base64-java8.patch deleted file mode 100644 index 591698a..0000000 --- a/py4j-0.10.2.1-Base64-java8.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- a/py4j-java/src/main/java/py4j/Protocol.java 2016-03-12 20:58:42.000000000 +0100 -+++ b/py4j-java/src/main/java/py4j/Protocol.java 2016-03-25 19:53:40.557619276 +0100 -@@ -34,6 +34,7 @@ - import java.lang.reflect.InvocationTargetException; - import java.lang.reflect.Proxy; - import java.math.BigDecimal; -+import java.util.Base64; - - import py4j.reflection.PythonProxyHandler; - import py4j.reflection.ReflectionUtil; -@@ -145,7 +146,7 @@ - * @return - */ - public static String encodeBytes(byte[] bytes) { -- return Base64.encodeToString(bytes, false); -+ return Base64.getEncoder().encodeToString(bytes); - } - - /** -@@ -170,7 +171,7 @@ - * @return The byte array corresponding to this command part. - */ - public final static byte[] getBytes(String commandPart) { -- return Base64.decode(commandPart.substring(1)); -+ return Base64.getDecoder().decode(commandPart.substring(1)); - } - - /** ---- a/py4j-java/src/test/java/py4j/ProtocolTest.java 2016-07-10 11:30:42.000000000 +0100 -+++ b/py4j-java/src/test/java/py4j/ProtocolTest.java 2016-07-10 11:38:09.651825796 +0100 -@@ -32,6 +32,7 @@ - import static org.junit.Assert.*; - - import java.math.BigDecimal; -+import java.util.Base64; - - import org.junit.Test; - -@@ -50,7 +51,7 @@ - public void testBytes() { - byte[] bytes = { 1, 100, 127, 0, 60, 15, -128, -1, 14, -55 }; - String bytesString = Protocol.encodeBytes(bytes); -- byte[] bytes2 = Base64.decode(bytesString); -+ byte[] bytes2 = Base64.getDecoder().decode(bytesString); - assertArrayEquals(bytes, bytes2); - - Gateway g = new Gateway(null); diff --git a/py4j-0.10.3-Base64-java8.patch b/py4j-0.10.3-Base64-java8.patch new file mode 100644 index 0000000..591698a --- /dev/null +++ b/py4j-0.10.3-Base64-java8.patch @@ -0,0 +1,47 @@ +--- a/py4j-java/src/main/java/py4j/Protocol.java 2016-03-12 20:58:42.000000000 +0100 ++++ b/py4j-java/src/main/java/py4j/Protocol.java 2016-03-25 19:53:40.557619276 +0100 +@@ -34,6 +34,7 @@ + import java.lang.reflect.InvocationTargetException; + import java.lang.reflect.Proxy; + import java.math.BigDecimal; ++import java.util.Base64; + + import py4j.reflection.PythonProxyHandler; + import py4j.reflection.ReflectionUtil; +@@ -145,7 +146,7 @@ + * @return + */ + public static String encodeBytes(byte[] bytes) { +- return Base64.encodeToString(bytes, false); ++ return Base64.getEncoder().encodeToString(bytes); + } + + /** +@@ -170,7 +171,7 @@ + * @return The byte array corresponding to this command part. + */ + public final static byte[] getBytes(String commandPart) { +- return Base64.decode(commandPart.substring(1)); ++ return Base64.getDecoder().decode(commandPart.substring(1)); + } + + /** +--- a/py4j-java/src/test/java/py4j/ProtocolTest.java 2016-07-10 11:30:42.000000000 +0100 ++++ b/py4j-java/src/test/java/py4j/ProtocolTest.java 2016-07-10 11:38:09.651825796 +0100 +@@ -32,6 +32,7 @@ + import static org.junit.Assert.*; + + import java.math.BigDecimal; ++import java.util.Base64; + + import org.junit.Test; + +@@ -50,7 +51,7 @@ + public void testBytes() { + byte[] bytes = { 1, 100, 127, 0, 60, 15, -128, -1, 14, -55 }; + String bytesString = Protocol.encodeBytes(bytes); +- byte[] bytes2 = Base64.decode(bytesString); ++ byte[] bytes2 = Base64.getDecoder().decode(bytesString); + assertArrayEquals(bytes, bytes2); + + Gateway g = new Gateway(null); diff --git a/py4j.spec b/py4j.spec index 0adb2dd..fe49140 100644 --- a/py4j.spec +++ b/py4j.spec @@ -12,7 +12,7 @@ %bcond_without html Name: py4j -Version: 0.10.2.1 +Version: 0.10.3 Release: 1%{?dist} Summary: Dynamically access in Python programs to arbitrary Java objects @@ -54,12 +54,29 @@ Python collection methods. Py4J also enables Java programs to call back Python objects. Py4J is distributed under the BSD license. +%package -n python2-%{name} +Summary: Py4J enables Python2 programs to dynamically access arbitrary Java objects +Requires: python2 +Requires: %{name}-java = %{version}-%{release} +%{?python_provide:%python_provide python2-%{name}} + +%description -n python2-%{name} +Py4J enables Python2 programs running in a Python interpreter +to dynamically access Java objects in a Java Virtual Machine. +Methods are called as if the Java objects resided in the Python +interpreter and Java collections can be accessed through standard +Python collection methods. +Py4J also enables Java programs to call back Python objects. +Py4J is distributed under the BSD license. + +This package is for usage with Python2 only. %if %{with python3} %package -n python3-%{name} Summary: Py4J enables Python3 programs to dynamically access arbitrary Java objects Requires: python3 Requires: %{name}-java = %{version}-%{release} +%{?python_provide:%python_provide python3-%{name}} %description -n python3-%{name} Py4J enables Python3 programs running in a Python interpreter @@ -69,6 +86,7 @@ interpreter and Java collections can be accessed through standard Python collection methods. Py4J also enables Java programs to call back Python objects. Py4J is distributed under the BSD license. + This package is for usage with Python3 only. %endif @@ -233,7 +251,7 @@ ant -f %{name}-java/build.xml python-test %endif -%files +%files -n python2-%{name} %license %{name}-python/LICENSE.txt %doc README.rst %{python2_sitelib}/*.egg-info @@ -266,6 +284,11 @@ ant -f %{name}-java/build.xml python-test %changelog +* Thu Sep 01 2016 Raphael Groner - 0.10.3-1 +- new version +- add python3 subpackage +- add python_provide macro + * Sun Jul 10 2016 Raphael Groner - 0.10.2.1-1 - new version diff --git a/sources b/sources index 1e238b5..afcb28f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -af46bacc5013b677b721a1a158c5bf3d py4j-0.10.2.1.tar.gz +aad9d3da4527557c0c69963298345923 py4j-0.10.3.tar.gz