From aa4b5aa97856d847da939b26cd133dd8d2ec3fe4 Mon Sep 17 00:00:00 2001 From: "Elf M. Sternberg" Date: Mon, 3 Oct 2016 08:24:50 -0700 Subject: [PATCH] Fixed paths to prefix and man page. --- MANIFEST.in | 1 + setup.py | 18 ++---------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 965b2dd..bc6bd38 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -9,3 +9,4 @@ recursive-exclude * __pycache__ recursive-exclude * *.py[co] recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif +include docs/_build/man/git-lint.1 diff --git a/setup.py b/setup.py index e445529..d3cb139 100644 --- a/setup.py +++ b/setup.py @@ -5,27 +5,15 @@ import argparse import os.path -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'])] + return [(os.path.join(prefix, 'share/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' +prefix = opts.prefix or sys.prefix or '/usr' try: from setuptools import setup @@ -47,8 +35,6 @@ test_requirements = [ # TODO: put package test requirements here ] -print get_data_files(prefix) - setup( name='git_linter', version='0.0.4',