File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 19
19
from setuptools import Extension , setup
20
20
from setuptools .command .build_ext import build_ext
21
21
22
- if not (3 , 7 ) <= sys .version_info [:2 ] < (4 , 0 ):
23
- raise Exception (
24
- f"Sorry, PyGreSQL { version } does not support this Python version" )
25
22
26
23
def project_version ():
24
+ """Read the PyGreSQL version from the pyproject.toml file."""
27
25
with open ('pyproject.toml' ) as f :
28
26
for d in f :
29
27
if d .startswith ("version =" ):
30
28
version = d .split ("=" )[1 ].strip ().strip ('"' )
31
29
return version
32
30
raise Exception ("Cannot determine PyGreSQL version" )
33
31
32
+
34
33
def project_readme ():
34
+ """Get the content of the README file."""
35
35
with open ('README.rst' ) as f :
36
36
return f .read ()
37
37
38
+
38
39
version = project_version ()
39
40
41
+ if not (3 , 7 ) <= sys .version_info [:2 ] < (4 , 0 ):
42
+ raise Exception (
43
+ f"Sorry, PyGreSQL { version } does not support this Python version" )
44
+
40
45
long_description = project_readme ()
41
46
47
+
42
48
# For historical reasons, PyGreSQL does not install itself as a single
43
49
# "pygresql" package, but as two top-level modules "pg", providing the
44
50
# classic interface, and "pgdb" for the modern DB-API 2.0 interface.
You can’t perform that action at this time.
0 commit comments