setup.py
author Anton Shestakov <av6@dwimlabs.net>
Tue, 03 Oct 2017 22:51:00 +0800
changeset 3035 a3a154e49bba
parent 2069 7d15775d8585
child 3206 3ccde4699cf0
permissions -rw-r--r--
legacy: rename lookup_errors to not be in all caps (flake8 warning) flake8 has a plugin, pep8-naming, which is not installed by default, but is used if available, no extra config required. This plugin checks names of variables, classes, functions and so on against PEP-8, and it complained about this variable: N806 variable in function should be lowercase Since this isn't a module-level constant, but just a helper variable used only in one function, it's fine to just rename it. With this error gone, flake8 output (used plugins: mccabe, naming, pycodestyle, pyflakes) is totally clean.

import os
from distutils.core import setup
from os.path import dirname, join

META_PATH = 'hgext3rd/evolve/metadata.py'

def get_metadata():
    meta = {}
    fullpath = join(dirname(__file__), META_PATH)
    execfile(fullpath, meta)
    return meta

def get_version():
    '''Read version info from a file without importing it'''
    return get_metadata()['__version__']

def min_hg_version():
    '''Read version info from a file without importing it'''
    return get_metadata()['minimumhgversion']

py_modules = [
]
py_packages = [
    'hgext3rd',
    'hgext3rd.evolve',
    'hgext3rd.topic',
]

if os.environ.get('INCLUDE_INHIBIT'):
    py_modules.append('hgext3rd.evolve.hack.inhibit')
    py_modules.append('hgext3rd.evolve.hack.directaccess')

setup(
    name='hg-evolve',
    version=get_version(),
    author='Pierre-Yves David',
    author_email='pierre-yves.david@ens-lyon.org',
    maintainer='Pierre-Yves David',
    maintainer_email='pierre-yves.david@ens-lyon.org',
    url='https://www.mercurial-scm.org/doc/evolution/',
    description='Flexible evolution of Mercurial history.',
    long_description=open('README').read(),
    keywords='hg mercurial',
    license='GPLv2+',
    py_modules=py_modules,
    packages=py_packages
)