| <!-- |
| 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.6.8-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> |
| <TEST_TRANSACTIONS>false</TEST_TRANSACTIONS> |
| <gremlin.server.dir>${project.parent.basedir}/gremlin-server</gremlin.server.dir> |
| <tinkerpop.root.dir>${project.parent.basedir}</tinkerpop.root.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> |
| <plugin> |
| <groupId>com.google.code.maven-replacer-plugin</groupId> |
| <artifactId>replacer</artifactId> |
| <configuration> |
| <file>src/main/python/gremlin_python/driver/useragent.py</file> |
| <replacements> |
| <replacement> |
| <token>gremlin_version = ".*"</token> |
| <value>gremlin_version = "${project.version}"</value> |
| </replacement> |
| </replacements> |
| </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> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-antrun-plugin</artifactId> |
| <executions> |
| <!-- |
| copy source files in python directory to target/, to keep testing separate from packaging. |
| we use target/python3 for testing and target/python-packaged for distribution tasks. |
| --> |
| <execution> |
| <id>setup-env</id> |
| <phase>process-resources</phase> |
| <goals> |
| <goal>run</goal> |
| </goals> |
| <configuration> |
| <target> |
| <!-- pytest will create python-reports inside target/python3/python-reports |
| as docker compose cannot access outside its working directory --> |
| <copy todir="${project.build.directory}/python3"> |
| <fileset dir="src/main/python"/> |
| </copy> |
| <copy todir="${project.build.directory}/python-packaged"> |
| <fileset dir="src/main/python"/> |
| </copy> |
| </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="docker-compose" failonerror="true"> |
| <env key="PACKAGE_DIR" value="${project.build.directory}/python-packaged"/> |
| <env key="VERSION" value="${project.version}"/> |
| <env key="PYTHONPATH" value=""/> |
| <arg line="up --build --abort-on-container-exit gremlin-python-package"/> |
| </exec> |
| <exec executable="docker-compose" failonerror="true"> |
| <env key="PYTHONPATH" value=""/> |
| <env key="PACKAGE_DIR" value="${project.build.directory}/python-packaged"/> |
| <arg line="down"/> |
| </exec> |
| <exec executable="docker" failonerror="true"> |
| <env key="PYTHONPATH" value=""/> |
| <env key="PACKAGE_DIR" value="${project.build.directory}/python-packaged"/> |
| <arg line="image prune --filter label=maintainer=dev@tinkerpop.apache.org -f"/> |
| </exec> |
| </target> |
| </configuration> |
| </execution> |
| |
| <!-- |
| use docker-compose to run unit tests, radish, and integration tests. |
| --> |
| <execution> |
| <id>python-tests</id> |
| <phase>integration-test</phase> |
| <goals> |
| <goal>run</goal> |
| </goals> |
| <configuration> |
| <skip>${skipTests}</skip> |
| <target> |
| <exec executable="docker-compose" failonerror="true"> |
| <env key="VERSION" value="${project.version}"/> |
| <env key="PYTHONPATH" value=""/> |
| <env key="GREMLIN_SERVER" value="${project.version}"/> |
| <env key="ABS_PROJECT_HOME" value="${project.basedir}/../"/> |
| <env key="BUILD_DIR" value="${project.build.directory}/python3"/> |
| <arg line="up --build --abort-on-container-exit gremlin-server-test-python gremlin-python-integration-tests"/> |
| </exec> |
| <exec executable="docker-compose" failonerror="true"> |
| <env key="PYTHONPATH" value=""/> |
| <env key="BUILD_DIR" value="${project.build.directory}/python3"/> |
| <arg line="down"/> |
| </exec> |
| <exec executable="docker" failonerror="true"> |
| <env key="PYTHONPATH" value=""/> |
| <env key="BUILD_DIR" value="${project.build.directory}/python3"/> |
| <arg line="image prune --filter label=maintainer=dev@tinkerpop.apache.org -f"/> |
| </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.apache.tinkerpop</groupId> |
| <artifactId>gremlin-language</artifactId> |
| <version>${project.version}</version> |
| </dependency> |
| <dependency> |
| <groupId>org.apache.tinkerpop</groupId> |
| <artifactId>neo4j-gremlin</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>ch.qos.logback</groupId> |
| <artifactId>logback-classic</artifactId> |
| <version>${logback.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> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| </profile> |
| <profile> |
| <id>glv-python-skipped-warning</id> |
| <activation> |
| <activeByDefault>false</activeByDefault> |
| <file> |
| <missing>.glv</missing> |
| </file> |
| </activation> |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>com.github.ekryd.echo-maven-plugin</groupId> |
| <artifactId>echo-maven-plugin</artifactId> |
| <version>1.3.2</version> |
| <executions> |
| <execution> |
| <id>skipped-python-glv-warning</id> |
| <phase>validate</phase> |
| <goals> |
| <goal>echo</goal> |
| </goals> |
| <configuration> |
| <message> |
| Skipping Python GLV build. Activate by creating file tinkerpop/gremlin-python/.glv |
| </message> |
| <level>WARNING</level> |
| </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> |
| <!-- |
| set up and run virtual env to sandbox python. there is no need to "activate" |
| the virtualenv because all calls to python occur directly from bin/ |
| --> |
| <mkdir dir="${project.build.directory}/python-packaged/env"/> |
| <exec dir="${project.build.directory}/python-packaged" executable="virtualenv" |
| failonerror="true"> |
| <arg line="--python=python3 env"/> |
| </exec> |
| <!-- |
| Moving off of 1.12.1 due to incompatibility, password prompt should no longer be |
| an issue with API token access. |
| --> |
| <exec dir="${project.build.directory}/python-packaged" executable="env/bin/pip" |
| failonerror="true"> |
| <arg line="install twine==4.0.2"/> |
| </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> |