Compare commits
No commits in common. "master" and "v1.0.5" have entirely different histories.
61
.travis.yml
61
.travis.yml
|
|
@ -1,6 +1,7 @@
|
||||||
language: python
|
language: python
|
||||||
sudo: required
|
|
||||||
dist: xenial
|
python:
|
||||||
|
- 2.7
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
|
|
@ -10,52 +11,26 @@ addons:
|
||||||
- python2.4
|
- python2.4
|
||||||
- python2.5
|
- python2.5
|
||||||
- python2.6
|
- python2.6
|
||||||
- python3.2
|
- pypy
|
||||||
- python3.3
|
|
||||||
|
|
||||||
matrix:
|
env:
|
||||||
include:
|
- TOXENV=py24
|
||||||
- python: 2.7
|
- TOXENV=py25
|
||||||
env: TOXENV=flake8
|
- TOXENV=py26
|
||||||
- python: 2.7
|
- TOXENV=py27
|
||||||
env: TOXENV=py24
|
- TOXENV=py32
|
||||||
- python: 2.7
|
- TOXENV=py33
|
||||||
env: TOXENV=py25
|
- TOXENV=py34
|
||||||
- python: 2.7
|
- TOXENV=py35
|
||||||
env: TOXENV=py26
|
- TOXENV=pypy
|
||||||
- python: 2.7
|
- TOXENV=flake8
|
||||||
env: TOXENV=py27
|
|
||||||
- python: 2.7
|
|
||||||
env: TOXENV=py32
|
|
||||||
- python: 2.7
|
|
||||||
env: TOXENV=py33
|
|
||||||
- python: 3.4
|
|
||||||
env: TOXENV=py34
|
|
||||||
- python: 3.5
|
|
||||||
env: TOXENV=py35
|
|
||||||
- python: 3.6
|
|
||||||
env: TOXENV=py36
|
|
||||||
- python: 3.7
|
|
||||||
env: TOXENV=py37
|
|
||||||
- python: 3.8-dev
|
|
||||||
env: TOXENV=py38
|
|
||||||
- python: pypy
|
|
||||||
env: TOXENV=pypy
|
|
||||||
dist: trusty
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
- if [[ $(echo "$TOXENV" | egrep -c "py35") != 0 ]]; then pyenv global system 3.5; fi;
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- if [[ $(echo "$TOXENV" | egrep -c "py32") != 0 ]]; then pip install setuptools==17.1.1; fi;
|
- if [[ $(echo "$TOXENV" | egrep -c "(py2[45]|py3[12])") != 0 ]]; then pip install virtualenv==1.7.2 tox==1.3; fi;
|
||||||
- if [[ $(echo "$TOXENV" | egrep -c "(py2[45]|py3[12])") != 0 ]]; then pip install virtualenv==1.7.2 tox==1.3; fi;
|
- if [[ $(echo "$TOXENV" | egrep -c "(py2[45]|py3[12])") == 0 ]]; then pip install tox; fi;
|
||||||
- if [[ $(echo "$TOXENV" | egrep -c "(py26|py33)") != 0 ]]; then pip install virtualenv==15.2.0 tox==2.9.1; fi;
|
|
||||||
- if [[ $(echo "$TOXENV" | egrep -c "(py2[456]|py3[123])") == 0 ]]; then pip install tox; fi;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- tox
|
- tox
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
|
|
|
||||||
29
README.rst
29
README.rst
|
|
@ -7,9 +7,9 @@ speedtest.net
|
||||||
.. image:: https://img.shields.io/pypi/v/speedtest-cli.svg
|
.. image:: https://img.shields.io/pypi/v/speedtest-cli.svg
|
||||||
:target: https://pypi.python.org/pypi/speedtest-cli/
|
:target: https://pypi.python.org/pypi/speedtest-cli/
|
||||||
:alt: Latest Version
|
:alt: Latest Version
|
||||||
.. image:: https://img.shields.io/travis/sivel/speedtest-cli.svg
|
.. image:: https://img.shields.io/pypi/dm/speedtest-cli.svg
|
||||||
:target: https://pypi.python.org/pypi/speedtest-cli/
|
:target: https://pypi.python.org/pypi/speedtest-cli/
|
||||||
:alt: Travis
|
:alt: Downloads
|
||||||
.. image:: https://img.shields.io/pypi/l/speedtest-cli.svg
|
.. image:: https://img.shields.io/pypi/l/speedtest-cli.svg
|
||||||
:target: https://pypi.python.org/pypi/speedtest-cli/
|
:target: https://pypi.python.org/pypi/speedtest-cli/
|
||||||
:alt: License
|
:alt: License
|
||||||
|
|
@ -17,7 +17,7 @@ speedtest.net
|
||||||
Versions
|
Versions
|
||||||
--------
|
--------
|
||||||
|
|
||||||
speedtest-cli works with Python 2.4-3.7
|
speedtest-cli works with Python 2.4-3.5
|
||||||
|
|
||||||
.. image:: https://img.shields.io/pypi/pyversions/speedtest-cli.svg
|
.. image:: https://img.shields.io/pypi/pyversions/speedtest-cli.svg
|
||||||
:target: https://pypi.python.org/pypi/speedtest-cli/
|
:target: https://pypi.python.org/pypi/speedtest-cli/
|
||||||
|
|
@ -51,8 +51,7 @@ or
|
||||||
::
|
::
|
||||||
|
|
||||||
git clone https://github.com/sivel/speedtest-cli.git
|
git clone https://github.com/sivel/speedtest-cli.git
|
||||||
cd speedtest-cli
|
python speedtest-cli/setup.py install
|
||||||
python setup.py install
|
|
||||||
|
|
||||||
Just download (Like the way it used to be)
|
Just download (Like the way it used to be)
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
@ -75,12 +74,11 @@ Usage
|
||||||
::
|
::
|
||||||
|
|
||||||
$ speedtest-cli -h
|
$ speedtest-cli -h
|
||||||
usage: speedtest-cli [-h] [--no-download] [--no-upload] [--single] [--bytes]
|
usage: speedtest-cli [-h] [--no-download] [--no-upload] [--bytes] [--share]
|
||||||
[--share] [--simple] [--csv]
|
[--simple] [--csv] [--csv-delimiter CSV_DELIMITER]
|
||||||
[--csv-delimiter CSV_DELIMITER] [--csv-header] [--json]
|
[--csv-header] [--json] [--list] [--server SERVER]
|
||||||
[--list] [--server SERVER] [--exclude EXCLUDE]
|
|
||||||
[--mini MINI] [--source SOURCE] [--timeout TIMEOUT]
|
[--mini MINI] [--source SOURCE] [--timeout TIMEOUT]
|
||||||
[--secure] [--no-pre-allocate] [--version]
|
[--secure] [--version]
|
||||||
|
|
||||||
Command line interface for testing internet bandwidth using speedtest.net.
|
Command line interface for testing internet bandwidth using speedtest.net.
|
||||||
--------------------------------------------------------------------------
|
--------------------------------------------------------------------------
|
||||||
|
|
@ -90,8 +88,6 @@ Usage
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
--no-download Do not perform download test
|
--no-download Do not perform download test
|
||||||
--no-upload Do not perform upload test
|
--no-upload Do not perform upload test
|
||||||
--single Only use a single connection instead of multiple. This
|
|
||||||
simulates a typical file transfer.
|
|
||||||
--bytes Display values in bytes instead of bits. Does not
|
--bytes Display values in bytes instead of bits. Does not
|
||||||
affect the image generated by --share, nor output from
|
affect the image generated by --share, nor output from
|
||||||
--json or --csv
|
--json or --csv
|
||||||
|
|
@ -110,19 +106,12 @@ Usage
|
||||||
affected by --bytes
|
affected by --bytes
|
||||||
--list Display a list of speedtest.net servers sorted by
|
--list Display a list of speedtest.net servers sorted by
|
||||||
distance
|
distance
|
||||||
--server SERVER Specify a server ID to test against. Can be supplied
|
--server SERVER Specify a server ID to test against
|
||||||
multiple times
|
|
||||||
--exclude EXCLUDE Exclude a server from selection. Can be supplied
|
|
||||||
multiple times
|
|
||||||
--mini MINI URL of the Speedtest Mini server
|
--mini MINI URL of the Speedtest Mini server
|
||||||
--source SOURCE Source IP address to bind to
|
--source SOURCE Source IP address to bind to
|
||||||
--timeout TIMEOUT HTTP timeout in seconds. Default 10
|
--timeout TIMEOUT HTTP timeout in seconds. Default 10
|
||||||
--secure Use HTTPS instead of HTTP when communicating with
|
--secure Use HTTPS instead of HTTP when communicating with
|
||||||
speedtest.net operated servers
|
speedtest.net operated servers
|
||||||
--no-pre-allocate Do not pre allocate upload data. Pre allocation is
|
|
||||||
enabled by default to improve upload performance. To
|
|
||||||
support systems with insufficient memory, use this
|
|
||||||
option to avoid a MemoryError
|
|
||||||
--version Show the version number and exit
|
--version Show the version number and exit
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
9
setup.py
9
setup.py
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright 2012 Matt Martz
|
# Copyright 2012-2016 Matt Martz
|
||||||
# All Rights Reserved.
|
# All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
|
@ -66,7 +66,7 @@ setup(
|
||||||
author_email='matt@sivel.net',
|
author_email='matt@sivel.net',
|
||||||
url='https://github.com/sivel/speedtest-cli',
|
url='https://github.com/sivel/speedtest-cli',
|
||||||
license='Apache License, Version 2.0',
|
license='Apache License, Version 2.0',
|
||||||
py_modules=['speedtest'],
|
py_modules=['speedtest', 'speedtest_cli'],
|
||||||
entry_points={
|
entry_points={
|
||||||
'console_scripts': [
|
'console_scripts': [
|
||||||
'speedtest=speedtest:main',
|
'speedtest=speedtest:main',
|
||||||
|
|
@ -90,10 +90,5 @@ setup(
|
||||||
'Programming Language :: Python :: 3.3',
|
'Programming Language :: Python :: 3.3',
|
||||||
'Programming Language :: Python :: 3.4',
|
'Programming Language :: Python :: 3.4',
|
||||||
'Programming Language :: Python :: 3.5',
|
'Programming Language :: Python :: 3.5',
|
||||||
'Programming Language :: Python :: 3.6',
|
|
||||||
'Programming Language :: Python :: 3.7',
|
|
||||||
'Programming Language :: Python :: 3.8',
|
|
||||||
'Programming Language :: Python :: 3.9',
|
|
||||||
'Programming Language :: Python :: 3.10',
|
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
.TH "speedtest-cli" 1 "2018-01-05" "speedtest-cli"
|
.TH "speedtest-cli" 1 "2014-04-23" "speedtest-cli"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
speedtest\-cli \- Command line interface for testing internet bandwidth using speedtest.net
|
speedtest\-cli \- Command line interface for testing internet bandwidth using speedtest.net
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
|
@ -23,29 +23,14 @@ Displays usage for the tool.
|
||||||
|
|
||||||
.B Options
|
.B Options
|
||||||
|
|
||||||
\fB\-\-no\-download\fR
|
|
||||||
.RS
|
|
||||||
Do not perform download test
|
|
||||||
.RE
|
|
||||||
|
|
||||||
\fB\-\-no\-upload\fR
|
|
||||||
.RS
|
|
||||||
Do not perform upload test
|
|
||||||
.RE
|
|
||||||
|
|
||||||
\fB\-\-single\fR
|
|
||||||
.RS
|
|
||||||
Only use a single connection instead of multiple. This simulates a typical file transfer.
|
|
||||||
.RE
|
|
||||||
|
|
||||||
\fB\-\-bytes\fR
|
\fB\-\-bytes\fR
|
||||||
.RS
|
.RS
|
||||||
Display values in bytes instead of bits. Does not affect the image generated by \-\-share, nor output from \-\-json or \-\-csv
|
Display values in bytes instead of bits. Does not affect the image generated by \-\-share
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
\fB\-\-share\fR
|
\fB\-\-share\fR
|
||||||
.RS
|
.RS
|
||||||
Generate and provide a URL to the speedtest.net share results image, not displayed with \-\-csv
|
Generate and provide a URL to the speedtest.net share results image
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
\fB\-\-simple\fR
|
\fB\-\-simple\fR
|
||||||
|
|
@ -58,12 +43,12 @@ Suppress verbose output, only show basic information
|
||||||
Suppress verbose output, only show basic information in CSV format. Speeds listed in bit/s and not affected by \-\-bytes
|
Suppress verbose output, only show basic information in CSV format. Speeds listed in bit/s and not affected by \-\-bytes
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
\fB\-\-csv\-delimiter CSV_DELIMITER\fR
|
\fB\-\-csv-delimiter CSV_DELIMITER\fR
|
||||||
.RS
|
.RS
|
||||||
Single character delimiter to use in CSV output. Default ","
|
Single character delimiter to use in CSV output. Default ","
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
\fB\-\-csv\-header\fR
|
\fB\-\-csv-header\fR
|
||||||
.RS
|
.RS
|
||||||
Print CSV headers
|
Print CSV headers
|
||||||
.RE
|
.RE
|
||||||
|
|
@ -80,12 +65,7 @@ Display a list of speedtest.net servers sorted by distance
|
||||||
|
|
||||||
\fB\-\-server SERVER\fR
|
\fB\-\-server SERVER\fR
|
||||||
.RS
|
.RS
|
||||||
Specify a server ID to test against. Can be supplied multiple times
|
Specify a server ID to test against
|
||||||
.RE
|
|
||||||
|
|
||||||
\fB\-\-exclude EXCLUDE\fR
|
|
||||||
.RS
|
|
||||||
Exclude a server from selection. Can be supplied multiple times
|
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
\fB\-\-mini MINI\fR
|
\fB\-\-mini MINI\fR
|
||||||
|
|
@ -108,11 +88,6 @@ HTTP timeout in seconds. Default 10
|
||||||
Use HTTPS instead of HTTP when communicating with speedtest.net operated servers
|
Use HTTPS instead of HTTP when communicating with speedtest.net operated servers
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
\fB\-\-no\-pre\-allocate\fR
|
|
||||||
.RS
|
|
||||||
Do not pre allocate upload data. Pre allocation is enabled by default to improve upload performance. To support systems with insufficient memory, use this option to avoid a MemoryError
|
|
||||||
.RE
|
|
||||||
|
|
||||||
\fB\-\-version\fR
|
\fB\-\-version\fR
|
||||||
.RS
|
.RS
|
||||||
Show the version number and exit
|
Show the version number and exit
|
||||||
|
|
|
||||||
1017
speedtest.py
1017
speedtest.py
File diff suppressed because it is too large
Load Diff
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright 2018 Matt Martz
|
# Copyright 2012-2016 Matt Martz
|
||||||
# All Rights Reserved.
|
# All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
|
@ -15,23 +15,20 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import sys
|
import warnings
|
||||||
import subprocess
|
|
||||||
|
|
||||||
cmd = [sys.executable, 'speedtest.py', '--source', '127.0.0.1']
|
DEPRECATED_MSG = ('The file speedtest_cli.py has been deprecated in favor of '
|
||||||
|
'speedtest.py\nand is available for download at:\n\n'
|
||||||
|
'https://raw.githubusercontent.com/sivel/speedtest-cli/'
|
||||||
|
'master/speedtest.py')
|
||||||
|
|
||||||
p = subprocess.Popen(
|
|
||||||
cmd,
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.PIPE
|
|
||||||
)
|
|
||||||
|
|
||||||
stdout, stderr = p.communicate()
|
if __name__ == '__main__':
|
||||||
|
raise SystemExit(DEPRECATED_MSG)
|
||||||
if p.returncode != 1:
|
else:
|
||||||
raise SystemExit('%s did not fail with exit code 1' % ' '.join(cmd))
|
try:
|
||||||
|
from speedtest import *
|
||||||
if 'Invalid argument'.encode() not in stderr:
|
except ImportError:
|
||||||
raise SystemExit(
|
raise SystemExit(DEPRECATED_MSG)
|
||||||
'"Invalid argument" not found in stderr:\n%s' % stderr.decode()
|
else:
|
||||||
)
|
warnings.warn(DEPRECATED_MSG, UserWarning)
|
||||||
4
tox.ini
4
tox.ini
|
|
@ -6,8 +6,6 @@ commands =
|
||||||
{envpython} -V
|
{envpython} -V
|
||||||
{envpython} -m compileall speedtest.py
|
{envpython} -m compileall speedtest.py
|
||||||
{envpython} speedtest.py
|
{envpython} speedtest.py
|
||||||
{envpython} speedtest.py --source 172.17.0.1
|
|
||||||
{envpython} tests/scripts/source.py
|
|
||||||
|
|
||||||
[testenv:flake8]
|
[testenv:flake8]
|
||||||
basepython=python
|
basepython=python
|
||||||
|
|
@ -21,5 +19,3 @@ commands =
|
||||||
pypy -V
|
pypy -V
|
||||||
pypy -m compileall speedtest.py
|
pypy -m compileall speedtest.py
|
||||||
pypy speedtest.py
|
pypy speedtest.py
|
||||||
pypy speedtest.py --source 172.17.0.1
|
|
||||||
pypy tests/scripts/source.py
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue