From 9100ad3e8f2cbb27e455d44794c75f220e5b7f05 Mon Sep 17 00:00:00 2001 From: James Emerton Date: Fri, 10 Jan 2014 11:56:14 -0800 Subject: [PATCH 1/3] Use get_ext_fullpath() for -outputresource The manifest fixup was relying on the extension name being "_psycopg.pyd" which effectively prevents building with --debug as the extension name becomes "_psycopg_d.pyd" in this instance. --- setup.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 83d734a3..56aad293 100644 --- a/setup.py +++ b/setup.py @@ -293,12 +293,11 @@ class psycopg_build_ext(build_ext): manifest = '_psycopg.vc9.x86.manifest' if platform == 'win-amd64': manifest = '_psycopg.vc9.amd64.manifest' + ext_path = self.get_ext_fullpath(extension.name) self.compiler.spawn( ['mt.exe', '-nologo', '-manifest', os.path.join('psycopg', manifest), - '-outputresource:%s;2' % ( - os.path.join(self.build_lib, - 'psycopg2', '_psycopg.pyd'))]) + '-outputresource:%s;2' % ext_path]) def finalize_win32(self): """Finalize build system configuration on win32 platform.""" From 58c98deebb2683a9be72a4590dfebc1ac2a960c3 Mon Sep 17 00:00:00 2001 From: James Emerton Date: Fri, 10 Jan 2014 13:41:16 -0800 Subject: [PATCH 2/3] Fallback when get_ext_fullpath() is unavailable --- setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 56aad293..6e4f4ae0 100644 --- a/setup.py +++ b/setup.py @@ -293,7 +293,11 @@ class psycopg_build_ext(build_ext): manifest = '_psycopg.vc9.x86.manifest' if platform == 'win-amd64': manifest = '_psycopg.vc9.amd64.manifest' - ext_path = self.get_ext_fullpath(extension.name) + try: + ext_path = self.get_ext_fullpath(extension.name) + except AttributeError: + ext_path = os.path.join(self.build_lib, + 'psycopg2', '_psycopg.pyd') self.compiler.spawn( ['mt.exe', '-nologo', '-manifest', os.path.join('psycopg', manifest), From a35b743af75430d23bace7fb2c37a95da2a309a3 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Tue, 14 Jan 2014 21:52:42 +0000 Subject: [PATCH 3/3] Mention outputres fix in NEWS file --- NEWS | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NEWS b/NEWS index ab2b3a5a..02953649 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,12 @@ Current release --------------- +What's new in psycopg 2.5.3 +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- Fixed debug build on Windows, thanks to James Emerton. + + What's new in psycopg 2.5.2 ^^^^^^^^^^^^^^^^^^^^^^^^^^^