| <!-- |
| 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. |
| --> |
| <project xmlns="http://maven.apache.org/POM/4.0.0" |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| <modelVersion>4.0.0</modelVersion> |
| <parent> |
| <groupId>org.apache.tinkerpop</groupId> |
| <artifactId>tinkerpop</artifactId> |
| <version>3.5.2-SNAPSHOT</version> |
| </parent> |
| <artifactId>gremlin-python</artifactId> |
| <name>Apache TinkerPop :: Gremlin Python</name> |
| <properties> |
| <!-- provides a way to convert maven.test.skip value to skipTests for use in skipping python tests --> |
| <maven.test.skip>false</maven.test.skip> |
| <skipTests>${maven.test.skip}</skipTests> |
| <gremlin.server.dir>${project.parent.basedir}/gremlin-server</gremlin.server.dir> |
| </properties> |
| <build> |
| <directory>${basedir}/target</directory> |
| <finalName>${project.artifactId}-${project.version}</finalName> |
| <plugins> |
| <!-- |
| there is no point to building/deploying the jvm stuff - there is no java source really - just poms |
| --> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-javadoc-plugin</artifactId> |
| <configuration> |
| <skip>true</skip> |
| </configuration> |
| </plugin> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-source-plugin</artifactId> |
| <configuration> |
| <skipSource>true</skipSource> |
| </configuration> |
| </plugin> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-install-plugin</artifactId> |
| <configuration> |
| <skip>true</skip> |
| </configuration> |
| </plugin> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-deploy-plugin</artifactId> |
| <configuration> |
| <skip>true</skip> |
| </configuration> |
| </plugin> |
| </plugins> |
| </build> |
| |
| <profiles> |
| <!-- activates the building of python components and requires that python be installed on the system --> |
| <profile> |
| <id>glv-python</id> |
| <activation> |
| <activeByDefault>false</activeByDefault> |
| <file> |
| <exists>.glv</exists> |
| </file> |
| </activation> |
| <build> |
| <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>initialize</phase> |
| <goals> |
| <goal>run</goal> |
| </goals> |
| <configuration> |
| <target> |
| <mkdir dir="${project.build.directory}/python-reports"/> |
| <mkdir dir="${project.build.directory}/python-packaged/env"/> |
| </target> |
| </configuration> |
| </execution> |
| <!-- copy files in python directory to target/py and run virtual env to sandbox python. |
| there is no need to "activate" the virtualenv because all calls to python occur |
| directly from bin/ --> |
| <execution> |
| <id>setup-py-env</id> |
| <phase>process-resources</phase> |
| <goals> |
| <goal>run</goal> |
| </goals> |
| <configuration> |
| <tasks> |
| <!-- seems like we need a few different copies of the same source. all the |
| different python stuff doesn't seem to want to share. we use |
| /python3 for basic tests and stuff and /python-packaged for distribution |
| tasks. some of the problem seems to stem from the python lifecycle not |
| binding perfectly well to the maven lifecycle (integration tests seems to |
| cause troubles specifically). note that the commands to install wheel are |
| largely for safety in case someone is using an older version of virtualenv |
| (which doesn't install wheel by default) --> |
| <copy todir="${project.build.directory}/python3"> |
| <fileset dir="src/main/python"/> |
| </copy> |
| <exec dir="${project.build.directory}/python3" executable="python3" |
| failonerror="true"> |
| <arg line="--version"/> |
| </exec> |
| <exec dir="${project.build.directory}/python3" executable="virtualenv" |
| failonerror="true"> |
| <arg line="--version"/> |
| </exec> |
| <exec dir="${project.build.directory}/python3" executable="virtualenv" |
| failonerror="true"> |
| <arg line="--python=python3 env"/> |
| </exec> |
| <exec dir="${project.build.directory}/python3" executable="env/bin/pip" |
| failonerror="true"> |
| <arg line="install wheel radish-bdd PyHamcrest aenum isodate kerberos six"/> |
| </exec> |
| <copy todir="${project.build.directory}/python-packaged"> |
| <fileset dir="src/main/python"/> |
| </copy> |
| <exec dir="${project.build.directory}/python-packaged" executable="virtualenv" |
| failonerror="true"> |
| <arg line="--python=python3 env"/> |
| </exec> |
| <exec dir="${project.build.directory}/python-packaged" executable="env/bin/pip" |
| failonerror="true"> |
| <arg line="install wheel"/> |
| </exec> |
| </tasks> |
| </configuration> |
| </execution> |
| <execution> |
| <id>native-python3-build</id> |
| <phase>compile</phase> |
| <goals> |
| <goal>run</goal> |
| </goals> |
| <configuration> |
| <target> |
| <exec executable="env/bin/python" dir="${project.build.directory}/python3" |
| failonerror="true"> |
| <env key="PYTHONPATH" value=""/> |
| <arg line="setup.py build --build-lib ${project.build.outputDirectory}/Lib"/> |
| </exec> |
| </target> |
| </configuration> |
| </execution> |
| |
| <!-- |
| build/package python source distribution and wheel archive. the version is bound to an |
| environment variable that gets used in setup.py to dynamically construct a module |
| __version__file |
| --> |
| <execution> |
| <id>package-py</id> |
| <phase>package</phase> |
| <goals> |
| <goal>run</goal> |
| </goals> |
| <configuration> |
| <target> |
| <exec executable="env/bin/python" dir="${project.build.directory}/python-packaged" |
| failonerror="true"> |
| <env key="VERSION" value="${project.version}"/> |
| <env key="PYTHONPATH" value=""/> |
| <arg line="setup.py sdist bdist_wheel"/> |
| </exec> |
| </target> |
| </configuration> |
| </execution> |
| |
| <!-- |
| use pytest to execute native python tests - output of xunit output is configured in setup.cfg. |
| this has to be an integration-test because we need gremlin-server running and the standard |
| test phase doesn't have a pre/post event like integration-test does. |
| --> |
| <execution> |
| <id>native-python3-test</id> |
| <phase>integration-test</phase> |
| <goals> |
| <goal>run</goal> |
| </goals> |
| <configuration> |
| <skip>${skipTests}</skip> |
| <target> |
| <exec executable="env/bin/python" dir="${project.build.directory}/python3" |
| failonerror="true"> |
| <env key="PYTHONPATH" value=""/> |
| <env key="KRB5_CONFIG" value="${project.build.directory}/kdc/krb5.conf"/> |
| <env key="KRB5CCNAME" value="${project.build.directory}/kdc/test-tkt.cc"/> |
| <arg line="setup.py test"/> |
| </exec> |
| <!-- radish seems to like all dependencies in place --> |
| <exec executable="env/bin/python" dir="${project.build.directory}/python3" |
| failonerror="true"> |
| <env key="PYTHONPATH" value=""/> |
| <arg line="setup.py install"/> |
| </exec> |
| <!-- run for graphson 3.0 --> |
| <exec executable="env/bin/radish" dir="${project.build.directory}/python3" |
| failonerror="true"> |
| <env key="PYTHONPATH" value=""/> |
| <env key="PYTHONIOENCODING" value="utf-8:surrogateescape"/> |
| <arg line="-f dots -e -t -b ${project.build.directory}/python3/radish ${project.basedir}/../gremlin-test/features/ --user-data="serializer=application/vnd.gremlin-v3.0+json""/> <!-- -no-line-jump --> |
| </exec> |
| <!-- run for graphbinary 1.0 --> |
| <exec executable="env/bin/radish" dir="${project.build.directory}/python3" |
| failonerror="true"> |
| <env key="PYTHONPATH" value=""/> |
| <env key="PYTHONIOENCODING" value="utf-8:surrogateescape"/> |
| <arg line="-f dots -e -t -b ${project.build.directory}/python3/radish ${project.basedir}/../gremlin-test/features/ --user-data="serializer=application/vnd.graphbinary-v1.0""/> <!-- -no-line-jump --> |
| </exec> |
| </target> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| <plugin> |
| <groupId>org.codehaus.gmavenplus</groupId> |
| <artifactId>gmavenplus-plugin</artifactId> |
| <dependencies> |
| <dependency> |
| <groupId>org.apache.tinkerpop</groupId> |
| <artifactId>gremlin-server</artifactId> |
| <version>${project.version}</version> |
| </dependency> |
| <dependency> |
| <groupId>org.apache.tinkerpop</groupId> |
| <artifactId>gremlin-test</artifactId> |
| <version>${project.version}</version> |
| </dependency> |
| <dependency> |
| <groupId>org.codehaus.groovy</groupId> |
| <artifactId>groovy-all</artifactId> |
| <version>${groovy.version}</version> |
| <type>pom</type> |
| <scope>runtime</scope> |
| </dependency> |
| <dependency> |
| <groupId>log4j</groupId> |
| <artifactId>log4j</artifactId> |
| <version>${log4j.version}</version> |
| <scope>runtime</scope> |
| </dependency> |
| </dependencies> |
| <executions> |
| <execution> |
| <id>generate-radish-support</id> |
| <phase>generate-sources</phase> |
| <goals> |
| <goal>execute</goal> |
| </goals> |
| <configuration> |
| <properties> |
| <property> |
| <name>projectBaseDir</name> |
| <value>${project.basedir}/../</value> |
| </property> |
| </properties> |
| <scripts> |
| <script>${project.basedir}/build/generate.groovy</script> |
| </scripts> |
| </configuration> |
| </execution> |
| <execution> |
| <id>gremlin-server-start</id> |
| <phase>pre-integration-test</phase> |
| <goals> |
| <goal>execute</goal> |
| </goals> |
| <configuration> |
| <properties> |
| <property> |
| <name>skipTests</name> |
| <value>${skipTests}</value> |
| </property> |
| <property> |
| <name>gremlinServerDir</name> |
| <value>${gremlin.server.dir}</value> |
| </property> |
| <property> |
| <name>settingsFile</name> |
| <value>${gremlin.server.dir}/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml</value> |
| </property> |
| <property> |
| <name>executionName</name> |
| <value>${project.name}</value> |
| </property> |
| <property> |
| <name>projectBaseDir</name> |
| <value>${project.basedir}</value> |
| </property> |
| </properties> |
| <scripts> |
| <script>${gremlin.server.dir}/src/test/scripts/test-server-start.groovy</script> |
| </scripts> |
| </configuration> |
| </execution> |
| <execution> |
| <id>gremlin-server-stop</id> |
| <phase>post-integration-test</phase> |
| <goals> |
| <goal>execute</goal> |
| </goals> |
| <configuration> |
| <properties> |
| <property> |
| <name>skipTests</name> |
| <value>${skipTests}</value> |
| </property> |
| <property> |
| <name>executionName</name> |
| <value>${project.name}</value> |
| </property> |
| </properties> |
| <scripts> |
| <script>${gremlin.server.dir}/src/test/scripts/test-server-stop.groovy</script> |
| </scripts> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| </profile> |
| <!-- |
| Provides a way to deploy the gremlinpython GLV to pypi. This cannot be part of the standard maven execution |
| because pypi does not have a staging environment like sonatype for releases. As soon as the release is |
| published it is public. In our release workflow, deploy occurs prior to vote on the release and we can't |
| make this stuff public until the vote is over. |
| --> |
| <profile> |
| <id>glv-python-deploy</id> |
| <activation> |
| <activeByDefault>false</activeByDefault> |
| <property> |
| <name>pypi</name> |
| </property> |
| </activation> |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-antrun-plugin</artifactId> |
| <executions> |
| <!-- deploy to pypi. assumes that ~/.pypirc is configured appropriately --> |
| <execution> |
| <id>deploy-py</id> |
| <phase>deploy</phase> |
| <goals> |
| <goal>run</goal> |
| </goals> |
| <configuration> |
| <target> |
| <!-- |
| seems like https://github.com/pypa/twine/issues/338 is the reason to stay bound |
| to this old version of twine. as long as keyring gets in the way and can't be |
| disabled as described then you don't get a prompt for the password on deploy |
| to pypi |
| --> |
| <exec dir="${project.build.directory}/python-packaged" executable="env/bin/pip" |
| failonerror="true"> |
| <arg line="install twine==1.12.1"/> |
| </exec> |
| <!-- check the dist for errors before deploying --> |
| <exec dir="${project.build.directory}/python-packaged" executable="env/bin/twine" |
| failonerror="true"> |
| <arg line="check dist/*"/> |
| </exec> |
| <!-- to use the pypi test environment add: -r pypitest --> |
| <exec dir="${project.build.directory}/python-packaged" executable="env/bin/twine" |
| failonerror="true"> |
| <arg line="upload dist/* -r pypi -s "/> |
| </exec> |
| </target> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| </profile> |
| </profiles> |
| </project> |