Skip to content

Commit fb20adf

Browse files
committed
TINKERPOP-3199 Updated build system to work with setuptools>=60
Moved from setup.py and setup.cfg to pyproject.toml to conform to current Python build setup. Version needs to be manually set now as scripts aren't allowed to run during build process. Decided this was best for now but could move to setuptools-scm later to make it more automated like it was before.
1 parent de99ce6 commit fb20adf

File tree

7 files changed

+84
-125
lines changed

7 files changed

+84
-125
lines changed

docs/src/dev/developer/release.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ deployment.
147147
. `docker/build.sh -t -i -n`
148148
. `bin/publish-docs.sh <username>` - note that under a release candidate the documentation is published as SNAPSHOT
149149
. `mvn versions:set -DnewVersion=xx.yy.zz -DgenerateBackupPoms=false` to update the project files to reference a non-SNAPSHOT version
150+
.. Manually update the `__version__` for `gremlin-python` in `gremlin-python/src/main/python/gremlin_python/__init__.py`
150151
. `mvn clean install -DskipTests` to update GLV versions
151152
.. Review `Gremlin.Net.csproj`, `Gremlin.Net.Template.csproj` and `Gremlin.Net.Template.nuspec` in `gremlin-dotnet`
152153
.. Review `package.json` and `package-lock.json` in `gremlin-javascript` and in `gremlint`
@@ -156,6 +157,7 @@ deployment.
156157
. `git tag -a -m "TinkerPop xx.yy.zz release" xx.yy.zz` and `git push --tags`
157158
. `mvn clean install`
158159
. `mvn versions:set -DnewVersion=xx.yy.zz-SNAPSHOT -DgenerateBackupPoms=false` to go back to SNAPSHOT
160+
.. Manually update the `__version__` for `gremlin-python` in `gremlin-python/src/main/python/gremlin_python/__init__.py` to a dev version like `xx.yy.zz.dev1`
159161
. `mvn clean install -DskipTests` to update GLV versions
160162
.. Review `Gremlin.Net.csproj`, `Gremlin.Net.Template.csproj` and `Gremlin.Net.Template.nuspec` in `gremlin-dotnet`
161163
.. Review `package.json` and `package-lock.json` in `gremlin-javascript` and in `gremlint`

gremlin-python/docker-compose.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ services:
6262
- GREMLIN_SERVER_URL_HTTP=http://gremlin-server-test-python:{}/
6363
- GREMLIN_SERVER_BASIC_AUTH_URL_HTTP=https://gremlin-server-test-python:{}/
6464
- KRB_HOSTNAME=${KRB_HOSTNAME:-gremlin-server-test}
65-
- VERSION=${VERSION}
6665
- GREMLIN_SOCKET_SERVER_URL=ws://gremlin-socket-server-python:{}/gremlin
6766
- GREMLIN_SOCKET_SERVER_CONFIG_PATH=/python_app/gremlin-socket-server/conf/test-ws-gremlin.yaml
6867
working_dir: /python_app
@@ -71,9 +70,9 @@ services:
7170
&& echo 'password' | kinit stephen
7271
&& klist
7372
&& pip install wheel radish-bdd PyHamcrest aenum isodate kerberos
74-
&& python3 ./setup.py build
75-
&& python3 ./setup.py test
76-
&& python3 ./setup.py install
73+
&& pip install -e .[test]
74+
&& pytest
75+
&& pip install .
7776
&& radish -f dots -e -t -b ./radish ./gremlin-test --user-data='serializer=application/vnd.gremlin-v3.0+json'
7877
&& radish -f dots -e -t -b ./radish ./gremlin-test --user-data='serializer=application/vnd.graphbinary-v1.0';
7978
EXIT_CODE=$$?; chown -R `stat -c "%u:%g" .` .; exit $$EXIT_CODE"
@@ -87,10 +86,8 @@ services:
8786
volumes:
8887
- ${PACKAGE_DIR:-./src/main/python}:/python_package
8988
working_dir: /python_package
90-
environment:
91-
- VERSION=${VERSION}
9289
command: >
93-
bash -c "python3 setup.py sdist bdist_wheel;
90+
bash -c "pip install build && python -m build;
9491
EXIT_CODE=$$?; chown -R `stat -c "%u:%g" .` .; exit $$EXIT_CODE"
9592
9693
gremlin-socket-server:

