8000 Handle ruff complaints · PyGreSQL/PyGreSQL@7a9a6fb · GitHub
[go: up one dir, main page]

Skip to content

Commit 7a9a6fb

Browse files
committed
Handle ruff complaints
1 parent 0587d59 commit 7a9a6fb

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

setup.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,32 @@
1919
from setuptools import Extension, setup
2020
from setuptools.command.build_ext import build_ext
2121

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")
2522

2623
def project_version():
24+
"""Read the PyGreSQL version from the pyproject.toml file."""
2725
with open('pyproject.toml') as f:
2826
for d in f:
2927
if d.startswith("version ="):
3028
version = d.split("=")[1].strip().strip('"')
3129
return version
3230
raise Exception("Cannot determine PyGreSQL version")
3331

32+
3433
def project_readme():
34+
"""Get the content of the README file."""
3535
with open('README.rst') as f:
3636
return f.read()
3737

38+
3839
version = project_version()
3940

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+
4045
long_description = project_readme()
4146

47+
4248
# For historical reasons, PyGreSQL does not install itself as a single
4349
# "pygresql" package, but as two top-level modules "pg", providing the
4450
# classic interface, and "pgdb" for the modern DB-API 2.0 interface.

0 commit comments

Comments
 (0)
0