]> jfr.im git - yt-dlp.git/blame - setup.py
Completely change project name to yt-dlp (#85)
[yt-dlp.git] / setup.py
CommitLineData
2f1765c4 1#!/usr/bin/env python
dcdb292f 2# coding: utf-8
2f1765c4 3
58ac65e7 4from setuptools import setup, Command, find_packages
6c57e8a0 5import os.path
6c57e8a0 6import warnings
4efe62a0 7import sys
5a9858bf 8from distutils.spawn import spawn
a32b573c 9
e38df8f9 10
7a5c1cfe
P
11# Get the version from yt_dlp/version.py without importing the package
12exec(compile(open('yt_dlp/version.py').read(),
13 'yt_dlp/version.py', 'exec'))
3d4b08df 14
e38df8f9 15
7bc877a2 16DESCRIPTION = 'Command-line program to download videos from YouTube.com and many other other video platforms.'
17
18LONG_DESCRIPTION = '\n\n'.join((
7a5c1cfe 19 'Official repository: <https://github.com/yt-dlp/yt-dlp>',
7bc877a2 20 '**PS**: Many links in this document will not work since this is a copy of the README.md from Github',
21 open("README.md", "r", encoding="utf-8").read()))
770234af 22
5d25607a 23REQUIREMENTS = ['mutagen', 'pycryptodome']
e38df8f9 24
25
fec89790 26if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe':
94a538fa 27 print("inv")
fec89790 28else:
6c57e8a0 29 files_spec = [
7a5c1cfe
P
30 ('etc/bash_completion.d', ['yt-dlp.bash-completion']),
31 ('etc/fish/completions', ['yt-dlp.fish']),
32 ('share/doc/yt_dlp', ['README.txt']),
33 ('share/man/man1', ['yt-dlp.1'])
6c57e8a0
PH
34 ]
35 root = os.path.dirname(os.path.abspath(__file__))
36 data_files = []
37 for dirname, files in files_spec:
38 resfiles = []
39 for fn in files:
40 if not os.path.exists(fn):
41 warnings.warn('Skipping file %s since it is not present. Type make to build all automatically generated files.' % fn)
42 else:
43 resfiles.append(fn)
44 data_files.append((dirname, resfiles))
45
fec89790 46 params = {
6c57e8a0 47 'data_files': data_files,
a5741a3f 48 }
7a5c1cfe 49 params['entry_points'] = {'console_scripts': ['yt-dlp = yt_dlp:main']}
66c935fb 50
a5741a3f 51
5a9858bf 52class build_lazy_extractors(Command):
3d4b08df 53 description = 'Build the extractor lazy loading module'
5a9858bf
JMF
54 user_options = []
55
56 def initialize_options(self):
57 pass
58
59 def finalize_options(self):
60 pass
61
62 def run(self):
63 spawn(
7a5c1cfe 64 [sys.executable, 'devscripts/make_lazy_extractors.py', 'yt_dlp/extractor/lazy_extractors.py'],
5a9858bf
JMF
65 dry_run=self.dry_run,
66 )
67
66c935fb 68
e38df8f9 69packages = find_packages(exclude=("youtube_dl", "test", "ytdlp_plugins"))
66c935fb 70
cc51a7d4 71setup(
7bc877a2 72 name="yt-dlp",
652e7768 73 version=__version__,
7bc877a2 74 maintainer="pukkandan",
7a5c1cfe 75 maintainer_email="pukkandan.ytdlp@gmail.com",
3d4b08df
S
76 description=DESCRIPTION,
77 long_description=LONG_DESCRIPTION,
7bc877a2 78 long_description_content_type="text/markdown",
7a5c1cfe 79 url="https://github.com/yt-dlp/yt-dlp",
66c935fb 80 packages=packages,
e38df8f9 81 install_requires=REQUIREMENTS,
7bc877a2 82 project_urls={
7a5c1cfe
P
83 'Documentation': 'https://github.com/yt-dlp/yt-dlp#yt-dlp',
84 'Source': 'https://github.com/yt-dlp/yt-dlp',
85 'Tracker': 'https://github.com/yt-dlp/yt-dlp/issues',
7bc877a2 86 #'Funding': 'https://donate.pypi.org',
87 },
652e7768 88 classifiers=[
94a538fa
U
89 "Topic :: Multimedia :: Video",
90 "Development Status :: 5 - Production/Stable",
91 "Environment :: Console",
92 "Programming Language :: Python",
93 "Programming Language :: Python :: 2",
94 "Programming Language :: Python :: 2.6",
95 "Programming Language :: Python :: 2.7",
96 "Programming Language :: Python :: 3",
97 "Programming Language :: Python :: 3.2",
98 "Programming Language :: Python :: 3.3",
99 "Programming Language :: Python :: 3.4",
100 "Programming Language :: Python :: 3.5",
101 "Programming Language :: Python :: 3.6",
102 "Programming Language :: Python :: 3.7",
103 "Programming Language :: Python :: 3.8",
104 "Programming Language :: Python :: Implementation",
105 "Programming Language :: Python :: Implementation :: CPython",
106 "Programming Language :: Python :: Implementation :: IronPython",
107 "Programming Language :: Python :: Implementation :: Jython",
108 "Programming Language :: Python :: Implementation :: PyPy",
109 "License :: Public Domain",
110 "Operating System :: OS Independent",
a5741a3f 111 ],
94a538fa
U
112 python_requires='>=2.6',
113
114 cmdclass={'build_lazy_extractors': build_lazy_extractors},
fec89790 115 **params
6515018d 116)