2016-09-19 21:41:01 +00:00
|
|
|
#!/usr/bin/env python
|
2016-09-30 18:49:21 +00:00
|
|
|
import re
|
|
|
|
import sys
|
|
|
|
import argparse
|
|
|
|
import os.path
|
2016-09-19 21:41:01 +00:00
|
|
|
|
2016-09-30 18:49:21 +00:00
|
|
|
def _resolve_prefix(prefix, type):
|
|
|
|
osx_system_prefix = r'^/System/Library/Frameworks/Python.framework/Versions'
|
|
|
|
matches = {'man': [(r'^/usr$', '/usr/share'),
|
|
|
|
(r'^/usr/local$', '/usr/local/share'),
|
|
|
|
(osx_system_prefix, '/usr/share')]}
|
|
|
|
|
|
|
|
match = [i[1] for i in matches.get(type, []) if re.match(i[0], prefix)]
|
|
|
|
if not len(match):
|
|
|
|
raise ValueError("not supported type: {}".format(type))
|
|
|
|
return match.pop()
|
|
|
|
|
|
|
|
|
|
|
|
def get_data_files(prefix):
|
|
|
|
return [(os.path.join(_resolve_prefix(prefix, 'man'), 'man/man1'), ['docs/_build/man/git-lint.1'])]
|
|
|
|
|
|
|
|
|
|
|
|
parser = argparse.ArgumentParser()
|
|
|
|
parser.add_argument('--prefix', default='',
|
|
|
|
help='prefix to install data files')
|
|
|
|
opts, _ = parser.parse_known_args(sys.argv)
|
|
|
|
prefix = opts.prefix or '/usr'
|
2016-09-19 21:41:01 +00:00
|
|
|
|
|
|
|
try:
|
|
|
|
from setuptools import setup
|
|
|
|
except ImportError:
|
|
|
|
from distutils.core import setup
|
|
|
|
|
|
|
|
|
|
|
|
with open('README.rst') as readme_file:
|
|
|
|
readme = readme_file.read()
|
|
|
|
|
|
|
|
with open('HISTORY.rst') as history_file:
|
|
|
|
history = history_file.read()
|
|
|
|
|
|
|
|
requirements = [
|
|
|
|
# TODO: put package requirements here
|
|
|
|
]
|
|
|
|
|
|
|
|
test_requirements = [
|
|
|
|
# TODO: put package test requirements here
|
|
|
|
]
|
|
|
|
|
2016-09-30 18:49:21 +00:00
|
|
|
print get_data_files(prefix)
|
|
|
|
|
2016-09-19 21:41:01 +00:00
|
|
|
setup(
|
2016-09-28 21:26:06 +00:00
|
|
|
name='git_linter',
|
|
|
|
version='0.0.4',
|
2016-09-19 21:41:01 +00:00
|
|
|
description="A git command to lint everything in your workspace (or stage) that was changed since the last commit.",
|
|
|
|
long_description=readme + '\n\n' + history,
|
2016-09-28 21:26:06 +00:00
|
|
|
author='Kenneth M. "Elf" Sternberg',
|
2016-09-19 21:41:01 +00:00
|
|
|
author_email='elf.sternberg@gmail.com',
|
2016-09-28 21:26:06 +00:00
|
|
|
url='https://github.com/elfsternberg/git_linter',
|
2016-09-19 21:41:01 +00:00
|
|
|
packages=[
|
|
|
|
'git_lint',
|
|
|
|
],
|
|
|
|
package_dir={'git_lint':
|
|
|
|
'git_lint'},
|
|
|
|
include_package_data=True,
|
2016-09-30 18:49:21 +00:00
|
|
|
data_files = get_data_files(prefix),
|
2016-09-19 21:41:01 +00:00
|
|
|
install_requires=requirements,
|
2016-09-28 21:26:06 +00:00
|
|
|
license="MIT",
|
2016-09-19 21:41:01 +00:00
|
|
|
zip_safe=False,
|
2016-09-28 21:26:06 +00:00
|
|
|
keywords='git lint style syntaxt development',
|
|
|
|
entry_points={
|
|
|
|
'console_scripts': [
|
|
|
|
'git-lint = git_lint.__main__:main'
|
|
|
|
]
|
|
|
|
},
|
2016-09-19 21:41:01 +00:00
|
|
|
classifiers=[
|
|
|
|
'Development Status :: 2 - Pre-Alpha',
|
|
|
|
'Intended Audience :: Developers',
|
|
|
|
'License :: OSI Approved :: ISC License (ISCL)',
|
|
|
|
'Natural Language :: English',
|
|
|
|
"Programming Language :: Python :: 2",
|
|
|
|
'Programming Language :: Python :: 2.7',
|
|
|
|
'Programming Language :: Python :: 3',
|
|
|
|
'Programming Language :: Python :: 3.3',
|
|
|
|
'Programming Language :: Python :: 3.4',
|
|
|
|
'Programming Language :: Python :: 3.5',
|
|
|
|
],
|
|
|
|
test_suite='tests',
|
|
|
|
tests_require=test_requirements
|
|
|
|
)
|