/
pom.xml
654 lines (648 loc) · 36.1 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
<!--
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.4.10</version>
</parent>
<artifactId>gremlin-python</artifactId>
<name>Apache TinkerPop :: Gremlin Python</name>
<dependencies>
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.python</groupId>
<artifactId>jython-standalone</artifactId>
<version>2.7.1</version>
</dependency>
<!-- TESTING -->
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkergraph-gremlin</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-test</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-server</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<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>
<resources>
<resource>
<directory>src/main/resources
</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>${basedir}/src/test/resources
</directory>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
<configuration>
<filesets>
<!-- SOURCE DIRECTORIES -->
<fileset>
<directory>${basedir}/src/main/jython/gremlin_python</directory>
<includes>
<include>**/*.pyc</include>
<include>**/*.class</include>
</includes>
<excludes>
<exclude>**/*.py</exclude>
</excludes>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${basedir}/src/main/jython/gremlin_python/driver</directory>
<includes>
<include>**/*.pyc</include>
<include>**/*.class</include>
</includes>
<excludes>
<exclude>**/*.py</exclude>
</excludes>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${basedir}/src/main/jython/gremlin_python/process</directory>
<includes>
<include>**/*.pyc</include>
<include>**/*.class</include>
</includes>
<excludes>
<exclude>**/*.py</exclude>
</excludes>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${basedir}/src/main/jython/gremlin_python/structure</directory>
<includes>
<include>**/*.pyc</include>
<include>**/*.class</include>
</includes>
<excludes>
<exclude>**/*.py</exclude>
</excludes>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${basedir}/src/main/jython/gremlin_python/structure/io</directory>
<includes>
<include>**/*.pyc</include>
<include>**/*.class</include>
</includes>
<excludes>
<exclude>**/*.py</exclude>
</excludes>
<followSymlinks>false</followSymlinks>
</fileset>
<!-- TEST DIRECTORIES -->
<fileset>
<directory>${basedir}/src/main/jython/tests</directory>
<includes>
<include>**/*.pyc</include>
<include>**/*.class</include>
</includes>
<excludes>
<exclude>**/*.py</exclude>
</excludes>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${basedir}/src/main/jython/tests/driver</directory>
<includes>
<include>**/*.pyc</include>
<include>**/*.class</include>
</includes>
<excludes>
<exclude>**/*.py</exclude>
</excludes>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${basedir}/src/main/jython/tests/process</directory>
<includes>
<include>**/*.pyc</include>
<include>**/*.class</include>
</includes>
<excludes>
<exclude>**/*.py</exclude>
</excludes>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${basedir}/src/main/jython/tests/structure</directory>
<includes>
<include>**/*.pyc</include>
<include>**/*.class</include>
</includes>
<excludes>
<exclude>**/*.py</exclude>
</excludes>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${basedir}/src/main/jython/tests/structure/io</directory>
<includes>
<include>**/*.pyc</include>
<include>**/*.class</include>
</includes>
<excludes>
<exclude>**/*.py</exclude>
</excludes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<!-- This default profile works around the issue where the glv-python 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 glVPython is present -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<python.home>${project.build.outputDirectory}</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>
<file>
<exists>.glv</exists>
</file>
</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.outputDirectory}</python.home>
</systemPropertyVariables>
</configuration>
</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>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 jython 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/jython stuff doesn't seem to want to share. we use
/python for basic tests and stuff, /jython for jython compilation with
the jython plugin, /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/jython"/>
</copy>
<copy todir="${project.build.directory}/python2">
<fileset dir="src/main/jython"/>
</copy>
<copy todir="${project.build.directory}/python-packaged">
<fileset dir="src/main/jython"/>
</copy>
<!-- print versions of python and virtualenv -->
<exec dir="${project.build.directory}/python2" executable="python2"
failonerror="true">
<arg line="--version"/>
</exec>
<exec dir="${project.build.directory}/python2" executable="python3"
failonerror="true">
<arg line="--version"/>
</exec>
<exec dir="${project.build.directory}/python2" executable="virtualenv"
failonerror="true">
<arg line="--version"/>
</exec>
<exec dir="${project.build.directory}/python2" executable="virtualenv"
failonerror="true">
<arg line="--python=python2 env"/>
</exec>
<!-- pip 20 doesn't work with python 2 it seems -->
<exec dir="${project.build.directory}/python2" executable="env/bin/python"
failonerror="true">
<arg line="-m pip install pip>=19.3.1,<20.0.0"/>
</exec>
<exec dir="${project.build.directory}/python2" executable="env/bin/pip"
failonerror="true">
<arg line="install wheel radish-bdd PyHamcrest aenum isodate"/>
</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"/>
</exec>
<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-python2-build</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<exec executable="env/bin/python" dir="${project.build.directory}/python2"
failonerror="true">
<env key="PYTHONPATH" value=""/>
<!-- oddly the "build-lib" needs to be in place or else docs won't generate -->
<arg line="setup.py build --build-lib ${project.build.outputDirectory}/Lib"/>
</exec>
</target>
</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-python2-test</id>
<phase>integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<skip>${skipTests}</skip>
<target>
<!-- setup.py seems to have troubles with the recently published zipp 1.0.0 -->
<exec dir="${project.build.directory}/python2" executable="env/bin/python"
failonerror="true">
<arg line="-m pip install zipp>=0.5.0,<1.0.0"/>
</exec>
<exec executable="env/bin/python" dir="${project.build.directory}/python2"
failonerror="true">
<env key="PYTHONPATH" value=""/>
<arg line="setup.py test"/>
</exec>
<!-- radish seems to like all dependencies in place -->
<exec executable="env/bin/python" dir="${project.build.directory}/python2"
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}/python2"
failonerror="true">
<env key="PYTHONPATH" value=""/>
<env key="PYTHONIOENCODING" value="utf-8:surrogateescape"/>
<arg line="-f dots -e -t -b ${project.build.directory}/python2/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}/python2"
failonerror="true">
<env key="PYTHONPATH" value=""/>
<env key="PYTHONIOENCODING" value="utf-8:surrogateescape"/>
<arg line="-f dots -e -t -b ${project.build.directory}/python2/radish ${project.basedir}/../gremlin-test/features/ --user-data="serializer=application/vnd.graphbinary-v1.0""/> <!-- -no-line-jump -->
</exec>
</target>
</configuration>
</execution>
<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=""/>
<arg line="setup.py test"/>
</exec>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<dependencies>
<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-dsl</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}/glv/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>python</name>
<value>true</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>
<!--
pypi doesn't have a staging area like sonatype so the deploy to pypi is done out of the normal
release band. it is performed after successful VOTE in which case, the maven artifacts should
not be deployed again - hence the plugin is disabled. deployment to pypi uses the antrun plugin
below with twine so disabling the plugin has no effect on the pypi deployment.
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<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>