Unblock migrate (py26 and py3* testing issues)
There are two changes which have to go together to pass the gate tests: 1. Update pbr and mock requirements from global-requirements mock 1.2 supports py26 again so make that the minimum version. The same change is being made in g-r with: Ic6b9e18eaec9c81bbbbc57129e024904be928e09 Sync up with latest pbr in global-requirements while we're at it. Closes-Bug: #1474925 2. Fix the importpath module to work with python >= 3.3 where the __import__ built-in is raising an ImportError on a temporary file that is added to the system path. Closes-Bug: #1475339 Change-Id: Ie98938ba75f3983094dd540b7d26a7ec46be4f6e
This commit is contained in:
parent
050b646e86
commit
8252703f56
@ -1,18 +1,30 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from six.moves import reload_module as reload
|
PY33 = sys.version_info >= (3, 3)
|
||||||
|
|
||||||
|
if PY33:
|
||||||
|
from importlib import machinery
|
||||||
|
else:
|
||||||
|
from six.moves import reload_module as reload
|
||||||
|
|
||||||
|
|
||||||
def import_path(fullpath):
|
def import_path(fullpath):
|
||||||
""" Import a file with full path specification. Allows one to
|
""" Import a file with full path specification. Allows one to
|
||||||
import from anywhere, something __import__ does not do.
|
import from anywhere, something __import__ does not do.
|
||||||
"""
|
"""
|
||||||
# http://zephyrfalcon.org/weblog/arch_d7_2002_08_31.html
|
if PY33:
|
||||||
path, filename = os.path.split(fullpath)
|
name = os.path.splitext(os.path.basename(fullpath))[0]
|
||||||
filename, ext = os.path.splitext(filename)
|
return machinery.SourceFileLoader(
|
||||||
sys.path.append(path)
|
name, fullpath).load_module(name)
|
||||||
module = __import__(filename)
|
else:
|
||||||
reload(module) # Might be out of date during tests
|
# http://zephyrfalcon.org/weblog/arch_d7_2002_08_31.html
|
||||||
del sys.path[-1]
|
path, filename = os.path.split(fullpath)
|
||||||
return module
|
filename, ext = os.path.splitext(filename)
|
||||||
|
sys.path.append(path)
|
||||||
|
try:
|
||||||
|
module = __import__(filename)
|
||||||
|
reload(module) # Might be out of date during tests
|
||||||
|
return module
|
||||||
|
finally:
|
||||||
|
del sys.path[-1]
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# The order of packages is significant, because pip processes them in the order
|
# The order of packages is significant, because pip processes them in the order
|
||||||
# of appearance. Changing the order has an impact on the overall integration
|
# of appearance. Changing the order has an impact on the overall integration
|
||||||
# process, which may cause wedges in the gate later.
|
# process, which may cause wedges in the gate later.
|
||||||
pbr>=0.11,<2.0
|
pbr>=1.3,<2.0
|
||||||
|
|
||||||
# never put a cap on this, *ever*, sqla versions are handled via
|
# never put a cap on this, *ever*, sqla versions are handled via
|
||||||
# tox, and if SQLA is capped it will only make it so we aren't testing
|
# tox, and if SQLA is capped it will only make it so we aren't testing
|
||||||
|
10
setup.py
10
setup.py
@ -16,6 +16,14 @@
|
|||||||
|
|
||||||
import setuptools
|
import setuptools
|
||||||
|
|
||||||
|
# In python < 2.7.4, a lazy loading of package `pbr` will break
|
||||||
|
# setuptools if some other modules registered functions in `atexit`.
|
||||||
|
# solution from: http://bugs.python.org/issue15881#msg170215
|
||||||
|
try:
|
||||||
|
import multiprocessing # noqa
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
setup_requires=['pbr'],
|
setup_requires=['pbr>=1.3'],
|
||||||
pbr=True)
|
pbr=True)
|
||||||
|
@ -8,7 +8,7 @@ coverage>=3.6
|
|||||||
discover
|
discover
|
||||||
feedparser
|
feedparser
|
||||||
fixtures>=0.3.14
|
fixtures>=0.3.14
|
||||||
mock>=1.0
|
mock>=1.2
|
||||||
mox>=0.5.3
|
mox>=0.5.3
|
||||||
psycopg2
|
psycopg2
|
||||||
python-subunit>=0.0.18
|
python-subunit>=0.0.18
|
||||||
|
Loading…
x
Reference in New Issue
Block a user