Skip to content

Commit 8d0a177

Browse files
committed
Merge dev into main: all tests passing, clean build, .gitignore updated
2 parents 79ccb5d + 954bb15 commit 8d0a177

20 files changed

+1421
-433
lines changed

.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# Byte-compiled / optimized / DLL files
22
__pycache__/
3+
**/__pycache__/
34
*.py[cod]
45
*$py.class
6+
*.pyc
7+
*.pyo
8+
*.pyd
59

610
# C extensions
711
*.so
@@ -160,3 +164,33 @@ cython_debug/
160164
# and can be added to the global gitignore or merged into this file. For a more nuclear
161165
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
162166
.idea/
167+
168+
# macOS system files
169+
.DS_Store
170+
171+
# Project-specific files
172+
.pylintrc
173+
test_history.json
174+
175+
# VSCode and JetBrains IDEs
176+
.vscode/
177+
178+
# Local virtual environments
179+
.venv/
180+
.venv_tmp/
181+
venv/
182+
env/
183+
ENV/
184+
185+
# PyInstaller and build
186+
build/
187+
dist/
188+
*.spec
189+
190+
# Jupyter and IPython
191+
.ipynb_checkpoints/
192+
profile_default/
193+
194+
# Coverage and test cache
195+
.pytest_cache/
196+
.mypy_cache/

.pylintrc

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,59 @@
1+
[MASTER]
2+
# Python version to use for features
3+
py-version=3.8
4+
5+
# Specify a score threshold to be exceeded before program exits with error.
6+
fail-under=7.0
7+
18
[MESSAGES CONTROL]
2-
disable=C0114, W0718, W0613, E0401, E1101
9+
# Disable the following pylint messages
10+
disable=
11+
C0114, # missing-module-docstring
12+
C0115, # missing-class-docstring
13+
C0116, # missing-function-docstring
14+
W0718, # broad-exception-caught
15+
W0613, # unused-argument
16+
E0401, # import-error
17+
E1101, # no-member
18+
R0903, # too-few-public-methods
19+
R0914, # too-many-locals
20+
R0913, # too-many-arguments
21+
R0915, # too-many-statements
22+
W0703, # broad-except
23+
24+
[FORMAT]
25+
# Maximum number of characters on a single line.
26+
max-line-length=100
27+
28+
[DESIGN]
29+
# Maximum number of arguments for function / method
30+
max-args=8
31+
32+
# Minimum number of public methods for a class
33+
min-public-methods=1
34+
35+
# Maximum number of public methods for a class
36+
max-public-methods=20
37+
38+
[SIMILARITIES]
39+
# Minimum lines number of a similarity.
40+
min-similarity-lines=6
41+
42+
# Ignore imports when computing similarities.
43+
ignore-imports=yes
44+
45+
[TYPECHECK]
46+
# List of module names for which member attributes should not be checked
47+
ignored-modules=
48+
matplotlib,
49+
tkinter
50+
51+
[REPORTS]
52+
# Set the output format.
53+
output-format=text
54+
55+
# Tells whether to display a full report or only the messages
56+
reports=yes
57+
58+
# Python expression which should return a note less than 10
59+
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)

README.md

Lines changed: 82 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,115 @@
1+
### On development stage.
12
## Documentation for macOS_application_speedtest_for_python
23

