speedtest-cli-ng 0.2.0__tar.gz → 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. speedtest_cli_ng-1.0.0/.gitignore +220 -0
  2. {speedtest_cli_ng-0.2.0 → speedtest_cli_ng-1.0.0}/NOTICE +1 -1
  3. {speedtest_cli_ng-0.2.0/speedtest_cli_ng.egg-info → speedtest_cli_ng-1.0.0}/PKG-INFO +35 -19
  4. {speedtest_cli_ng-0.2.0 → speedtest_cli_ng-1.0.0}/README.md +22 -8
  5. speedtest_cli_ng-1.0.0/prek.toml +69 -0
  6. {speedtest_cli_ng-0.2.0 → speedtest_cli_ng-1.0.0}/pyproject.toml +49 -39
  7. speedtest_cli_ng-1.0.0/src/speedtest/__init__.py +3 -0
  8. {speedtest_cli_ng-0.2.0 → speedtest_cli_ng-1.0.0/src}/speedtest/__main__.py +8 -11
  9. speedtest_cli_ng-1.0.0/src/speedtest/__version__.py +5 -0
  10. speedtest_cli_ng-1.0.0/src/speedtest/cli/__init__.py +7 -0
  11. speedtest_cli_ng-1.0.0/src/speedtest/cli/display.py +69 -0
  12. {speedtest_cli_ng-0.2.0 → speedtest_cli_ng-1.0.0/src}/speedtest/cli/parser.py +2 -8
  13. speedtest_cli_ng-1.0.0/src/speedtest/cli/runner.py +107 -0
  14. speedtest_cli_ng-1.0.0/src/speedtest/client.py +120 -0
  15. speedtest_cli_ng-1.0.0/src/speedtest/engine/__init__.py +30 -0
  16. speedtest_cli_ng-1.0.0/src/speedtest/engine/config.py +71 -0
  17. {speedtest_cli_ng-0.2.0 → speedtest_cli_ng-1.0.0/src}/speedtest/engine/network.py +39 -37
  18. {speedtest_cli_ng-0.2.0 → speedtest_cli_ng-1.0.0/src}/speedtest/engine/servers.py +11 -15
  19. {speedtest_cli_ng-0.2.0 → speedtest_cli_ng-1.0.0/src}/speedtest/engine/transfer.py +55 -29
  20. {speedtest_cli_ng-0.2.0 → speedtest_cli_ng-1.0.0/src}/speedtest/exceptions.py +10 -10
  21. speedtest_cli_ng-1.0.0/src/speedtest/models/__init__.py +17 -0
  22. speedtest_cli_ng-0.2.0/speedtest/models/config.py → speedtest_cli_ng-1.0.0/src/speedtest/models/api_config.py +3 -2
  23. {speedtest_cli_ng-0.2.0 → speedtest_cli_ng-1.0.0/src}/speedtest/models/context.py +17 -5
  24. speedtest_cli_ng-1.0.0/src/speedtest/models/location.py +25 -0
  25. {speedtest_cli_ng-0.2.0 → speedtest_cli_ng-1.0.0/src}/speedtest/models/result.py +2 -2
  26. {speedtest_cli_ng-0.2.0 → speedtest_cli_ng-1.0.0/src}/speedtest/models/server.py +3 -26
  27. speedtest_cli_ng-1.0.0/src/speedtest/utils/__init__.py +9 -0
  28. speedtest_cli_ng-1.0.0/src/speedtest/utils/constants.py +7 -0
  29. speedtest_cli_ng-1.0.0/src/speedtest/utils/logger.py +43 -0
  30. speedtest_cli_ng-1.0.0/tests/cli/test_display.py +109 -0
  31. speedtest_cli_ng-1.0.0/tests/cli/test_parser.py +83 -0
  32. speedtest_cli_ng-1.0.0/tests/cli/test_runner.py +268 -0
  33. speedtest_cli_ng-1.0.0/tests/conftest.py +147 -0
  34. speedtest_cli_ng-1.0.0/tests/engine/test_config.py +133 -0
  35. speedtest_cli_ng-1.0.0/tests/engine/test_network.py +309 -0
  36. speedtest_cli_ng-1.0.0/tests/engine/test_servers.py +120 -0
  37. speedtest_cli_ng-1.0.0/tests/engine/test_transfer.py +239 -0
  38. speedtest_cli_ng-1.0.0/tests/models/test_api_config.py +58 -0
  39. speedtest_cli_ng-1.0.0/tests/models/test_context.py +107 -0
  40. speedtest_cli_ng-1.0.0/tests/models/test_location.py +53 -0
  41. speedtest_cli_ng-1.0.0/tests/models/test_result.py +90 -0
  42. speedtest_cli_ng-1.0.0/tests/models/test_server.py +80 -0
  43. speedtest_cli_ng-1.0.0/tests/test_client.py +239 -0
  44. speedtest_cli_ng-1.0.0/tests/test_main.py +133 -0
  45. speedtest_cli_ng-1.0.0/tests/utils/test_logger.py +79 -0
  46. speedtest_cli_ng-1.0.0/uv.lock +361 -0
  47. speedtest_cli_ng-0.2.0/PKG-INFO +0 -162
  48. speedtest_cli_ng-0.2.0/extras/man/speedtest-cli.1 +0 -103
  49. speedtest_cli_ng-0.2.0/setup.cfg +0 -4
  50. speedtest_cli_ng-0.2.0/speedtest/__init__.py +0 -15
  51. speedtest_cli_ng-0.2.0/speedtest/cli/commands.py +0 -26
  52. speedtest_cli_ng-0.2.0/speedtest/cli/main.py +0 -103
  53. speedtest_cli_ng-0.2.0/speedtest/cli/output.py +0 -62
  54. speedtest_cli_ng-0.2.0/speedtest/client.py +0 -117
  55. speedtest_cli_ng-0.2.0/speedtest/engine/__init__.py +0 -0
  56. speedtest_cli_ng-0.2.0/speedtest/engine/config.py +0 -50
  57. speedtest_cli_ng-0.2.0/speedtest/models/__init__.py +0 -12
  58. speedtest_cli_ng-0.2.0/speedtest/utils/__init__.py +0 -0
  59. speedtest_cli_ng-0.2.0/speedtest/utils/logger.py +0 -91
  60. speedtest_cli_ng-0.2.0/speedtest_cli_ng.egg-info/SOURCES.txt +0 -32
  61. speedtest_cli_ng-0.2.0/speedtest_cli_ng.egg-info/dependency_links.txt +0 -1
  62. speedtest_cli_ng-0.2.0/speedtest_cli_ng.egg-info/entry_points.txt +0 -3
  63. speedtest_cli_ng-0.2.0/speedtest_cli_ng.egg-info/top_level.txt +0 -1
  64. {speedtest_cli_ng-0.2.0 → speedtest_cli_ng-1.0.0}/LICENSE +0 -0
  65. {speedtest_cli_ng-0.2.0 → speedtest_cli_ng-1.0.0/src}/speedtest/utils/status.py +0 -0
  66. {speedtest_cli_ng-0.2.0/speedtest/cli → speedtest_cli_ng-1.0.0/tests}/__init__.py +0 -0
