From c3a66816edafe4eb760073745ff980c044110659 Mon Sep 17 00:00:00 2001 From: Tino Didriksen Date: Thu, 5 Apr 2018 07:41:23 +0000 Subject: [PATCH] WIP issue #84 --- Makefile | 4 ++++ setup.py | 21 +++++---------------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 8de1a0073..9e3af73b3 100644 --- a/Makefile +++ b/Makefile @@ -19,8 +19,12 @@ test: coverage combine coverage report --fail-under 40 +unclean: langNames.db + cp -a langNames.db README.md COPYING apertium_apy/ + clean: rm -f langNames.db + rm -f apertium_apy/langNames.db apertium_apy/README.md apertium_apy/COPYING distclean: clean rm -rf dist/ build/ *.egg-info/ .mypy_cache/ .coverage diff --git a/setup.py b/setup.py index 58f65be2f..497b1eb5b 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -from os import listdir, path +from os import path from setuptools import setup, find_packages from setuptools.command.install import install from subprocess import check_call, CalledProcessError @@ -9,7 +9,7 @@ class InstallHelper(install): def run(self): try: - check_call(['make', 'langNames.db']) + check_call(['make', 'unclean']) except CalledProcessError: pass @@ -21,13 +21,6 @@ def run(self): pass -def files(root): - for file_or_dir in listdir(root): - full_path = path.join(root, file_or_dir) - if path.isfile(full_path): - yield full_path - - setup( name='apertium-apy', version=apy.__version__, @@ -64,13 +57,9 @@ def files(root): 'console_scripts': ['apertium-apy=apertium_apy.apy:main'], }, packages=find_packages(exclude=['tests']), - data_files=[ - ('apertium_apy', ['README.md', 'COPYING', 'langNames.db']), - ('apertium_apy/tools', files('tools')), - ('apertium_apy/tools/systemd', files('tools/systemd')), - ('apertium_apy/tools/sysvinit', files('tools/sysvinit')), - ('apertium_apy/tools/upstart', files('tools/upstart')), - ], + package_data={ + 'apertium_apy': ['README.md', 'COPYING', 'langNames.db'], + }, cmdclass={ 'install': InstallHelper, },