34
### Project Description
4-
`macOS_application_speedtest_for_python` is a macOS application designed to test your internet connection
5-
speed using Python. The program provides a convenient interface for measuring download, upload, and ping speeds,
6-
and also supports retesting and viewing test history.
7-
The project is built based on another one of my applications, which you can check out on GitHub:
8-
[Internet Speed Test](https://github.com/AlexTkDev/different_mini-apps/tree/main/check_internrt_speed)
5+
`macOS_application_speedtest_for_python` is a modern macOS application for testing your internet connection speed using Python. The app features a beautiful dark UI (ttkbootstrap), asynchronous and thread-based architecture for maximum responsiveness, and advanced UX with toast notifications and smooth progress animations.
6+
7+
### What's New in Version 4.0.0
8+
- Fully asynchronous and thread-based architecture: all heavy operations (speedtest, network info, plotting) run in background threads.
9+
- Modern, dark, and airy UI using ttkbootstrap.
10+
- Toast notifications for test completion and errors.
11+
- Smooth progress bar animations and non-blocking interface.
12+
- Improved error handling and logging.
13+
- Refactored codebase: all comments and docstrings in English, modular structure.
14+
- Enhanced test history and export features.
15+
- More robust PyInstaller build and troubleshooting section.
916

1017
### Installation
1118

1219
#### System Requirements
1320
- macOS (version 10.14 or later)
14-
- Python 3.6 or higher
15-
- Installed dependencies listed in `requirements.txt`
21+
- Python 3.8 or higher (with Tkinter support)
22+
- All dependencies from `requirements.txt`
1623

1724
#### Installing Dependencies
18-
To install the dependencies, execute the following commands:
19-
2025
```bash
2126
# Clone repository
2227
git clone https://github.com/AlexTkDev/macOS_application_speedtest_for_python.git
23-
# Create a virtual environment (recommended)
24-
python -m venv .venv
28+
cd macOS_application_speedtest_for_python
29+
python3 -m venv .venv
2530
source .venv/bin/activate
26-
# Install dependencies
2731
pip install -r requirements.txt
2832
```
2933

3034
### Usage
31-
After installation, you can run the application by executing:
35+
Run the application:
3236
```bash
33-
python alexs_speedtest.py
37+
python main.py
3438
```
35-
36-
#### Features
37-
- **Internet Speed Measurement**: The app allows you to test download and upload speeds, as well as ping (latency) of your internet connection.
38-
- **Graphical Display**: After completing a test, users can view the test results and optionally plot the test history.
39-
- **Repeat Test**: After a test is completed, users can repeat the test without needing to restart the application.
40-
- **Test History**: The app saves the results of previous tests, allowing users to view the test history and visualize changes in speed.
41-
42-
#### Key Components
43-
- **Tkinter**: Used for creating the graphical user interface (GUI), which includes buttons for starting tests, viewing results, and plotting graphs.
44-
- **Speedtest-cli**: A library for performing internet speed tests, which powers the app's functionality.
45-
- **Matplotlib**: A library for visualizing the test history by plotting graphs.
46-
- **JSON**: A library for reading and writing test results stored in JSON format.
47-
48-
#### How It Works
49-
1. When the app is launched, users can click the **"Start Speed Test"** button to initiate the test.
50-
2. The app runs a speed test using the **speedtest-cli** library, measuring download speed, upload speed, and ping.
51-
3. Once the test is completed, the results are displayed in the app's interface.
52-
4. Users can save the test results to the **history.json** file and visualize the data using **matplotlib**.
53-
5. For a repeat test, users can simply click the **"Repeat Speed Test"** button, which hides the history buttons until the new test is finished.
54-
55-
56-
#### Building the Application
57-
To build the application in `.app` format, run the following command:
39+
Or build the .app:
5840
```bash
5941
pyinstaller main.spec
42+
open dist/Alex_SpeedTest.app
6043
```
61-
After building, the application will be located in the `dist` directory, and you can launch it by double-clicking the icon.
62-
63-
### Configuration
64-
The project include a `alexs_speedtest.py` file, where you can find settings such as
65-
parameters for speed testing. Feel free to modify these parameters according to your needs.
6644

67-
### License
68-
This project is licensed under the MIT License. Please refer to the `LICENSE` file for more detailed information.
45+
#### Features
46+
- **Asynchronous Speed Test**: Download, upload, and ping tests run in a background thread.
47+
- **Modern Dark UI**: Built with ttkbootstrap for a beautiful, modern look.
48+
- **Toast Notifications**: Non-blocking popups for test completion and errors.
49+
- **Network Adapter Info**: Asynchronously fetches and displays active network adapter details.
50+
- **Interactive History & Graphs**: View and export your test history, plot interactive graphs.
51+
- **Export to CSV**: Export your test history for further analysis.
52+
- **Logging**: All actions are logged for troubleshooting.
53+
54+
#### Project Structure
55+
```
56+
macOS_application_speedtest_for_python/
57+
├── speedtest_app/ # Main package
58+
│ ├── __init__.py # Package initialization
59+
│ ├── alexs_speedtest.py # Main application module (async, threads)
60+
│ ├── network_adapter_information.py # Async network info
61+
│ ├── test_history.py # Async history and plotting
62+
│ ├── gui/ # GUI components (ttkbootstrap)
63+
│ │ └── __init__.py
64+
│ ├── utils/ # Utility functions
65+
│ │ └── __init__.py
66+
│ └── tests/ # Unit tests
67+
│ ├── __init__.py
68+
│ ├── test_network_adapter.py
69+
│ └── test_test_history.py
70+
├── main.py # Entry point
71+
├── main.spec # PyInstaller config
72+
├── requirements.txt # Dependencies
73+
├── setup.py # Installation script
74+
├── README.md # This documentation
75+
```
6976

70-
### Code Analysis with Pylint
71-
This project uses **Pylint** for static code analysis to ensure that code adheres to Python's
72-
best practices and follows PEP 8 style guidelines. Pylint checks for errors, potential issues,
73-
and enforces consistent coding style, making it a valuable tool for maintaining code quality.
77+
### How It Works
78+
1. Click **Start Speed Test** to run a speed test in a background thread.
79+
2. The app finds the best server, runs the test, and updates the UI with smooth progress.
80+
3. Results are shown instantly; you can repeat the test, view/export history, or plot interactive graphs.
81+
4. All network info and history operations are also asynchronous.
82+
5. Toast notifications inform you of completion or errors.
7483

75-
### How to Install Pylint
76-
To install Pylint, use the following command in your terminal:
84+
### Building the Application
85+
To build the application in `.app` format:
7786
```bash
78-
pip install pylint
79-
```
80-
### Running Pylint
81-
Once installed, you can run Pylint on a specific Python file with:
82-
```bash
83-
pylint your_file.py
87+
pyinstaller main.spec
8488
```
85-
Or, to analyze all Python files in the project, run:
89+
The `.app` will appear in the `dist` directory.
90+
91+
#### Troubleshooting PyInstaller/macOS
92+
- If the app does not open, run the binary from terminal to see errors:
93+
```bash
94+
dist/Alex_SpeedTest.app/Contents/MacOS/alexs_speedtest
95+
```
96+
- If you see `ModuleNotFoundError: No module named '_tkinter'`, ensure your Python has Tkinter support and rebuild the venv.
97+
- If macOS blocks the app, run:
98+
```bash
99+
xattr -dr com.apple.quarantine dist/Alex_SpeedTest.app
100+
```
101+
- For other issues, check the log file in `~/Documents/SpeedTest_Logs/speedtest_log.log`.
102+
103+
### Running Tests
86104
```bash
87-
pylint *.py
105+
python -m unittest discover
88106
```
89-
This setup is also configured to run automatically within GitHub Actions on every code push,
90-
checking the code with multiple Python versions for compatibility.
91-
107+
108+
### License
109+
MIT License. See `LICENSE` for details.
110+
92111
### Contribution
93-
If you would like to contribute to the project, please create a fork of the repository and submit a Pull Request with your changes.
112+
Pull requests are welcome! See CONTRIBUTING section in the old README for workflow.
94113

95114
### Contact
96-
For questions or suggestions, you can reach out to me via [GitHub](https://github.com/AlexTkDev).
97-
115+
For questions or suggestions, reach out via [GitHub](https://github.com/AlexTkDev).

0 commit comments

Comments
 (0)