@@ -0,0 +1,220 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by an python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ *.lcov
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ cover/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ # Pipfile.lock
97
+
98
+ # UV
99
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
100
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
101
+ # commonly ignored for libraries.
102
+ # uv.lock
103
+
104
+ # poetry
105
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
106
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
107
+ # commonly ignored for libraries.
108
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
109
+ # poetry.lock
110
+ # poetry.toml
111
+
112
+ # pdm
113
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
114
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
115
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
116
+ # pdm.lock
117
+ # pdm.toml
118
+ .pdm-python
119
+ .pdm-build/
120
+
121
+ # pixi
122
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
123
+ # pixi.lock
124
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
125
+ # in the .venv directory. It is recommended not to include this directory in version control.
126
+ .pixi/*
127
+ !.pixi/config.toml
128
+
129
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
130
+ __pypackages__/
131
+
132
+ # Celery stuff
133
+ celerybeat-schedule*
134
+ celerybeat.pid
135
+
136
+ # Redis
137
+ *.rdb
138
+ *.aof
139
+ *.pid
140
+
141
+ # RabbitMQ
142
+ mnesia/
143
+ rabbitmq/
144
+ rabbitmq-data/
145
+
146
+ # ActiveMQ
147
+ activemq-data/
148
+
149
+ # SageMath parsed files
150
+ *.sage.py
151
+
152
+ # Environments
153
+ .env
154
+ .envrc
155
+ .venv
156
+ env/
157
+ venv/
158
+ ENV/
159
+ env.bak/
160
+ venv.bak/
161
+
162
+ # Spyder project settings
163
+ .spyderproject
164
+ .spyproject
165
+
166
+ # Rope project settings
167
+ .ropeproject
168
+
169
+ # mkdocs documentation
170
+ /site
171
+
172
+ # mypy
173
+ .mypy_cache/
174
+ .dmypy.json
175
+ dmypy.json
176
+
177
+ # Pyre type checker
178
+ .pyre/
179
+
180
+ # pytype static type analyzer
181
+ .pytype/
182
+
183
+ # Cython debug symbols
184
+ cython_debug/
185
+
186
+ # PyCharm
187
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
188
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
189
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
190
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
191
+ # .idea/
192
+
193
+ # Abstra
194
+ # Abstra is an AI-powered process automation framework.
195
+ # Ignore directories containing user credentials, local state, and settings.
196
+ # Learn more at https://abstra.io/docs
197
+ .abstra/
198
+
199
+ # Visual Studio Code
200
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
201
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
202
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
203
+ # you could uncomment the following to ignore the entire vscode folder
204
+ # .vscode/
205
+ # Temporary file for partial code execution
206
+ tempCodeRunnerFile.py
207
+
208
+ # Ruff stuff:
209
+ .ruff_cache/
210
+
211
+ # PyPI configuration file
212
+ .pypirc
213
+
214
+ # Marimo
215
+ marimo/_static/
216
+ marimo/_lsp/
217
+ __marimo__/
218
+
219
+ # Streamlit
220
+ .streamlit/secrets.toml
@@ -2,5 +2,5 @@ speedtest-cli
2
2
  Copyright (c) 2026 Michał Korczak
3
3
  Copyright (c) 2012-2026 Matt Martz
4
4
 
5
- This product includes software originally developed by Matt Martz
5
+ This product includes software originally developed by Matt Martz
6
6
  (https://github.com/sivel/speedtest-cli).
@@ -1,28 +1,30 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: speedtest-cli-ng
3
- Version: 0.2.0
3
+ Version: 1.0.0
4
4
  Summary: Next generation CLI for testing internet bandwidth using speedtest.net
5
- Author-email: Michał Korczak <git@omikor.in>
6
- License-Expression: Apache-2.0
7
5
  Project-URL: Homepage, https://github.com/Omikorin/speedtest-cli
8
6
  Project-URL: Source, https://github.com/Omikorin/speedtest-cli
9
7
  Project-URL: Issues, https://github.com/Omikorin/speedtest-cli/issues
10
- Keywords: speedtest,speedtest.net,bandwidth,internet,cli
11
- Classifier: Development Status :: 4 - Beta
8
+ Author: Michał Korczak
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ License-File: NOTICE
12
+ Keywords: bandwidth,cli,internet,speedtest,speedtest.net
13
+ Classifier: Development Status :: 5 - Production/Stable
12
14
  Classifier: Environment :: Console
13
15
  Classifier: Intended Audience :: Developers
14
16
  Classifier: Intended Audience :: System Administrators
15
17
  Classifier: Operating System :: OS Independent
16
- Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Programming Language :: Python :: 3.15
17
20
  Classifier: Topic :: Internet :: WWW/HTTP
18
21
  Classifier: Topic :: System :: Networking
19
22
  Classifier: Topic :: Terminals
20
23
  Classifier: Topic :: Utilities
21
- Requires-Python: >=3.12
24
+ Requires-Python: >=3.14
25
+ Requires-Dist: httpx2<3,>=2.12.0
26
+ Requires-Dist: rich<16,>=15.0.0
22
27
  Description-Content-Type: text/markdown
23
- License-File: LICENSE
24
- License-File: NOTICE
25
- Dynamic: license-file
26
28
 
27
29
  # speedtest-cli
28
30
 
@@ -34,8 +36,6 @@ Dynamic: license-file
34
36
 
35
37
  Next generation CLI for testing internet bandwidth using speedtest.net
36
38
 
37
- Rebuilt for modern Python 3.12+
38
-
39
39
  ## Getting started
40
40
 
41
41
  ### Installation
@@ -110,12 +110,22 @@ Miscellaneous Options:
110
110
 
111
111
  ### Requirements
112
112
 
113
- - Python 3.12+
114
- - uv 0.11+
113
+ - Python 3.14+
114
+ - uv 0.13+
115
+ - prek 0.5+
115
116
 
116
- ### Setup project
117
+ ### Setup pre-commit hooks
117
118
 
118
- This will install project's dependencies. Keep in mind that there are no runtime dependencies in production.
119
+ You can install hooks to automatically run the validation checks:
120
+
121
+ ```shell
122
+ uv tool install prek
123
+ prek install
124
+ ```
125
+
126
+ ### Install dependencies
127
+
128
+ This will install project's dependencies
119
129
 
120
130
  ```bash
121
131
  uv sync
@@ -124,6 +134,12 @@ uv sync
124
134
  ### Basic workflow
125
135
 
126
136
  ```bash
137
+ # Run pre-commit checks for changed files
138
+ prek
139
+
140
+ # Run all pre-commit checks
141
+ prek --all-files
142
+
127
143
  # Run format
128
144
  uv run ruff format --check .
129
145
 
@@ -131,7 +147,7 @@ uv run ruff format --check .
131
147
  uv run ruff check .
132
148
 
133
149
  # Run typecheck
134
- uv run pyright
150
+ uv run ty check
135
151
 
136
152
  # Run tests
137
153
  uv run pytest
@@ -153,7 +169,7 @@ This project is a heavily refactored and modernized fork of the original [speedt
153
169
 
154
170
  ## License
155
171
 
156
- This project is licensed undeer the [Apache License 2.0](https://github.com/Omikorin/speedtest-cli/blob/main/LICENSE).
172
+ This project is licensed under the terms of the [Apache License 2.0](https://github.com/Omikorin/speedtest-cli/blob/main/LICENSE).
157
173
 
158
174
  ---
159
175
 
@@ -8,8 +8,6 @@
8
8
 
9
9
  Next generation CLI for testing internet bandwidth using speedtest.net
10
10
 
11
- Rebuilt for modern Python 3.12+
12
-
13
11
  ## Getting started
14
12
 
15
13
  ### Installation
@@ -84,12 +82,22 @@ Miscellaneous Options:
84
82
 
85
83
  ### Requirements
86
84
 
87
- - Python 3.12+
88
- - uv 0.11+
85
+ - Python 3.14+
86
+ - uv 0.13+
87
+ - prek 0.5+
88
+
89
+ ### Setup pre-commit hooks
89
90
 
90
- ### Setup project
91
+ You can install hooks to automatically run the validation checks:
92
+
93
+ ```shell
94
+ uv tool install prek
95
+ prek install
96
+ ```
91
97
 
92
- This will install project's dependencies. Keep in mind that there are no runtime dependencies in production.
98
+ ### Install dependencies
99
+
100
+ This will install project's dependencies
93
101
 
94
102
  ```bash
95
103
  uv sync
@@ -98,6 +106,12 @@ uv sync
98
106
  ### Basic workflow
99
107
 
100
108
  ```bash
109
+ # Run pre-commit checks for changed files
110
+ prek
111
+
112
+ # Run all pre-commit checks
113
+ prek --all-files
114
+
101
115
  # Run format
102
116
  uv run ruff format --check .
103
117
 
@@ -105,7 +119,7 @@ uv run ruff format --check .
105
119
  uv run ruff check .
106
120
 
107
121
  # Run typecheck
108
- uv run pyright
122
+ uv run ty check
109
123
 
110
124
  # Run tests
111
125
  uv run pytest
@@ -127,7 +141,7 @@ This project is a heavily refactored and modernized fork of the original [speedt
127
141
 
128
142
  ## License
129
143
 
130
- This project is licensed undeer the [Apache License 2.0](https://github.com/Omikorin/speedtest-cli/blob/main/LICENSE).
144
+ This project is licensed under the terms of the [Apache License 2.0](https://github.com/Omikorin/speedtest-cli/blob/main/LICENSE).
131
145
 
132
146
  ---
133
147
 
@@ -0,0 +1,69 @@
1
+ minimum_prek_version = "0.5.10"
2
+
3
+ [update]
4
+ cooldown_days = 7
5
+ freeze = true
6
+ include_tags = "v*"
7
+ exclude_tags = ["*-{alpha,beta,rc}*"]
8
+ repos = {
9
+ "https://github.com/python-jsonschema/check-jsonschema" = { include_tags = "*" },
10
+ "https://github.com/astral-sh/uv-pre-commit" = { include_tags = "*" }
11
+ }
12
+
13
+ [[repos]]
14
+ repo = "builtin"
15
+ hooks = [
16
+ { id = "check-merge-conflict" },
17
+ { id = "trailing-whitespace" },
18
+ { id = "end-of-file-fixer" },
19
+ { id = "mixed-line-ending" },
20
+ { id = "check-json" },
21
+ { id = "check-json5" },
22
+ { id = "check-toml" },
23
+ { id = "check-yaml" },
24
+ ]
25
+
26
+ [[repos]]
27
+ repo = "https://github.com/abravalheri/validate-pyproject"
28
+ rev = "82d21874c3242e4dc27bb47641c996902ef64eef" # frozen: v0.27
29
+ hooks = [
30
+ { id = "validate-pyproject" },
31
+ ]
32
+
33
+ [[repos]]
34
+ repo = "https://github.com/python-jsonschema/check-jsonschema"
35
+ rev = "a76b92851fc9eede9f9bc4073eb55202f34eb0df" # frozen: 0.39.0
36
+ hooks = [
37
+ { id = "check-github-workflows" },
38
+ { id = "check-renovate", additional_dependencies = ['json5'] },
39
+ ]
40
+
41
+ # zizmor detects security vulnerabilities in GitHub Actions workflows
42
+ [[repos]]
43
+ repo = "https://github.com/zizmorcore/zizmor-pre-commit"
44
+ rev = "c92afdf2c6ca336aaa8f39e2bd8d48f62dbd8e1f" # frozen: v1.31.1
45
+ hooks = [
46
+ { id = "zizmor", args = ["--no-progress", "--fix"] },
47
+ ]
48
+
49
+ [[repos]]
50
+ repo = "https://github.com/astral-sh/uv-pre-commit"
51
+ rev = "46787482b9fb2003c56e0f7592e312ef381829d9" # frozen: 0.13.6
52
+ hooks = [
53
+ { id = "uv-lock" },
54
+ ]
55
+
56
+ [[repos]]
57
+ repo = "https://github.com/astral-sh/ruff-pre-commit"
58
+ rev = "25bcf95026b96e2dd3c0aec3090c3d6ef6ca2e6c" # frozen: v0.17.3
59
+ hooks = [
60
+ { id = "ruff-check", args = ["--fix", "--exit-non-zero-on-fix"] },
61
+ { id = "ruff-format", types_or = ["python", "pyi", "jupyter", "markdown"] },
62
+ ]
63
+
64
+ [[repos]]
65
+ repo = "https://github.com/astral-sh/ty-pre-commit"
66
+ rev = "18b2b8bb1b9b90d2d21283756e89b07fc9c747bf" # frozen: v0.0.95
67
+ hooks = [
68
+ { id = "ty" },
69
+ ]
@@ -1,33 +1,34 @@
1
1
  [build-system]
2
- requires = ["setuptools>=80.0.0", "wheel"]
3
- build-backend = "setuptools.build_meta"
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "speedtest-cli-ng"
7
- version = "0.2.0"
8
- authors = [
9
- {name = "Michał Korczak", email = "git@omikor.in"}
10
- # TODO: I'm not sure whether I should put the old author because of possible spam for him unknowingly etc
11
- # {name = "Matt Martz", email = "matt@sivel.net"}
12
- ]
7
+ description = "Next generation CLI for testing internet bandwidth using speedtest.net"
8
+ keywords = ["speedtest", "speedtest.net", "bandwidth", "internet", "cli"]
13
9
  license = "Apache-2.0"
10
+ version = "1.0.0"
11
+ requires-python = ">=3.14"
12
+ authors = [{ name = "Michał Korczak" }]
14
13
  license-files = ["LICENSE", "NOTICE"]
15
- description = "Next generation CLI for testing internet bandwidth using speedtest.net"
16
14
  readme = "README.md"
17
- requires-python = ">=3.12"
18
- keywords = ["speedtest", "speedtest.net", "bandwidth", "internet", "cli"]
19
15
  classifiers = [
20
- "Development Status :: 4 - Beta",
16
+ "Development Status :: 5 - Production/Stable",
21
17
  "Environment :: Console",
22
18
  "Intended Audience :: Developers",
23
19
  "Intended Audience :: System Administrators",
24
20
  "Operating System :: OS Independent",
25
- "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.14",
22
+ "Programming Language :: Python :: 3.15",
26
23
  "Topic :: Internet :: WWW/HTTP",
27
24
  "Topic :: System :: Networking",
28
25
  "Topic :: Terminals",
29
26
  "Topic :: Utilities",
30
27
  ]
28
+ dependencies = [
29
+ "httpx2>=2.12.0,<3",
30
+ "rich>=15.0.0,<16",
31
+ ]
31
32
 
32
33
  [project.urls]
33
34
  Homepage = "https://github.com/Omikorin/speedtest-cli"
@@ -37,16 +38,31 @@ Issues = "https://github.com/Omikorin/speedtest-cli/issues"
37
38
  [project.scripts]
38
39
  speedtest = "speedtest.__main__:main"
39
40
  speedtest-cli = "speedtest.__main__:main"
41
+ speedtest-cli-ng = "speedtest.__main__:main"
40
42
 
41
- # Tool-specific configurations
42
- [tool.setuptools.packages.find]
43
- include = ["speedtest", "speedtest.*"]
43
+ [dependency-groups]
44
+ dev = [
45
+ # Tests
46
+ "pytest>=9.1.1,<10",
47
+ "pytest-cov>=7.1.0,<8",
48
+ # Linting
49
+ "ruff>=0.16.4,<1",
50
+ "ty>=0.0.73,<1",
51
+ ]
52
+
53
+ [tool.hatch.build.targets.sdist]
54
+ exclude = [
55
+ ".github",
56
+ ".python-version",
57
+ "renovate.json5",
58
+ ]
44
59
 
45
- [tool.setuptools.data-files]
46
- "share/man/man1" = ["extras/man/speedtest-cli.1"]
60
+ [tool.hatch.build.targets.wheel]
61
+ packages = ["src/speedtest"]
47
62
 
48
63
  [tool.uv]
49
- required-version = ">=0.11.0"
64
+ required-version = ">=0.13.0"
65
+ exclude-newer = "7 days"
50
66
 
51
67
  [[tool.uv.index]]
52
68
  name = "testpypi"
@@ -55,42 +71,36 @@ publish-url = "https://test.pypi.org/legacy/"
55
71
  explicit = true
56
72
 
57
73
  [tool.ruff]
58
- target-version = "py312"
59
- line-length = 100
74
+ line-length = 120
60
75
  src = ["speedtest", "tests"]
61
76
 
62
77
  [tool.ruff.lint]
63
- select = [
78
+ extend-select = [
79
+ "ANN", # flake8 annotations
80
+ "B", # flake8 bugbear
81
+ "PYI", # flake8 pyi
64
82
  "E", # pycodestyle errors
65
83
  "W", # pycodestyle warnings
66
84
  "F", # pyflakes
67
- "I", # isort (automatically sorts imports)
68
- "UP", # pyupgrade (automatically upgrades syntax to modern Python 3.12 standards)
85
+ "I", # isort
86
+ "N", # pep8 naming
87
+ "UP", # pyupgrade
69
88
  "RUF", # ruff-specific rules
70
89
  ]
90
+ preview = true
71
91
  ignore = []
92
+ unfixable = ["B"]
72
93
 
73
94
  [tool.ruff.format]
74
95
  quote-style = "double"
75
96
  indent-style = "space"
76
97
 
77
- [tool.pyright]
78
- include = ["speedtest", "tests"]
79
- pythonVersion = "3.12"
80
- typeCheckingMode = "standard" # Can be bumped to "strict" once codebase is fully annotated
81
- useLibraryCodeForTypes = true
82
- reportMissingImports = true
98
+ [tool.ty.rules]
99
+ missing-type-argument = "error"
100
+ possibly-unresolved-reference = "warn"
83
101
 
84
102
  [tool.pytest]
85
103
  minversion = "9.0"
86
104
  # Automatically show extra test info, fail if coverage drops, and output a terminal coverage report
87
- addopts = "-v --cov=speedtest --cov-report=term-missing"
105
+ addopts = ["-v", "--cov=speedtest", "--cov-branch", "--cov-report=term-missing"]
88
106
  testpaths = ["tests"]
89
-
90
- [dependency-groups]
91
- dev = [
92
- "pyright>=1.1.400",
93
- "pytest>=9.0.0",
94
- "pytest-cov>=7.0.0",
95
- "ruff>=0.15.0",
96
- ]
@@ -0,0 +1,3 @@
1
+ from .__version__ import __description__, __title__, __version__
2
+
3
+ __all__ = ["__description__", "__title__", "__version__"]
@@ -4,25 +4,22 @@ The main entry point. Invoke as `speedtest-cli` or `python -m speedtest`.
4
4
 
5
5
  import sys
6
6
 
7
- from speedtest.cli.main import shell
8
- from speedtest.exceptions import SpeedtestException
9
- from speedtest.utils.logger import logger
10
- from speedtest.utils.status import ExitStatus
7
+ from speedtest.cli import shell
8
+ from speedtest.exceptions import SpeedtestError
9
+ from speedtest.utils import ExitStatus, logger
11
10
 
12
11
 
13
12
  def main() -> int:
14
13
  """Execute the CLI and return an integer exit status."""
15
14
 
16
15
  try:
17
- exit_status = shell()
18
-
19
- return int(exit_status)
16
+ return shell()
20
17
 
21
18
  except KeyboardInterrupt:
22
19
  logger.error("Stopped by user")
23
20
  return ExitStatus.ERROR_CTRL_C.value
24
21
 
25
- except SpeedtestException as e:
22
+ except SpeedtestError as e:
26
23
  code = getattr(e, "code", ExitStatus.ERROR.value)
27
24
 
28
25
  if code not in (ExitStatus.SUCCESS.value, ExitStatus.ERROR_CTRL_C.value):
@@ -31,10 +28,10 @@ def main() -> int:
31
28
 
32
29
  return int(code)
33
30
 
34
- except Exception as e:
35
- logger.exception("An unexpected error occurred.", e)
31
+ except OSError, RuntimeError, ValueError:
32
+ logger.exception("An unexpected error occurred.")
36
33
  return ExitStatus.ERROR.value
37
34
 
38
35
 
39
- if __name__ == "__main__":
36
+ if __name__ == "__main__": # pragma: no cover
40
37
  sys.exit(main())
@@ -0,0 +1,5 @@
1
+ from importlib.metadata import version
2
+
3
+ __title__ = "speedtest-cli-ng"
4
+ __description__ = "Next generation CLI for testing internet bandwidth using speedtest.net"
5
+ __version__ = version("speedtest-cli-ng")
@@ -0,0 +1,7 @@
1
+ """
2
+ Command-line interface module.
3
+ """
4
+
5
+ from .runner import shell
6
+
7
+ __all__ = ["shell"]