blob: 771847debc32ac73d1f279a5400e53fe09acf709 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#!/usr/bin/env python3
"""
PostgreSQL database adapter for Python - Connection Pool
"""
# Copyright (C) 2020 The Psycopg Team
import os
import re
from setuptools import setup
# Move to the directory of setup.py: executing this file from another location
# (e.g. from the project root) will fail
here = os.path.abspath(os.path.dirname(__file__))
if os.path.abspath(os.getcwd()) != here:
os.chdir(here)
with open("psycopg_pool/version.py") as f:
data = f.read()
m = re.search(r"""(?m)^__version__\s*=\s*['"]([^'"]+)['"]""", data)
if not m:
raise Exception(f"cannot find version in {f.name}")
version = m.group(1)
setup(version=version)
|