You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@age.apache.org by jg...@apache.org on 2023/01/05 21:46:33 UTC

[age] branch PG12 updated: Issue #388 - Fix python driver build from source (#389)

This is an automated email from the ASF dual-hosted git repository.

jgemignani pushed a commit to branch PG12
in repository https://gitbox.apache.org/repos/asf/age.git


The following commit(s) were added to refs/heads/PG12 by this push:
     new 5ee637d  Issue #388 - Fix python driver build from source (#389)
5ee637d is described below

commit 5ee637d4d08704c22b20f03080a44355db82e47f
Author: Hunaid Sohail <76...@users.noreply.github.com>
AuthorDate: Thu Jan 5 09:32:59 2023 +0500

    Issue #388 - Fix python driver build from source (#389)
    
    * Fixed a bug where python driver throws error when build from source
    
    * Moved required packages to requirements.txt
    
    * Update Readme
    
    Rearranged instructions and added instructions to install from requirements.txt
    
    * Fixed a typo in exceptions.py file
    
    Fixed a typo 'SqlExcution' on line 62 in exceptions.py file
---
 drivers/python/README.md        |  18 +++++++++---------
 drivers/python/requirements.txt | Bin 0 -> 158 bytes
 drivers/python/setup.py         |   4 +---
 3 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/drivers/python/README.md b/drivers/python/README.md
index 5d97cf9..f9175b7 100644
--- a/drivers/python/README.md
+++ b/drivers/python/README.md
@@ -11,10 +11,15 @@ AGType parser and driver support for [Apache AGE](https://age.apache.org/), grap
 ```
 sudo apt-get update
 sudo apt-get install python3-dev libpq-dev
-pip install --no-binary :all: psycopg2
-pip install antlr4-python3-runtime==4.9.2
-
-```
+git clone https://github.com/apache/age.git
+cd age/drivers/python
+```
+
+### Install required packages
+```
+pip install -r requirements.txt
+```
+
 ### Test
 ```
 python -m unittest -v test_age_py.py
@@ -23,18 +28,13 @@ python -m unittest -v test_agtypes.py
 
 ### Build from source
 ```
-git clone https://github.com/apache/age.git
-cd age/drivers/python
-
 python setup.py install
-
 ```
 
 ### Install from PyPi
 
 ```
 pip install apache-age-python
-
 ```
 
 ### For more information about [Apache AGE](https://age.apache.org/)
diff --git a/drivers/python/requirements.txt b/drivers/python/requirements.txt
new file mode 100644
index 0000000..918763c
Binary files /dev/null and b/drivers/python/requirements.txt differ
diff --git a/drivers/python/setup.py b/drivers/python/setup.py
index 7d8981f..e66e895 100644
--- a/drivers/python/setup.py
+++ b/drivers/python/setup.py
@@ -29,12 +29,10 @@ setup(
     author_email     = 'rhizome.ai@gmail.com',
     url              = 'https://github.com/apache/age',
     license          = 'Apache2.0',
-    install_requires = [ 'psycopg2', 'antlr4-python3-runtime' ],
+    install_requires = [ 'psycopg2', 'antlr4-python3-runtime==4.9.3'],
     packages         = ['age', 'age.gen'],
     keywords         = ['Graph Database', 'Apache AGE', 'PostgreSQL'],
     python_requires  = '>=3.9',
-    # package_data     =  {},
-    # zip_safe=False,
     classifiers      = [
         'Programming Language :: Python :: 3.9'
     ]