comparison setup.py @ 221:471d3b7fc282

install: fixed setup.py by using find_packages + MANIFEST.in
author Goffi <goffi@goffi.org>
date Thu, 03 Oct 2019 21:43:36 +0200
parents bfe72370ca49
children 22a082143bc0
comparison
equal deleted inserted replaced
220:f7d6ae06c42f 221:471d3b7fc282
16 16
17 # You should have received a copy of the GNU Affero General Public License 17 # You should have received a copy of the GNU Affero General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. 18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 19
20 import os 20 import os
21 import sys 21 from setuptools import setup, find_packages
22 from setuptools import setup
23 22
24 base = None
25 NAME = 'sat_templates' 23 NAME = 'sat_templates'
26 is_wheel = 'bdist_wheel' in sys.argv
27
28 # https://stackoverflow.com/a/36693250
29
30 def get_package_data(directory):
31 paths = []
32 for (path, directories, filenames) in os.walk(directory):
33 for filename in filenames:
34 paths.append(os.path.join('..', path, filename))
35 return paths
36 24
37 25
38 with open(os.path.join(NAME, 'VERSION')) as f: 26 with open(os.path.join(NAME, 'VERSION')) as f:
39 VERSION = f.read().strip() 27 VERSION = f.read().strip()
40 is_dev_version = VERSION.endswith('D') 28 is_dev_version = VERSION.endswith('D')
61 long_description=u'SàT Template is a common module which can be used by any SàT ' 49 long_description=u'SàT Template is a common module which can be used by any SàT '
62 u'frontend to generate documents (mostly HTML but not only).', 50 u'frontend to generate documents (mostly HTML but not only).',
63 author='Association « Salut à Toi »', 51 author='Association « Salut à Toi »',
64 author_email='contact@salut-a-toi.org', 52 author_email='contact@salut-a-toi.org',
65 url='https://salut-a-toi.org', 53 url='https://salut-a-toi.org',
66 classifiers=['Development Status :: 3 - Alpha', 54 classifiers=[
67 'Programming Language :: Python :: 2.7', 55 'Development Status :: 3 - Alpha',
68 'Programming Language :: Python :: 2 :: Only', 56 'Programming Language :: Python :: 2.7',
69 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)', 57 'Programming Language :: Python :: 2 :: Only',
70 ], 58 'License :: OSI Approved :: GNU Affero General Public License v3 or later '
59 '(AGPLv3+)',
60 ],
71 install_requires=[], 61 install_requires=[],
72 setup_requires=['setuptools_scm'] if is_dev_version else [], 62 setup_requires=['setuptools_scm'] if is_dev_version else [],
73 use_scm_version=sat_templates_dev_version if is_dev_version else False, 63 use_scm_version=sat_templates_dev_version if is_dev_version else False,
74 packages=['sat_templates'], 64 packages=find_packages(),
75 package_data={'sat_templates': get_package_data('sat_templates') },
76 zip_safe=False, 65 zip_safe=False,
77 ) 66 )
78 67
79 setup(**setup_info) 68 setup(**setup_info)