You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2016/06/22 16:05:06 UTC

[1/4] tinkerpop git commit: add license boilerplate to __version__

Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1278 7d2a1bfb8 -> 8d1bbeea2


add license boilerplate to __version__

also import __version__ in setup.py instead of eval-ing it


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/19cf29ef
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/19cf29ef
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/19cf29ef

Branch: refs/heads/TINKERPOP-1278
Commit: 19cf29efa103ed360608cae3baf20298bf9a41bf
Parents: df0896c
Author: Leifur Halldor Asgeirsson <la...@zerofail.com>
Authored: Wed Jun 22 11:52:22 2016 -0400
Committer: Leifur Halldor Asgeirsson <la...@zerofail.com>
Committed: Wed Jun 22 11:52:22 2016 -0400

----------------------------------------------------------------------
 gremlin-variant/src/main/jython/setup.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/19cf29ef/gremlin-variant/src/main/jython/setup.py
----------------------------------------------------------------------
diff --git a/gremlin-variant/src/main/jython/setup.py b/gremlin-variant/src/main/jython/setup.py
index b0a5913..05f1dc3 100644
--- a/gremlin-variant/src/main/jython/setup.py
+++ b/gremlin-variant/src/main/jython/setup.py
@@ -33,11 +33,15 @@ version_file = os.path.join(root, '.', '__version__.py')
 if not os.path.exists(os.path.join(root, 'PKG-INFO')):
     timestamp = int(os.getenv('TIMESTAMP', time.time() * 1000)) / 1000
     fd = codecs.open(version_file, 'w', 'utf-8')
+    fd.write("'''")
+    fd.write(__doc__)
+    fd.write("'''\n")
     fd.write('version   = %r\n' % os.getenv('VERSION', '?').replace('-SNAPSHOT', '.dev-%d' % timestamp))
     fd.write('timestamp = %d\n' % timestamp)
     fd.close()
 # Load version
