-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
73 lines (68 loc) · 2.81 KB
/
setup.py
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
# Copyright (C) 2012 Allis Tauri <[email protected]>
#
# degen_primer_gui is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# degen_primer_gui is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
'''
Created on Jul 27, 2012
@author: Allis Tauri <[email protected]>
'''
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
import sys, os
import subprocess
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
#compile resources
qrc_filename = 'resources/DegenPrimerUI.qrc'
rcc_filename = 'DegenPrimerGUI/DegenPrimerUI_rc.py'
pyrcc4_cli = 'pyrcc4 -py3 %s' % qrc_filename
child = subprocess.Popen(pyrcc4_cli,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=(sys.platform!="win32"))
rcc_content = child.stdout.read()
#filter out timestamp. Otherwise dpkg-source complains that the source had changed
rcc_filtered = ''
for line in rcc_content.split('\n'):
if line[:10] == '# Created:':
line = '# Created:'
rcc_filtered += line + '\n'
#write compiled resources module
rcc_file = open(rcc_filename, 'w')
rcc_file.write(rcc_filtered)
rcc_file.close()
#setup
from distutils.core import setup
setup(name='degen-primer-gui',
version='2.2.0',
description='Qt GUI for DegenPrimer',
long_description=read('README.md'),
license='GPL-3',
author='Allis Tauri',
author_email='[email protected]',
url='https://launchpad.net/degenprimergui',
classifiers=[
'Development Status :: 3 - Alpha',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Intended Audience :: Science/Research',
'Operating System :: POSIX',
'Programming Language :: Python'],
packages=['DegenPrimerGUI'],
scripts=['degen_primer_gui'],
data_files=[('share/icons/hicolor/scalable/apps', ['resources/degen_primer.svg', 'resources/clear.svg']),
('share/applications', ['DegenPrimerGUI.desktop']),
('share/degen_primer_gui', ['resources/DegenPrimerUI.ui', 'resources/DegenPrimerUI.qrc', 'resources/ReportWidget.ui'])]
)