Remove dependency on GitPython from setuptools usage

Refactor the build_manage command to import git_upstream main function
to access the argparser only when the build_manage command is run
instead of when it is being constructed. This removes the need for
GitPython to be available for setuptools to parse the setup.py and
instead is only needed when the command is executed.

Change-Id: I16a7d18ad7e4cac87feb3204489727cc99c60ab5
This commit is contained in:
Darragh Bailey 2014-09-10 10:40:41 +01:00
parent 597c7f6500
commit 661b214bfa
2 changed files with 5 additions and 6 deletions

View File

@ -29,16 +29,15 @@ class BuildManpage(Command):
command_name = 'build_manpage'
def initialize_options(self):
from git_upstream import main
self._output = self.distribution.get_name() + '.1'
self._see_also = ["git:1"]
self._today = datetime.date.today()
self._commands, self._parser = main.get_parser()
self._parser.formatter = ManPageFormatter()
self._commands = self._parser = None
def finalize_options(self):
pass
from git_upstream import main
self._commands, self._parser = main.get_parser()
self._parser.formatter = ManPageFormatter()
def _markup(self, txt):
return txt.replace('-', '\\-')

View File

@ -18,5 +18,5 @@ import setuptools
setuptools.setup(
setup_requires=['pbr', 'GitPython'],
setup_requires=['pbr'],
pbr=True)