forked from raccoongang/xblock-video
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
76 lines (64 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
"""Setup for video XBlock."""
import os
import re
from setuptools import setup
def get_version(*file_paths):
"""
Extract the version string from the file at the given relative path fragments.
"""
filename = os.path.join(os.path.dirname(__file__), *file_paths)
version_file = open(filename).read()
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError('Unable to find version string.')
def package_data(pkg, roots):
"""
Generic function to find package_data.
All of the files under each of the `roots` will be declared as package
data for package `pkg`.
"""
data = []
for root in roots:
for dirname, _, files in os.walk(os.path.join(pkg, root)):
for fname in files:
data.append(os.path.relpath(os.path.join(dirname, fname), pkg))
return {pkg: data}
VERSION = get_version('video_xblock', '__init__.py')
DESCRIPTION = 'Video XBlock to embed videos hosted on different video platforms into your courseware'
setup(
name='video-xblock',
version=VERSION,
description=DESCRIPTION,
license='GPL v3',
packages=[
'video_xblock',
],
dependency_links=[
# At the moment of writing PyPI hosts outdated version of xblock-utils, hence git
# Replace dependency links with numbered versions when it's released on PyPI
'git+https://github.com/edx/xblock-utils.git@v1.0.5#egg=xblock-utils==1.0.5',
],
install_requires=[
'pycaption>=0.7.1,<=1.0.1', # The latest Python 2.7 compatible version
'requests>=2.9.1,<3.0.0',
'babelfish>=0.5.5,<0.6.0',
'XBlock>=0.4.10,<2.0.0',
'xblock-utils>=1.0.2,<=1.1.1'
],
entry_points={
'xblock.v1': [
'video_xblock = video_xblock:VideoXBlock',
],
'video_xblock.v1': [
'youtube-player = video_xblock.backends.youtube:YoutubePlayer',
'wistia-player = video_xblock.backends.wistia:WistiaPlayer',
'brightcove-player = video_xblock.backends.brightcove:BrightcovePlayer',
'dummy-player = video_xblock.backends.dummy:DummyPlayer',
'vimeo-player = video_xblock.backends.vimeo:VimeoPlayer',
'html5-player = video_xblock.backends.html5:Html5Player',
]
},
package_data=package_data("video_xblock", ["static", ]),
)