-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathsetup.py
90 lines (76 loc) · 3.19 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#! /usr/bin/env python
# -*- coding:utf-8 -*-
# This file is a part of IoT-LAB cli-tools
# Copyright (C) 2015 INRIA (Contact: admin@iot-lab.info)
# Contributor(s) : see AUTHORS file
#
# This software is governed by the CeCILL license under French law
# and abiding by the rules of distribution of free software. You can use,
# modify and/ or redistribute the software under the terms of the CeCILL
# license as circulated by CEA, CNRS and INRIA at the following URL
# http://www.cecill.info.
#
# As a counterpart to the access to the source code and rights to copy,
# modify and redistribute granted by the license, users are provided only
# with a limited warranty and the software's author, the holder of the
# economic rights, and the successive licensors have only limited
# liability.
#
# The fact that you are presently reading this means that you have had
# knowledge of the CeCILL license and that you accept its terms.
"""CLI-Tools setuptools script."""
import os
from setuptools import setup, find_packages
PACKAGE = 'iotlabcli'
# GPL compatible http://www.gnu.org/licenses/license-list.html#CeCILL
LICENSE = 'CeCILL v2.1'
def cat(files, join_str=''):
"""Concatenate `files` content with `join_str` between them."""
# pylint:disable=consider-using-with
files_content = (open(f).read() for f in files)
return join_str.join(files_content)
def get_version(package):
""" Extract package version without importing file
Importing cause issues with coverage,
(modules can be removed from sys.modules to prevent this)
Importing __init__.py triggers importing rest and then requests too
Inspired from pep8 setup.py
"""
version = '-1'
with open(os.path.join(package, '__init__.py')) as init_fd:
for line in init_fd:
if line.startswith('__version__'):
version = eval(line.split('=')[-1]) # pylint:disable=eval-used
break
return version
SCRIPTS = ['iotlab-auth', 'iotlab-experiment', 'iotlab-node', 'iotlab-profile',
'iotlab-robot', 'iotlab-status', 'iotlab']
LONG_DESCRIPTION_FILES = ['README.rst', 'CHANGELOG.rst']
setup(
name=PACKAGE,
version=get_version(PACKAGE),
description='IoT-LAB testbed command-line client',
long_description=cat(LONG_DESCRIPTION_FILES, '\n\n'),
long_description_content_type='text/x-rst',
author='IoT-LAB Team',
author_email='admin@iot-lab.info',
url='http://www.iot-lab.info',
license=LICENSE,
download_url='http://github.com/iot-lab/cli-tools/',
packages=find_packages(),
package_data={'integration/firmwares': ['integration/firmwares/*']},
include_package_data=True,
scripts=SCRIPTS,
classifiers=['Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Intended Audience :: End Users/Desktop',
'Environment :: Console',
'Topic :: Utilities', ],
extras_require={
# https://urllib3.readthedocs.org/en/latest/\
# security.html#openssl-pyopenssl
'secure': ['pyOpenSSL', 'ndg-httpsclient', 'pyasn1'],
},
install_requires=['requests>2.4.2', 'jmespath'],
)