forked from Thann/play-with-mpv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·63 lines (56 loc) · 1.89 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
#!/usr/bin/env python
import os
from setuptools import setup, find_packages
description = "Chrome extension and python server that allows you to play videos in webpages with MPV instead."
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def get_version():
from subprocess import Popen, PIPE
try:
from subprocess import DEVNULL # py3
except ImportError:
import os
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')))
setup(
name = "play-with-mpv",
version = get_version(),
author = "Jonathan Knapp",
author_email = "[email protected]",
description = description,
license = "MIT",
keywords = "mpv video play chrome extension",
url = "http://github.com/thann/play-with-mpv",
long_description=read('README.md'),
classifiers=[
"Development Status :: 3 - Alpha",
"Topic :: Utilities",
"License :: OSI Approved :: MIT License",
],
py_modules=["play_with_mpv"],
install_requires=['wheel', 'youtube-dl'],
entry_points={
'gui_scripts': [
'play-with-mpv=play_with_mpv:start',
],
},
setup_requires=['wheel', 'install_freedesktop'],
dependency_links=[
"https://github.com/Thann/install_freedesktop"
],
desktop_entries={
'play-with-mpv': {
'filename': 'thann.play-with-mpv',
'Name': 'Play With MPV (server)',
'Categories': 'AudioVideo;Audio;Video;Player;TV',
'Comment': description,
'Icon': 'mpv',
},
},
)