forked from ccbogel/QualCoder
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
103 lines (92 loc) · 3.35 KB
/
setup.py
File metadata and controls
103 lines (92 loc) · 3.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
""" from setup example: https://github.com/pypa/sampleproject/blob/master/setup.py
"""
import sys
from os import path
from setuptools import find_namespace_packages, setup
here = path.abspath(path.dirname(__file__))
def load_requirements(filename):
"""Return package requirements, skipping pip-only directives."""
requirements = []
with open(path.join(here, filename), encoding='utf-8') as f:
for raw_line in f:
line = raw_line.strip()
if not line or line.startswith('#'):
continue
if line.startswith((
'-r', '--requirement',
'-c', '--constraint',
'-f', '--find-links',
'--index-url', '--extra-index-url',
)):
continue
# Keep URL fragments intact, but drop normal inline comments.
if ' #' in line:
line = line.split(' #', 1)[0].rstrip()
requirements.append(line)
return requirements
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
# Get requirements
required_modules = load_requirements('requirements.txt')
mainscript = 'src/qualcoder/__main__.py'
OPTIONS = {
'argv_emulation': True,
'iconfile': 'src/qualcoder/GUI/qualcoder.icns'
}
if sys.platform == 'darwin':
extra_options = dict(
setup_requires=['py2app'],
app=[mainscript],
# Cross-platform applications generally expect sys.argv to
# be used for opening files.
options={'py2app': OPTIONS},
)
elif sys.platform == 'win32':
extra_options = dict(
setup_requires=['py2exe'],
options = {'py2exe': {'bundle_files': 1, 'compressed': True}},
windows = [{'script': mainscript}],
)
# older code above the bracket: app=[mainscript],
else:
extra_options = dict(
# Normally unix-like platforms will use "setup.py install"
# and install the main script as such
entry_points={
'console_scripts': ['qualcoder=qualcoder.__main__:gui']
},
)
setup(
name='Qualcoder',
version='3.7',
url='http://github.com/ccbogel/QualCoder',
author='Colin Curtain and Kai Droege',
author_email='ccbogel@hotmail.com',
description='Qualitative data analysis',
long_description=long_description,
classifiers=[
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Operating System :: OS Independent',
'Development Status :: 3 - Alpha'
],
keywords='qualitative data analysis',
package_dir={'': 'src'},
packages=find_namespace_packages(where='src', include=['qualcoder', 'qualcoder.*']),
python_requires='>=3.10',
install_requires=required_modules,
package_data={
'qualcoder':['Codebook.xsd', 'Project-mrt2019.xsd',
'GUI/*.html', 'GUI/NotoSans-hinted/*.ttf',
'locale/de/app_de.qm', 'locale/de/LC_MESSAGES/de,mo',
'locale/es/app_es.qm', 'locale/es/LC_MESSAGES/es,mo',
'locale/fr/app_fr.qm', 'locale/fr/LC_MESSAGES/fr.mo',
'locale/it/app_it.qm', 'locale/it/LC_MESSAGES/it.mo',
'locale/pt/app_pt.qm', 'locale/pt/LC_MESSAGES/pt,mo',
'locale/en/LC_MESSAGES/en,mo',]
},
zip_safe=False,
include_package_data=True,
**extra_options
)