Skip to content

Commit d8fc867

Browse files
Migrate python driver configuration to pyproject.toml (#2272)
- Add pyproject.toml with package configuration - Simplify setup.py to minimal backward-compatible wrapper. - Updated CI workflow and .gitignore. - Resolves warning about using setup.py directly.
1 parent d4e9b9c commit d8fc867

File tree

5 files changed

+58
-26
lines changed

5 files changed

+58
-26
lines changed

.github/workflows/python-driver.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Set up python
2525
uses: actions/setup-python@v4
2626
with:
27-
python-version: '3.10'
27+
python-version: '3.12'
2828

2929
- name: Install pre-requisites
3030
run: |
@@ -33,7 +33,7 @@ jobs:
3333
3434
- name: Build
3535
run: |
36-
python setup.py install
36+
pip install .
3737
3838
- name: Test
3939
run: |

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ age--*.*.*.sql
1111
!age--*--*sql
1212
__pycache__
1313
**/__pycache__
14+
**/.venv
15+
**/apache_age_python.egg-info
1416

1517
drivers/python/build

drivers/python/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ python -m unittest -v test_agtypes.py
6262

6363
### Build from source
6464
```
65-
python setup.py install
65+
pip install .
6666
```
6767

6868
### For more information about [Apache AGE](https://age.apache.org/)

drivers/python/pyproject.toml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
# http://www.apache.org/licenses/LICENSE-2.0
9+
# Unless required by applicable law or agreed to in writing,
10+
# software distributed under the License is distributed on an
11+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
12+
# KIND, either express or implied. See the License for the
13+
# specific language governing permissions and limitations
14+
# under the License.
15+
16+
[build-system]
17+
requires = ["setuptools>=61.0", "wheel"]
18+
build-backend = "setuptools.build_meta"
19+
20+
[project]
21+
name = "apache-age-python"
22+
version = "0.0.7"
23+
description = "Python driver support for Apache AGE"
24+
readme = "README.md"
25+
requires-python = ">=3.9"
26+
license = "Apache-2.0"
27+
keywords = ["Graph Database", "Apache AGE", "PostgreSQL"]
28+
authors = [
29+
{name = "Ikchan Kwon, Apache AGE", email = "[email protected]"}
30+
]
31+
classifiers = [
32+
"Programming Language :: Python :: 3.10",
33+
"Programming Language :: Python :: 3.11",
34+
"Programming Language :: Python :: 3.12",
35+
"Programming Language :: Python :: 3.13",
36+
"Programming Language :: Python :: 3.14",
37+
]
38+
dependencies = [
39+
"psycopg",
40+
"antlr4-python3-runtime==4.11.1",
41+
]
42+
43+
[project.urls]
44+
Homepage = "https://github.com/apache/age/tree/master/drivers/python"
45+
Download = "https://github.com/apache/age/releases"
46+
47+
[tool.setuptools]
48+
packages = ["age", "age.gen", "age.networkx"]

drivers/python/setup.py

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,10 @@
1313
# specific language governing permissions and limitations
1414
# under the License.
1515

16-
from setuptools import setup, find_packages
17-
from age import VERSION
16+
# This setup.py is maintained for backward compatibility.
17+
# All package configuration is in pyproject.toml. For installation,
18+
# use: pip install .
1819

19-
with open("README.md", "r", encoding='utf8') as fh:
20-
long_description = fh.read()
20+
from setuptools import setup
2121

22-
setup(
23-
name = 'apache-age-python',
24-
version = '0.0.7',
25-
description = 'Python driver support for Apache AGE',
26-
long_description=long_description,
27-
long_description_content_type="text/markdown",
28-
author = 'Ikchan Kwon, Apache AGE',
29-
author_email = '[email protected]',
30-
url = 'https://github.com/apache/age/tree/master/drivers/python',
31-
download_url = 'https://github.com/apache/age/releases' ,
32-
license = 'Apache2.0',
33-
install_requires = [ 'psycopg', 'antlr4-python3-runtime==4.11.1'],
34-
packages = ['age', 'age.gen','age.networkx'],
35-
keywords = ['Graph Database', 'Apache AGE', 'PostgreSQL'],
36-
python_requires = '>=3.9',
37-
classifiers = [
38-
'Programming Language :: Python :: 3.9'
39-
]
40-
)
22+
setup()

0 commit comments

Comments
 (0)