mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-13 04:26:33 +03:00
Drop support for EOL Python 2.6
This commit is contained in:
parent
e7529e4823
commit
ffcc65d4f0
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -11,6 +11,7 @@ doc/html/*
|
||||||
doc/psycopg2.txt
|
doc/psycopg2.txt
|
||||||
scripts/pypi_docs_upload.py
|
scripts/pypi_docs_upload.py
|
||||||
env
|
env
|
||||||
|
.idea
|
||||||
.tox
|
.tox
|
||||||
/rel
|
/rel
|
||||||
/wheels
|
/wheels
|
||||||
|
|
|
@ -7,7 +7,6 @@ language: python
|
||||||
python:
|
python:
|
||||||
- 2.7
|
- 2.7
|
||||||
- 3.6
|
- 3.6
|
||||||
- 2.6
|
|
||||||
- 3.5
|
- 3.5
|
||||||
- 3.4
|
- 3.4
|
||||||
- 3.3
|
- 3.3
|
||||||
|
|
|
@ -17,7 +17,7 @@ The current `!psycopg2` implementation supports:
|
||||||
..
|
..
|
||||||
NOTE: keep consistent with setup.py and the /features/ page.
|
NOTE: keep consistent with setup.py and the /features/ page.
|
||||||
|
|
||||||
- Python 2 versions from 2.6 to 2.7
|
- Python version 2.7
|
||||||
- Python 3 versions from 3.2 to 3.6
|
- Python 3 versions from 3.2 to 3.6
|
||||||
- PostgreSQL server versions from 7.4 to 10
|
- PostgreSQL server versions from 7.4 to 10
|
||||||
- PostgreSQL client library version from 9.1
|
- PostgreSQL client library version from 9.1
|
||||||
|
|
|
@ -31,8 +31,8 @@
|
||||||
#include <stringobject.h>
|
#include <stringobject.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if PY_VERSION_HEX < 0x02060000
|
#if PY_VERSION_HEX < 0x02070000
|
||||||
# error "psycopg requires Python >= 2.6"
|
# error "psycopg requires Python >= 2.7"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* hash() return size changed around version 3.2a4 on 64bit platforms. Before
|
/* hash() return size changed around version 3.2a4 on 64bit platforms. Before
|
||||||
|
@ -44,14 +44,6 @@ typedef long Py_hash_t;
|
||||||
typedef unsigned long Py_uhash_t;
|
typedef unsigned long Py_uhash_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Macros defined in Python 2.6 */
|
|
||||||
#ifndef Py_REFCNT
|
|
||||||
#define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
|
|
||||||
#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
|
|
||||||
#define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
|
|
||||||
#define PyVarObject_HEAD_INIT(x,n) PyObject_HEAD_INIT(x) n,
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* FORMAT_CODE_PY_SSIZE_T is for Py_ssize_t: */
|
/* FORMAT_CODE_PY_SSIZE_T is for Py_ssize_t: */
|
||||||
#define FORMAT_CODE_PY_SSIZE_T "%" PY_FORMAT_SIZE_T "d"
|
#define FORMAT_CODE_PY_SSIZE_T "%" PY_FORMAT_SIZE_T "d"
|
||||||
|
|
||||||
|
|
20
setup.py
20
setup.py
|
@ -76,7 +76,6 @@ License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
|
||||||
License :: OSI Approved :: Zope Public License
|
License :: OSI Approved :: Zope Public License
|
||||||
Programming Language :: Python
|
Programming Language :: Python
|
||||||
Programming Language :: Python :: 2
|
Programming Language :: Python :: 2
|
||||||
Programming Language :: Python :: 2.6
|
|
||||||
Programming Language :: Python :: 2.7
|
Programming Language :: Python :: 2.7
|
||||||
Programming Language :: Python :: 3
|
Programming Language :: Python :: 3
|
||||||
Programming Language :: Python :: 3.2
|
Programming Language :: Python :: 3.2
|
||||||
|
@ -297,7 +296,7 @@ class psycopg_build_ext(build_ext):
|
||||||
|
|
||||||
# For Python versions that use MSVC compiler 2008, re-insert the
|
# For Python versions that use MSVC compiler 2008, re-insert the
|
||||||
# manifest into the resulting .pyd file.
|
# manifest into the resulting .pyd file.
|
||||||
if self.compiler_is_msvc() and sysVer in ((2, 6), (2, 7), (3, 0), (3, 1), (3, 2)):
|
if self.compiler_is_msvc() and sysVer in ((2, 7), (3, 0), (3, 1), (3, 2)):
|
||||||
platform = get_platform()
|
platform = get_platform()
|
||||||
# Default to the x86 manifest
|
# Default to the x86 manifest
|
||||||
manifest = '_psycopg.vc9.x86.manifest'
|
manifest = '_psycopg.vc9.x86.manifest'
|
||||||
|
@ -319,7 +318,6 @@ class psycopg_build_ext(build_ext):
|
||||||
|
|
||||||
def finalize_win32(self):
|
def finalize_win32(self):
|
||||||
"""Finalize build system configuration on win32 platform."""
|
"""Finalize build system configuration on win32 platform."""
|
||||||
sysVer = sys.version_info[:2]
|
|
||||||
|
|
||||||
# Add compiler-specific arguments:
|
# Add compiler-specific arguments:
|
||||||
extra_compiler_args = []
|
extra_compiler_args = []
|
||||||
|
@ -335,17 +333,6 @@ class psycopg_build_ext(build_ext):
|
||||||
# API code.
|
# API code.
|
||||||
extra_compiler_args.append('-fno-strict-aliasing')
|
extra_compiler_args.append('-fno-strict-aliasing')
|
||||||
|
|
||||||
# Force correct C runtime library linkage:
|
|
||||||
if sysVer <= (2, 3):
|
|
||||||
# Yes: 'msvcr60', rather than 'msvcrt', is the correct value
|
|
||||||
# on the line below:
|
|
||||||
self.libraries.append('msvcr60')
|
|
||||||
elif sysVer in ((2, 4), (2, 5)):
|
|
||||||
self.libraries.append('msvcr71')
|
|
||||||
# Beyond Python 2.5, we take our chances on the default C runtime
|
|
||||||
# library, because we don't know what compiler those future
|
|
||||||
# versions of Python will use.
|
|
||||||
|
|
||||||
for extension in ext: # ext is a global list of Extension objects
|
for extension in ext: # ext is a global list of Extension objects
|
||||||
extension.extra_compile_args.extend(extra_compiler_args)
|
extension.extra_compile_args.extend(extra_compiler_args)
|
||||||
# End of add-compiler-specific arguments section.
|
# End of add-compiler-specific arguments section.
|
||||||
|
@ -414,7 +401,7 @@ class psycopg_build_ext(build_ext):
|
||||||
# *at least* PostgreSQL 7.4 is available (this is the only
|
# *at least* PostgreSQL 7.4 is available (this is the only
|
||||||
# 7.x series supported by psycopg 2)
|
# 7.x series supported by psycopg 2)
|
||||||
pgversion = pg_config_helper.query("version").split()[1]
|
pgversion = pg_config_helper.query("version").split()[1]
|
||||||
except:
|
except Exception:
|
||||||
pgversion = "7.4.0"
|
pgversion = "7.4.0"
|
||||||
|
|
||||||
verre = re.compile(
|
verre = re.compile(
|
||||||
|
@ -619,7 +606,7 @@ try:
|
||||||
f = open("README.rst")
|
f = open("README.rst")
|
||||||
readme = f.read()
|
readme = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
except:
|
except Exception:
|
||||||
print("failed to read readme: ignoring...")
|
print("failed to read readme: ignoring...")
|
||||||
readme = __doc__
|
readme = __doc__
|
||||||
|
|
||||||
|
@ -633,6 +620,7 @@ setup(name="psycopg2",
|
||||||
download_url=download_url,
|
download_url=download_url,
|
||||||
license="LGPL with exceptions or ZPL",
|
license="LGPL with exceptions or ZPL",
|
||||||
platforms=["any"],
|
platforms=["any"],
|
||||||
|
python_requires='>=2.7,!=3.0.*,!=3.1.*',
|
||||||
description=readme.split("\n")[0],
|
description=readme.split("\n")[0],
|
||||||
long_description="\n".join(readme.split("\n")[2:]).lstrip(),
|
long_description="\n".join(readme.split("\n")[2:]).lstrip(),
|
||||||
classifiers=[x for x in classifiers.split("\n") if x],
|
classifiers=[x for x in classifiers.split("\n") if x],
|
||||||
|
|
|
@ -352,8 +352,7 @@ class ParseDsnTestCase(ConnectingTestCase):
|
||||||
"DSN with quoting parsed")
|
"DSN with quoting parsed")
|
||||||
|
|
||||||
# Can't really use assertRaisesRegexp() here since we need to
|
# Can't really use assertRaisesRegexp() here since we need to
|
||||||
# make sure that secret is *not* exposed in the error messgage
|
# make sure that secret is *not* exposed in the error message.
|
||||||
# (and it also requires python >= 2.7).
|
|
||||||
raised = False
|
raised = False
|
||||||
try:
|
try:
|
||||||
# unterminated quote after dbname:
|
# unterminated quote after dbname:
|
||||||
|
|
|
@ -32,7 +32,6 @@ from psycopg2 import sql
|
||||||
|
|
||||||
|
|
||||||
class SqlFormatTests(ConnectingTestCase):
|
class SqlFormatTests(ConnectingTestCase):
|
||||||
@skip_before_python(2, 7)
|
|
||||||
def test_pos(self):
|
def test_pos(self):
|
||||||
s = sql.SQL("select {} from {}").format(
|
s = sql.SQL("select {} from {}").format(
|
||||||
sql.Identifier('field'), sql.Identifier('table'))
|
sql.Identifier('field'), sql.Identifier('table'))
|
||||||
|
@ -91,7 +90,6 @@ class SqlFormatTests(ConnectingTestCase):
|
||||||
def test_compose_badnargs(self):
|
def test_compose_badnargs(self):
|
||||||
self.assertRaises(IndexError, sql.SQL("select {0};").format)
|
self.assertRaises(IndexError, sql.SQL("select {0};").format)
|
||||||
|
|
||||||
@skip_before_python(2, 7)
|
|
||||||
def test_compose_badnargs_auto(self):
|
def test_compose_badnargs_auto(self):
|
||||||
self.assertRaises(IndexError, sql.SQL("select {};").format)
|
self.assertRaises(IndexError, sql.SQL("select {};").format)
|
||||||
self.assertRaises(ValueError, sql.SQL("select {} {1};").format, 10, 20)
|
self.assertRaises(ValueError, sql.SQL("select {} {1};").format, 10, 20)
|
||||||
|
|
|
@ -295,7 +295,6 @@ class TypesBasicTests(ConnectingTestCase):
|
||||||
else:
|
else:
|
||||||
self.assertEqual(memoryview, type(o2))
|
self.assertEqual(memoryview, type(o2))
|
||||||
|
|
||||||
@testutils.skip_before_python(2, 7)
|
|
||||||
def testAdaptMemoryview(self):
|
def testAdaptMemoryview(self):
|
||||||
o1 = memoryview(bytearray(range(256)))
|
o1 = memoryview(bytearray(range(256)))
|
||||||
o2 = self.execute("select %s;", (o1,))
|
o2 = self.execute("select %s;", (o1,))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user