Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
build/
dist/

AUTHORS
ChangeLog
GTAGS
GRTAGS
GPATH
Expand Down
28 changes: 0 additions & 28 deletions ryu/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,10 @@
# License for the specific language governing permissions and limitations
# under the License.

import os
import sys
from setuptools.command import easy_install
from ryu import version


# Global variables in this module doesn't work as we expect
# because, during the setup procedure, this module seems to be
# copied (as a file) and can be loaded multiple times.
# We save them into __main__ module instead.
def _main_module():
return sys.modules['__main__']


def save_orig():
"""Save original easy_install.get_script_args.
This is necessary because pbr's setup_hook is sometimes called
before ours."""
_main_module()._orig_get_script_args = easy_install.get_script_args


def setup_hook(config):
"""Filter config parsed from a setup.cfg to inject our defaults."""
metadata = config['metadata']
Expand All @@ -46,19 +29,8 @@ def setup_hook(config):

metadata['version'] = str(version)

# pbr's setup_hook replaces easy_install.get_script_args with
# their own version, override_get_script_args, prefering simpler
# scripts which are not aware of multi-version.
# prevent that by doing the opposite. it's a horrible hack
# but we are in patching wars already...
from pbr import packaging

def my_get_script_args(*args, **kwargs):
return _main_module()._orig_get_script_args(*args, **kwargs)

packaging.override_get_script_args = my_get_script_args
easy_install.get_script_args = my_get_script_args

# another hack to allow setup from tarball.
orig_get_version = packaging.get_version

Expand Down
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
# limitations under the License.

import setuptools
import ryu.hooks


ryu.hooks.save_orig()
setuptools.setup(name='ryu',
setup_requires=['pbr'],
pbr=True)
6 changes: 2 additions & 4 deletions tools/pip-requires
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
-r ../pip-requirements.txt
# NOTE: OpenStack avoids some versions of eventlet, because of the
# following issue.
# https://github.com/eventlet/eventlet/issues/401
eventlet==0.31.1
eventlet>=0.41.0
dnspython>=2.8.0
msgpack>=0.4.0 # RPC library, BGP speaker(net_cntl)
netaddr
oslo.config>=2.5.0
Expand Down