-exec(open(version_file).read())
+import __version__
+version = __version__.version
 
 setup(
     name='gremlinpython',


[3/4] tinkerpop git commit: Merge branch 'python_version_license_boilerplate' of https://github.com/leifurhauks/incubator-tinkerpop into TINKERPOP-1278

Posted by ok...@apache.org.
Merge branch 'python_version_license_boilerplate' of https://github.com/leifurhauks/incubator-tinkerpop into TINKERPOP-1278


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/5e25824b
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5e25824b
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5e25824b

Branch: refs/heads/TINKERPOP-1278
Commit: 5e25824bec44e278ecbca00d28167f61d781e407
Parents: 0ecac54 19cf29e
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Jun 22 10:01:00 2016 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Jun 22 10:01:00 2016 -0600

----------------------------------------------------------------------
 gremlin-variant/src/main/jython/setup.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



[4/4] tinkerpop git commit: updated .gitignore to be global to tinkerpop -- py compiled class stuff.

Posted by ok...@apache.org.
updated .gitignore to be global to tinkerpop -- py compiled class stuff.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8d1bbeea
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8d1bbeea
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8d1bbeea

Branch: refs/heads/TINKERPOP-1278
Commit: 8d1bbeea2f9e086417d0a894d3c58d07f263b35e
Parents: 5e25824
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Jun 22 10:05:03 2016 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Jun 22 10:05:03 2016 -0600

----------------------------------------------------------------------
 .gitignore                                                | 3 +++
 gremlin-variant/src/main/jython/gremlin_python/.gitignore | 2 --
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8d1bbeea/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 498cb31..9d83c5a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,3 +16,6 @@ docs/*.asciidoc
 ext/
 benchmarks/
 *$py.class
+__pycache__/
+*.py[cdo]
+__version__.py

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8d1bbeea/gremlin-variant/src/main/jython/gremlin_python/.gitignore
----------------------------------------------------------------------
diff --git a/gremlin-variant/src/main/jython/gremlin_python/.gitignore b/gremlin-variant/src/main/jython/gremlin_python/.gitignore
deleted file mode 100644
index 2a33696..0000000
--- a/gremlin-variant/src/main/jython/gremlin_python/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-__pycache__/
-*.py[cdo]


[2/4] tinkerpop git commit: added GremlinJythonScriptEngineFactory to META-INF and created a test case stub.

Posted by ok...@apache.org.
added GremlinJythonScriptEngineFactory to META-INF and created a test case stub.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/0ecac548
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/0ecac548
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/0ecac548

Branch: refs/heads/TINKERPOP-1278
Commit: 0ecac548e9ef657d8f17aecc584b5499e6016823
Parents: 7d2a1bf
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Jun 22 10:00:55 2016 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Jun 22 10:00:55 2016 -0600

----------------------------------------------------------------------
 .../jsr223/GremlinJythonScriptEngine.java       |  2 +-
 .../jsr223/GremlinJythonScriptEngineTest.java   | 50 ++++++++++++++++++++
 .../services/javax.script.ScriptEngineFactory   |  1 +
 3 files changed, 52 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0ecac548/gremlin-variant/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/GremlinJythonScriptEngine.java
----------------------------------------------------------------------
diff --git a/gremlin-variant/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/GremlinJythonScriptEngine.java b/gremlin-variant/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/GremlinJythonScriptEngine.java
index f58101c..090fa5c 100644
--- a/gremlin-variant/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/GremlinJythonScriptEngine.java
+++ b/gremlin-variant/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/GremlinJythonScriptEngine.java
@@ -38,7 +38,7 @@ import java.util.Arrays;
  */
 public class GremlinJythonScriptEngine implements ScriptEngine {
 
-    final PyScriptEngine pyScriptEngine;
+    private final PyScriptEngine pyScriptEngine;
 
     public GremlinJythonScriptEngine() {
         this.pyScriptEngine = (PyScriptEngine) new PyScriptEngineFactory().getScriptEngine();

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0ecac548/gremlin-variant/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/GremlinJythonScriptEngineTest.java
----------------------------------------------------------------------
diff --git a/gremlin-variant/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/GremlinJythonScriptEngineTest.java b/gremlin-variant/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/GremlinJythonScriptEngineTest.java
new file mode 100644
index 0000000..7582877
--- /dev/null
+++ b/gremlin-variant/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/GremlinJythonScriptEngineTest.java
@@ -0,0 +1,50 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.tinkerpop.gremlin.python.jsr223;
+
+import org.junit.Test;
+
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public class GremlinJythonScriptEngineTest {
+
+    @Test
+    public void shouldGetEngineByName() throws Exception {
+        final ScriptEngine engine = new ScriptEngineManager().getEngineByName("gremlin-jython");
+        assertNotNull(engine);
+        assertTrue(engine instanceof GremlinJythonScriptEngine);
+        assertTrue(engine.eval("Graph") instanceof Class);
+        assertEquals(3, engine.eval("1+2"));
+    }
+
+    @Test
+    public void shouldHaveStandardImports() throws Exception {
+        final ScriptEngine engine = new ScriptEngineManager().getEngineByName("gremlin-jython");
+        assertTrue(engine.eval("Graph") instanceof Class);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0ecac548/gremlin-variant/src/test/resources/META-INF/services/javax.script.ScriptEngineFactory
----------------------------------------------------------------------
diff --git a/gremlin-variant/src/test/resources/META-INF/services/javax.script.ScriptEngineFactory b/gremlin-variant/src/test/resources/META-INF/services/javax.script.ScriptEngineFactory
index 24c8a75..910facc 100644
--- a/gremlin-variant/src/test/resources/META-INF/services/javax.script.ScriptEngineFactory
+++ b/gremlin-variant/src/test/resources/META-INF/services/javax.script.ScriptEngineFactory
@@ -1 +1,2 @@
 org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngineFactory
+org.apache.tinkerpop.gremlin.python.jsr223.GremlinJythonScriptEngineFactory
\ No newline at end of file