Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sivel
GitHub Repository: sivel/speedtest-cli
Path: blob/master/setup.py
280 views
1
#!/usr/bin/env python
2
# -*- coding: utf-8 -*-
3
# Copyright 2012 Matt Martz
4
# All Rights Reserved.
5
#
6
# Licensed under the Apache License, Version 2.0 (the "License"); you may
7
# not use this file except in compliance with the License. You may obtain
8
# a copy of the License at
9
#
10
# http://www.apache.org/licenses/LICENSE-2.0
11
#
12
# Unless required by applicable law or agreed to in writing, software
13
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
# License for the specific language governing permissions and limitations
16
# under the License.
17
18
import os
19
import re
20
import codecs
21
22
from setuptools import setup
23
24
here = os.path.abspath(os.path.dirname(__file__))
25
26
27
# Read the version number from a source file.
28
# Why read it, and not import?
29
# see https://groups.google.com/d/topic/pypa-dev/0PkjVpcxTzQ/discussion
30
def find_version(*file_paths):
31
# Open in Latin-1 so that we avoid encoding errors.
32
# Use codecs.open for Python 2 compatibility
33
try:
34
f = codecs.open(os.path.join(here, *file_paths), 'r', 'latin1')
35
version_file = f.read()
36
f.close()
37
except:
38
raise RuntimeError("Unable to find version string.")
39
40
# The version line must have the form
41
# __version__ = 'ver'
42
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
43
version_file, re.M)
44
if version_match:
45
return version_match.group(1)
46
raise RuntimeError("Unable to find version string.")
47
48
49
# Get the long description from the relevant file
50
try:
51
f = codecs.open('README.rst', encoding='utf-8')
52
long_description = f.read()
53
f.close()
54
except:
55
long_description = ''
56
57
58
setup(
59
name='speedtest-cli',
60
version=find_version('speedtest.py'),
61
description=('Command line interface for testing internet bandwidth using '
62
'speedtest.net'),
63
long_description=long_description,
64
keywords='speedtest speedtest.net',
65
author='Matt Martz',
66
author_email='[email protected]',
67
url='https://github.com/sivel/speedtest-cli',
68
license='Apache License, Version 2.0',
69
py_modules=['speedtest'],
70
entry_points={
71
'console_scripts': [
72
'speedtest=speedtest:main',
73
'speedtest-cli=speedtest:main'
74
]
75
},
76
classifiers=[
77
'Development Status :: 5 - Production/Stable',
78
'Programming Language :: Python',
79
'Environment :: Console',
80
'License :: OSI Approved :: Apache Software License',
81
'Operating System :: OS Independent',
82
'Programming Language :: Python :: 2',
83
'Programming Language :: Python :: 2.4',
84
'Programming Language :: Python :: 2.5',
85
'Programming Language :: Python :: 2.6',
86
'Programming Language :: Python :: 2.7',
87
'Programming Language :: Python :: 3',
88
'Programming Language :: Python :: 3.1',
89
'Programming Language :: Python :: 3.2',
90
'Programming Language :: Python :: 3.3',
91
'Programming Language :: Python :: 3.4',
92
'Programming Language :: Python :: 3.5',
93
'Programming Language :: Python :: 3.6',
94
'Programming Language :: Python :: 3.7',
95
'Programming Language :: Python :: 3.8',
96
'Programming Language :: Python :: 3.9',
97
'Programming Language :: Python :: 3.10',
98
]
99
)
100
101