File: setup.py

package info (click to toggle)
python-flickrapi 2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 468 kB
  • sloc: python: 2,145; makefile: 147; sh: 10
file content (107 lines) | stat: -rw-r--r-- 3,244 bytes parent folder | download
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Python setuptools install script.

Run with "python setup.py install" to install FlickrAPI
"""

from __future__ import print_function

__author__ = 'Sybren A. Stuvel'

# Check the Python version
import re
import io
import os
import sys

(major, minor) = sys.version_info[:2]

if (major, minor) < (2, 7) or (major == 3 and minor < 4):
    raise SystemExit("Sorry, Python 2.7, or 3.4 or newer required")

from setuptools import setup


def read(*names, **kwargs):
    with io.open(
        os.path.join(os.path.dirname(__file__), *names),
        encoding=kwargs.get("encoding", "utf8")
    ) as fp:
        return fp.read()


def find_version(*file_paths):
    version_file = read(*file_paths)
    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.")


needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
pytest_runner = ['pytest-runner'] if needs_pytest else []
test_deps = [
    'mock;python_version<"3.3"',
    "pytest>=2.9.1",
    "pytest-cov>=2.2.1",
    "responses>=0.5.1"
]

data = {
    'name': 'flickrapi',
    'version': find_version("flickrapi", "__init__.py"),
    'author': __author__,
    'author_email': 'sybren@stuvel.eu',
    'maintainer': __author__,
    'maintainer_email': 'sybren@stuvel.eu',
    'url': 'https://stuvel.eu/flickrapi',
    'description': 'The Python interface to the Flickr API',
    'long_description': 'The easiest to use, most complete, and '
                        'most actively developed Python interface to the Flickr API.'
                        'It includes support for authorized and non-authorized '
                        'access, uploading and replacing photos, and all Flickr API '
                        'functions.',
    'packages': ['flickrapi'],
    'license': 'Python',
    'classifiers': [
        'Development Status :: 6 - Mature',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: Python License (CNRI Python License)',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: Implementation :: CPython',
        'Programming Language :: Python :: Implementation :: PyPy',
        'Topic :: Multimedia :: Graphics',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ],
    'setup_requires': pytest_runner,
    'tests_require': test_deps,
    'install_requires': [
        'six>=1.5.2',
        'requests>=2.2.1',
        'requests_oauthlib>=0.4.0',
        'requests_toolbelt>=0.3.1',
    ],
    'extras_require': {
        'docs': [
            'sphinx >= 1.5.1'
        ],
        'qa': [
            'flake8'
        ],
        'test': test_deps
    },
    'zip_safe': True,
    'test_suite': 'tests',
}

setup(**data)