-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.py
executable file
·76 lines (69 loc) · 2.44 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
74
75
76
#!/usr/bin/env python
import os
from setuptools import setup, find_packages
description = "Noise generator GUI powered by Sound eXchange"
def read(fname):
with open(os.path.join(os.path.dirname(__file__), fname)) as file:
return file.read()
def get_version():
from subprocess import Popen, PIPE
try:
from subprocess import DEVNULL # py3
except ImportError:
DEVNULL = open(os.devnull, 'wb')
def run(*cmd):
return (Popen(cmd, stderr=DEVNULL, stdout=PIPE)
.communicate()[0].decode('utf8').strip())
return(run('git', 'describe', '--tags').replace('-','.post',1).replace('-','+',1)
or '0.0.0.post{}+g{}'.format(
run('git', 'rev-list', '--count', 'HEAD'),
run('git', 'rev-parse', '--short', 'HEAD')))
# write version file
version = get_version()
filename = os.path.join(os.path.dirname(__file__), ".version")
with open(filename, 'w') as vfile:
vfile.write(version)
setup(
name = "sox-noise",
version = version,
author = "Jonathan Knapp",
author_email = "[email protected]",
description = description,
license = "UNLICENSE",
keywords = "sox noise generator",
url = "http://github.com/thann/sox-noise",
long_description = description,
# long_description=read('README.md'),
classifiers=[
"Development Status :: 4 - Beta",
# "Development Status :: 5 - Production/Stable",
"Topic :: Multimedia :: Sound/Audio :: Sound Synthesis",
"License :: OSI Approved :: The Unlicense (Unlicense)",
],
# NOTE: This causes a warning but is seemingly necessary unless everything is in a sub-folder =/
packages=[''],
package_data={'': ['main.ui', '.version']},
include_package_data=True,
py_modules=["sox_noise"],
install_requires=['wheel', 'PyGObject'],
entry_points={
'gui_scripts': [
'sox-noise=sox_noise:start',
],
},
setup_requires=['wheel', 'install_freedesktop>=0.2.0'],
dependency_links=[
"https://github.com/thann/install_freedesktop/tarball/master#egg=install_freedesktop-0.2.0"
],
desktop_entries={
'sox-noise': {
'args': '--config=%f',
'filename': 'thann.sox-noise',
'Name': 'SoX Noise',
'Categories': 'AudioVideo;Audio;Player',
'Comment': description,
'Icon': 'audio-volume-high',
'MimeType': 'text/x-sox-noise-config',
},
},
)