setup   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 26
dl 0
loc 43
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A get_version() 0 11 2
1
import os
2
from setuptools import setup, find_packages
3
4
NAME = 'PillowImage'
5
6
DESCRIPTION = 'Pillow wrapper for quick image alterations.'
7
8
LONG_DESCRIPTION = """
9
Pure Python Pillow package wrapper.
10
"""
11
12
13
def get_version(package_name, version_file='_version.py'):
14
    """
15
    Retrieve the package version from a version file in the package root.
16
17
    :param package_name:
18
    :param version_file: version file name (inside package root)
19
    :return: package version
20
    """
21
    filename = os.path.join(os.path.dirname(__file__), package_name, version_file)
22
    with open(filename, 'rb') as fp:
23
        return fp.read().decode('utf8').split('=')[1].strip(" \n'")
24
25
26
setup(
27
    name=NAME,
28
    version=get_version(NAME),
29
    packages=find_packages(),
30
    python_requires='>=3.6',
31
    install_requires=[
32
        'reportlab>=3.5.19',
33
        'Pillow>=7.0',
34
        'PyBundle>=1.0.6',
35
    ],
36
    include_package_data=True,
37
    url='https://github.com/sfneal/PillowImage',
38
    license='MIT',
39
    author='Stephen Neal',
40
    author_email='[email protected]',
41
    description=DESCRIPTION,
42
    long_description=LONG_DESCRIPTION,
43
)
44