From c85d190f26f2e74fea52410a28f70e88348a9b2b Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sun, 3 Dec 2017 14:13:08 -0800 Subject: [PATCH] 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 --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a8f491e4..57cf841e 100644 --- a/Makefile +++ b/Makefile @@ -18,8 +18,9 @@ # make check # this requires setting up a test database with the correct user PYTHON := python$(PYTHON_VERSION) -PYTHON_VERSION ?= $(shell $(PYTHON) -c 'import sys; print ("%d.%d" % sys.version_info[:2])') -BUILD_DIR = $(shell pwd)/build/lib.$(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])') +BUILD_DIR = $(shell pwd)/build/lib.$(PYTHON_PLATFORM)-$(PYTHON_VERSION) SOURCE_C := $(wildcard psycopg/*.c psycopg/*.h) SOURCE_PY := $(wildcard lib/*.py)