Fix definition of BUILD_DIR in Makefile

The Python's platform should be included in the build dir. Was
previously missing resulting in the incorrect path.

Fixing the build dir allows testing psycopg2 without first calling
"python setup.py install".

Exposed a missing use of the deprecated "async" keyword.

For additional information on how to calculate the build dir, see the
following SO post:

https://stackoverflow.com/a/14369968
This commit is contained in:
Jon Dufresne 2017-12-03 14:13:08 -08:00
parent 2e0eaaef2b
commit c85d190f26

View File

@ -18,8 +18,9 @@
# make check # this requires setting up a test database with the correct user # make check # this requires setting up a test database with the correct user
PYTHON := python$(PYTHON_VERSION) PYTHON := python$(PYTHON_VERSION)
PYTHON_PLATFORM := $(shell $(PYTHON) -c 'import sysconfig; print(sysconfig.get_platform())')
PYTHON_VERSION ?= $(shell $(PYTHON) -c 'import sys; print("%d.%d" % sys.version_info[:2])') PYTHON_VERSION ?= $(shell $(PYTHON) -c 'import sys; print("%d.%d" % sys.version_info[:2])')
BUILD_DIR = $(shell pwd)/build/lib.$(PYTHON_VERSION) BUILD_DIR = $(shell pwd)/build/lib.$(PYTHON_PLATFORM)-$(PYTHON_VERSION)
SOURCE_C := $(wildcard psycopg/*.c psycopg/*.h) SOURCE_C := $(wildcard psycopg/*.c psycopg/*.h)
SOURCE_PY := $(wildcard lib/*.py) SOURCE_PY := $(wildcard lib/*.py)