You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2016/08/27 00:54:55 UTC

[40/50] [abbrv] tinkerpop git commit: Require -DglvPython to build/test the native python portions of gremlin-python

Require -DglvPython to build/test the native python portions of gremlin-python


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

Branch: refs/heads/master
Commit: 4b09cdfc5c2b28106f38f91d827620698c0dfa13
Parents: 3c8f498
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Aug 26 15:21:52 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Aug 26 15:26:27 2016 -0400

----------------------------------------------------------------------
 gremlin-python/pom.xml | 297 ++++++++++++++++++++++++++------------------
 1 file changed, 174 insertions(+), 123 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4b09cdfc/gremlin-python/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-python/pom.xml b/gremlin-python/pom.xml
index d7006f9..a03cdbb 100644
--- a/gremlin-python/pom.xml
+++ b/gremlin-python/pom.xml
@@ -92,46 +92,6 @@
             </testResource>
         </testResources>
         <plugins>
-            <!-- need to create python-reports directory at this point or else pytest can't write the report to it -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-antrun-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>create-python-reports-directory</id>
-                        <phase>process-resources</phase>
-                        <goals>
-                            <goal>run</goal>
-                        </goals>
-                        <configuration>
-                            <tasks>
-                                <delete dir="${build.directory}/python-reports"/>
-                                <mkdir dir="${build.directory}/python-reports"/>
-                            </tasks>
-                        </configuration>
-                    </execution>
-                    <!--
-                    use pytest to execute native python tests - output of xunit output is configured in setup.cfg.
-                    had to use the ant plugin - maven-exec-plugin
-                    -->
-                    <execution>
-                        <phase>integration-test</phase>
-                        <goals>
-                            <goal>run</goal>
-                        </goals>
-                        <configuration>
-                            <skip>${skipTests}</skip>
-                            <target>
-                                <exec executable="python"
-                                      dir="${basedir}/target/python">
-                                    <arg value="setup.py"/>
-                                    <arg value="test"/>
-                                </exec>
-                            </target>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>exec-maven-plugin</artifactId>
@@ -151,40 +111,6 @@
                             </arguments>
                         </configuration>
                     </execution>
-                    <execution>
-                        <id>build-python</id>
-                        <phase>generate-test-resources</phase>
-                        <goals>
-                            <goal>exec</goal>
-                        </goals>
-                        <configuration>
-                            <executable>python</executable>
-                            <workingDirectory>${basedir}/target/python</workingDirectory>
-                            <commandlineArgs>setup.py build --build-lib ${project.build.testOutputDirectory}/Lib
-                            </commandlineArgs>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <artifactId>maven-resources-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>copy-py-files-to-target</id>
-                        <phase>process-resources</phase>
-                        <goals>
-                            <goal>copy-resources</goal>
-                        </goals>
-                        <configuration>
-                            <outputDirectory>${basedir}/target/python</outputDirectory>
-                            <resources>
-                                <resource>
-                                    <directory>${basedir}/src/main/jython</directory>
-                                    <filtering>true</filtering>
-                                </resource>
-                            </resources>
-                        </configuration>
-                    </execution>
                 </executions>
             </plugin>
             <plugin>
@@ -210,43 +136,6 @@
                 </configuration>
             </plugin>
             <plugin>
-                <groupId>net.sf.mavenjython</groupId>
-                <artifactId>jython-compile-maven-plugin</artifactId>
-                <version>1.4</version>
-                <executions>
-                    <execution>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>jython</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>pythonDependencies</id>
-                        <phase>generate-test-resources</phase>
-                        <goals>
-                            <goal>jython</goal>
-                        </goals>
-                        <configuration>
-                            <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
-                            <libraries>
-                                <param>aenum</param>
-                                <param>requests</param>
-                                <param>tornado</param>
-                            </libraries>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <configuration>
-                    <systemPropertyVariables>
-                        <python.home>${project.build.testOutputDirectory}</python.home>
-                    </systemPropertyVariables>
-                </configuration>
-            </plugin>
-            <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-clean-plugin</artifactId>
                 <version>3.0.0</version>
@@ -321,6 +210,169 @@
     </build>
 
     <profiles>