gremlin-python/pom.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,7 @@ limitations under the License.
123123
</configuration>
124124
</execution>
125125
<!--
126-
build/package python source distribution and wheel archive. the version is bound to an
127-
environment variable that gets used in setup.py to dynamically construct a module
128-
__version__file
126+
build/package python source distribution and wheel archive.
129127
-->
130128
<execution>
131129
<id>package-py</id>
@@ -137,7 +135,6 @@ limitations under the License.
137135
<target>
138136
<exec executable="docker" failonerror="true">
139137
<env key="PACKAGE_DIR" value="${project.build.directory}/python-packaged"/>
140-
<env key="VERSION" value="${project.version}"/>
141138
<env key="PYTHONPATH" value=""/>
142139
<arg line="compose up --build --abort-on-container-exit gremlin-python-package"/>
143140
</exec>
@@ -168,7 +165,6 @@ limitations under the License.
168165
<skip>${skipTests}</skip>
169166
<target>
170167
<exec executable="docker" failonerror="true">
171-
<env key="VERSION" value="${project.version}"/>
172168
<env key="PYTHONPATH" value=""/>
173169
<env key="GREMLIN_SERVER" value="${project.version}"/>
174170
<env key="ABS_PROJECT_HOME" value="${project.basedir}/../"/>

gremlin-python/src/main/python/gremlin_python/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@
1818
#
1919

2020
__author__ = 'Marko A. Rodriguez (http://markorodriguez.com)'
21+
__version__ = '3.7.5.dev1'
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
[build-system]
19+
requires = ["setuptools>=60", "wheel"]
20+
build-backend = "setuptools.build_meta"
21+
22+
[project]
23+
name = "gremlinpython"
24+
dynamic = ["version"]
25+
description = "Gremlin-Python for Apache TinkerPop"
26+
readme = {file = "README.rst", content-type = "text/x-rst"}
27+
license = {text = "Apache 2"}
28+
maintainers = [{name = "Apache TinkerPop", email = "[email protected]"}]
29+
requires-python = ">=3.9"
30+
dependencies = [
31+
"nest_asyncio",
32+
"aiohttp>=3.8.0,<4.0.0",
33+
"aenum>=1.4.5,<4.0.0",
34+
"isodate>=0.6.0,<1.0.0",
35+
"async-timeout>=4.0.3,<5.0.0"
36+
]
37+
classifiers = [
38+
"Intended Audience :: Developers",
39+
"License :: OSI Approved :: Apache Software License",
40+
"Natural Language :: English",
41+
"Programming Language :: Python :: 3"
42+
]
43+
44+
[project.urls]
45+
Homepage = "https://tinkerpop.apache.org"
46+
47+
[project.optional-dependencies]
48+
kerberos = ["kerberos>=1.3.0,<2.0.0"]
49+
ujson = ["ujson>=2.0.0"]
50+
test = [
51+
"pytest>=4.6.4,<7.2.0",
52+
"radish-bdd==0.13.4",
53+
"PyHamcrest>=1.9.0,<3.0.0",
54+
"PyYAML>=5.3"
55+
]
56+
57+
[tool.pytest.ini_options]
58+
addopts = "--junitxml=./python-reports/TEST-native-python.xml -sv"
59+
norecursedirs = [".*", "build", "dist", "CVS", "_darcs", "{arch}", "*.egg", "lib", "lib64"]
60+
testpaths = ["tests"]
61+
62+
[tool.setuptools.dynamic]
63+
version = {attr = "gremlin_python.__version__"}
64+
65+
[tool.setuptools.package-data]
66+
"*" = ["LICENSE", "NOTICE"]
67+
68+
[tool.setuptools]
69+
packages = [
70+
"gremlin_python",
71+
"gremlin_python.driver",
72+
"gremlin_python.driver.aiohttp",
73+
"gremlin_python.process",
74+
"gremlin_python.structure",
75+
"gremlin_python.structure.io"
76+
]

gremlin-python/src/main/python/setup.cfg

Lines changed: 0 additions & 22 deletions
This file was deleted.

gremlin-python/src/main/python/setup.py

Lines changed: 0 additions & 91 deletions
This file was deleted.

0 commit comments

Comments
 (0)