aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2019-11-10 22:14:10 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2019-11-10 22:14:10 -0500
commit0c73e982fa596da07f23b377621ab894a9e64884 (patch)
tree96f6a40a5656c15a2ec7217a8a1efcff5827bcbb /setup.py
parent40f5fe6edef268632d3bc484e85e5b37bad67bff (diff)
New upstream version 1.11.1upstream/1.11.1
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py96
1 files changed, 33 insertions, 63 deletions
diff --git a/setup.py b/setup.py
index 8299811..f0f0f16 100644
--- a/setup.py
+++ b/setup.py
@@ -1,22 +1,15 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# -*- coding: utf-8 -*-
-from __future__ import unicode_literals, print_function
-
+import re
import sys
import os.path
import warnings
+from setuptools import setup
if sys.hexversion < 0x3040000:
sys.exit("Python 3.4+ required")
-try:
- from setuptools import setup
- has_setuptools = True
-except ImportError:
- from distutils.core import setup
- has_setuptools = False
-
def read(fname):
path = os.path.join(os.path.dirname(__file__), fname)
@@ -24,7 +17,8 @@ def read(fname):
return file.read()
def check_file(fname):
- if os.path.exists(fname):
+ path = os.path.join(os.path.dirname(__file__), fname)
+ if os.path.exists(path):
return True
warnings.warn(
"Not including file '{}' since it is not present. "
@@ -34,65 +28,27 @@ def check_file(fname):
# get version without importing the package
-exec(read("gallery_dl/version.py"))
-
-DESCRIPTION = ("Command-line program to download image-galleries and "
- "-collections from several image hosting sites")
-LONG_DESCRIPTION = read("README.rst")
-
-if "py2exe" in sys.argv:
- try:
- import py2exe
- except ImportError:
- sys.exit("Error importing 'py2exe'")
- params = {
- "console": [{
- "script": "./gallery_dl/__main__.py",
- "dest_base": "gallery-dl",
- "version": __version__,
- "description": DESCRIPTION,
- "comments": LONG_DESCRIPTION,
- "product_name": "gallery-dl",
- "product_version": __version__,
- }],
- "options": {"py2exe": {
- "bundle_files": 0,
- "compressed": 1,
- "optimize": 1,
- "dist_dir": ".",
- "packages": ["gallery_dl"],
- "dll_excludes": ["w9xpopen.exe"],
- }},
- "zipfile": None,
- }
-elif has_setuptools:
- params = {
- "entry_points": {
- "console_scripts": [
- "gallery-dl = gallery_dl:main"
- ]
- }
- }
-else:
- params = {
- "scripts": ["bin/gallery-dl"]
- }
+VERSION = re.search(
+ r'__version__\s*=\s*"([^"]+)"',
+ read("gallery_dl/version.py"),
+).group(1)
-data_files = [
+FILES = [
(path, [f for f in files if check_file(f)])
for (path, files) in [
- ('etc/bash_completion.d', ['gallery-dl.bash_completion']),
- ('share/man/man1' , ['gallery-dl.1']),
- ('share/man/man5' , ['gallery-dl.conf.5']),
+ ("share/bash-completion/completions", ["data/completion/gallery-dl"]),
+ ("share/man/man1" , ["data/man/gallery-dl.1"]),
+ ("share/man/man5" , ["data/man/gallery-dl.conf.5"]),
]
]
setup(
name="gallery_dl",
- version=__version__,
- description=DESCRIPTION,
- long_description=LONG_DESCRIPTION,
+ version=VERSION,
+ description=("Command-line program to download image-galleries and "
+ "-collections from several image hosting sites"),
+ long_description=read("README.rst"),
url="https://github.com/mikf/gallery-dl",
download_url="https://github.com/mikf/gallery-dl/releases/latest",
author="Mike Fährmann",
@@ -104,13 +60,27 @@ setup(
install_requires=[
"requests>=2.11.0",
],
+ extras_require={
+ "cloudflare": [
+ "pyOpenSSL>=19.0.0",
+ "cryptography>=2.8.0",
+ ],
+ "video": [
+ "youtube-dl",
+ ],
+ },
packages=[
"gallery_dl",
"gallery_dl.extractor",
"gallery_dl.downloader",
"gallery_dl.postprocessor",
],
- data_files=data_files,
+ entry_points={
+ "console_scripts": [
+ "gallery-dl = gallery_dl:main",
+ ],
+ },
+ data_files=FILES,
keywords="image gallery downloader crawler scraper",
classifiers=[
"Development Status :: 5 - Production/Stable",
@@ -124,11 +94,11 @@ setup(
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
+ "Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Multimedia :: Graphics",
"Topic :: Utilities",
],
test_suite="test",
- **params
)