+        <!-- This default profile works around the issue where the glvPython profile which is expected to run all tests
+             can't override the exclusions defined below. -->
+        <profile>
+            <id>glv-python-standard</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <build>
+                <plugins>
+                    <!-- excludes python related tests that require python itself installed on the system - run with the
+                         python profile if python is present -->
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <configuration>
+                            <systemPropertyVariables>
+                                <python.home>${project.build.testOutputDirectory}</python.home>
+                            </systemPropertyVariables>
+                            <excludes>
+                                <exclude>**/jsr223/Python*Test.java</exclude>
+                                <exclude>**/graphson/GraphSON*Test.java</exclude>
+                            </excludes>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <!-- activates the building of python components and requires that python be installed on the system -->
+        <profile>
+            <id>glv-python</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+                <property>
+                    <name>glvPython</name>
+                </property>
+            </activation>
+            <build>
+                <!-- don't exclude any tests as python is assumed to be installed on this system -->
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <configuration>
+                            <systemPropertyVariables>
+                                <python.home>${project.build.testOutputDirectory}</python.home>
+                            </systemPropertyVariables>
+                        </configuration>
+                    </plugin>
+                    <!-- get a clean copy of the python files for native processing -->
+                    <plugin>
+                        <artifactId>maven-resources-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>copy-py-files-to-target</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>copy-resources</goal>
+                                </goals>
+                                <configuration>
+                                    <outputDirectory>${basedir}/target/python</outputDirectory>
+                                    <resources>
+                                        <resource>
+                                            <directory>${basedir}/src/main/jython</directory>
+                                            <filtering>true</filtering>
+                                        </resource>
+                                    </resources>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
+                        <version>1.2.1</version>
+                        <executions>
+                            <execution>
+                                <id>build-python</id>
+                                <phase>generate-test-resources</phase>
+                                <goals>
+                                    <goal>exec</goal>
+                                </goals>
+                                <configuration>
+                                    <executable>python</executable>
+                                    <workingDirectory>${basedir}/target/python</workingDirectory>
+                                    <commandlineArgs>setup.py build --build-lib ${project.build.testOutputDirectory}/Lib
+                                    </commandlineArgs>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <!-- required for the jython tests -->
+                    <plugin>
+                        <groupId>net.sf.mavenjython</groupId>
+                        <artifactId>jython-compile-maven-plugin</artifactId>
+                        <version>1.4</version>
+                        <executions>
+                            <execution>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>jython</goal>
+                                </goals>
+                            </execution>
+                            <execution>
+                                <id>pythonDependencies</id>
+                                <phase>generate-test-resources</phase>
+                                <goals>
+                                    <goal>jython</goal>
+                                </goals>
+                                <configuration>
+                                    <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
+                                    <libraries>
+                                        <param>aenum</param>
+                                        <param>requests</param>
+                                        <param>tornado</param>
+                                    </libraries>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <!-- need to create python-reports directory at this point or else pytest can't write the report to it -->
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-antrun-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>create-python-reports-directory</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>run</goal>
+                                </goals>
+                                <configuration>
+                                    <tasks>
+                                        <delete dir="${build.directory}/python-reports"/>
+                                        <mkdir dir="${build.directory}/python-reports"/>
+                                    </tasks>
+                                </configuration>
+                            </execution>
+                            <!--
+                            use pytest to execute native python tests - output of xunit output is configured in setup.cfg.
+                            had to use the ant plugin - maven-exec-plugin
+                            -->
+                            <execution>
+                                <phase>integration-test</phase>
+                                <goals>
+                                    <goal>run</goal>
+                                </goals>
+                                <configuration>
+                                    <skip>${skipTests}</skip>
+                                    <target>
+                                        <exec executable="python"
+                                              dir="${basedir}/target/python"
+                                              failonerror="true">
+                                            <arg value="setup.py"/>
+                                            <arg value="test"/>
+                                        </exec>
+                                    </target>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
         <!--
         Provides a way to deploy the gremlinpython GLV to pypi. Requires installation of pip/virtualenv. See the
         developer docs for more information on how to configure these settings to get this profile to work. The profile
@@ -328,11 +380,11 @@
         which is copied to target/py.
         -->
         <profile>
-            <id>glv-python</id>
+            <id>glv-python-deploy</id>
             <activation>
                 <activeByDefault>false</activeByDefault>
                 <property>
-                    <name>glvPython</name>
+                    <name>glvPythonDeploy</name>
                 </property>
             </activation>
             <build>
@@ -345,6 +397,9 @@
                             <execution>
                                 <id>setup-py-env</id>
                                 <phase>generate-resources</phase>
+                                <goals>
+                                    <goal>run</goal>
+                                </goals>
                                 <configuration>
                                     <tasks>
                                         <mkdir dir="${project.build.directory}/py/env"/>
@@ -357,9 +412,6 @@
                                         </exec>
                                     </tasks>
                                 </configuration>
-                                <goals>
-                                    <goal>run</goal>
-                                </goals>
                             </execution>
                             <!--
                             build/package python source distribution and wheel archive. the version is bound to an
@@ -369,6 +421,9 @@
                             <execution>
                                 <id>package-py</id>
                                 <phase>package</phase>
+                                <goals>
+                                    <goal>run</goal>
+                                </goals>
                                 <configuration>
                                     <tasks>
                                         <exec dir="${project.build.directory}/py" executable="env/bin/python"
@@ -383,15 +438,14 @@
                                         </exec>
                                     </tasks>
                                 </configuration>
-                                <goals>
-                                    <goal>run</goal>
-                                </goals>
                             </execution>
                             <!-- deploy to pypi. assumes that ~/.pypirc is configured appropriately -->
-
                             <execution>
                                 <id>deploy-py</id>
                                 <phase>deploy</phase>
+                                <goals>
+                                    <goal>run</goal>
+                                </goals>
                                 <configuration>
                                     <tasks>
                                         <exec dir="${project.build.directory}/py" executable="env/bin/pip"
@@ -404,9 +458,6 @@
                                         </exec>
                                     </tasks>
                                 </configuration>
-                                <goals>
-                                    <goal>run</goal>
-                                </goals>
                             </execution>
                         </executions>
                     </plugin>