diff options
author | 2020-04-15 12:55:00 -0700 | |
---|---|---|
committer | 2020-04-15 12:57:37 -0700 | |
commit | 32d11d799bbb899f3418297462089a22ba13cf53 (patch) | |
tree | 43a4cc49191846184c7b3367c3ac135ae711bf08 /setup.py | |
parent | catalyst: Remove dead base_dirs() function (diff) | |
download | catalyst-32d11d799bbb899f3418297462089a22ba13cf53.tar.gz catalyst-32d11d799bbb899f3418297462089a22ba13cf53.tar.bz2 catalyst-32d11d799bbb899f3418297462089a22ba13cf53.zip |
catalyst: Run autopep8
The only change I reverted was from the reformatting of the
HASH_DEFINITIONS table in catalyst/hash_utils.py.
Signed-off-by: Matt Turner <mattst88@gentoo.org>
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 171 |
1 files changed, 86 insertions, 85 deletions
@@ -17,102 +17,103 @@ _maintainer_name, _maintainer_email = _parseaddr(__maintainer__) def _posix_path(path): - """Convert a native path to a POSIX path + """Convert a native path to a POSIX path - Distutils wants all paths to be written in the Unix convention - (i.e. slash-separated) [1], so that's what we'll do here. + Distutils wants all paths to be written in the Unix convention + (i.e. slash-separated) [1], so that's what we'll do here. - [1]: https://docs.python.org/2/distutils/setupscript.html - """ - if _os.path.sep != '/': - return path.replace(_os.path.sep, '/') - return path + [1]: https://docs.python.org/2/distutils/setupscript.html + """ + if _os.path.sep != '/': + return path.replace(_os.path.sep, '/') + return path def _files(prefix, root): - """Iterate through all the file paths under `root` - - Yielding `(target_dir, (file_source_paths, ...))` tuples. - """ - for dirpath, _dirnames, filenames in _os.walk(root): - reldir = _os.path.relpath(dirpath, root) - install_directory = _posix_path( - _os.path.join(prefix, reldir)) - file_source_paths = [ - _posix_path(_os.path.join(dirpath, filename)) - for filename in filenames] - yield (install_directory, file_source_paths) - - -_data_files = [('/etc/catalyst', ['etc/catalyst.conf','etc/catalystrc']), - ('/usr/share/man/man1', ['files/catalyst.1']), - ('/usr/share/man/man5', ['files/catalyst-config.5', 'files/catalyst-spec.5']) - ] + """Iterate through all the file paths under `root` + + Yielding `(target_dir, (file_source_paths, ...))` tuples. + """ + for dirpath, _dirnames, filenames in _os.walk(root): + reldir = _os.path.relpath(dirpath, root) + install_directory = _posix_path( + _os.path.join(prefix, reldir)) + file_source_paths = [ + _posix_path(_os.path.join(dirpath, filename)) + for filename in filenames] + yield (install_directory, file_source_paths) + + +_data_files = [('/etc/catalyst', ['etc/catalyst.conf', 'etc/catalystrc']), + ('/usr/share/man/man1', ['files/catalyst.1']), + ('/usr/share/man/man5', + ['files/catalyst-config.5', 'files/catalyst-spec.5']) + ] _data_files.extend(_files('share/catalyst/arch', 'arch')) _data_files.extend(_files('share/catalyst/livecd', 'livecd')) _data_files.extend(_files('share/catalyst/targets', 'targets')) class set_version(_Command): - '''Saves the specified release version information - ''' - description = "hardcode script's version using VERSION from environment" - user_options = [] # [(long_name, short_name, desc),] - - def initialize_options (self): - pass - - def finalize_options (self): - pass - - def run(self): - # pylint: disable=global-statement - global __version__ - try: - version = _os.environ['VERSION'] - except KeyError: - print("Try setting 'VERSION=x.y.z' on the command line... Aborting") - return - _set_release_version(version) - __version__ = _get_version() - print("Version set to:\n", __version__) + '''Saves the specified release version information + ''' + description = "hardcode script's version using VERSION from environment" + user_options = [] # [(long_name, short_name, desc),] + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + # pylint: disable=global-statement + global __version__ + try: + version = _os.environ['VERSION'] + except KeyError: + print("Try setting 'VERSION=x.y.z' on the command line... Aborting") + return + _set_release_version(version) + __version__ = _get_version() + print("Version set to:\n", __version__) _setup( - name=_package_name, - version=__version__, - maintainer=_maintainer_name, - maintainer_email=_maintainer_email, - url='https://wiki.gentoo.org/wiki/Catalyst', - download_url='http://distfiles.gentoo.org/distfiles/{0}-{1}.tar.bz2'.format( - _package_name, __version__), - license='GNU General Public License (GPL)', - platforms=['all'], - description=__doc__, - long_description=_codecs.open( - _os.path.join(_this_dir, 'README'), 'r', 'utf-8').read(), - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)', - 'Intended Audience :: System Administrators', - 'Operating System :: POSIX', - 'Topic :: System :: Archiving :: Packaging', - 'Topic :: System :: Installation/Setup', - 'Topic :: System :: Software Distribution', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - ], - scripts=['bin/{0}'.format(_package_name)], - packages=[ - _package_name, - '{0}.base'.format(_package_name), - '{0}.targets'.format(_package_name), - ], - data_files=_data_files, - provides=[_package_name], - cmdclass={ - 'set_version': set_version - }, - ) + name=_package_name, + version=__version__, + maintainer=_maintainer_name, + maintainer_email=_maintainer_email, + url='https://wiki.gentoo.org/wiki/Catalyst', + download_url='http://distfiles.gentoo.org/distfiles/{0}-{1}.tar.bz2'.format( + _package_name, __version__), + license='GNU General Public License (GPL)', + platforms=['all'], + description=__doc__, + long_description=_codecs.open( + _os.path.join(_this_dir, 'README'), 'r', 'utf-8').read(), + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)', + 'Intended Audience :: System Administrators', + 'Operating System :: POSIX', + 'Topic :: System :: Archiving :: Packaging', + 'Topic :: System :: Installation/Setup', + 'Topic :: System :: Software Distribution', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + ], + scripts=['bin/{0}'.format(_package_name)], + packages=[ + _package_name, + '{0}.base'.format(_package_name), + '{0}.targets'.format(_package_name), + ], + data_files=_data_files, + provides=[_package_name], + cmdclass={ + 'set_version': set_version + }, +) |