Skip to content

Commit

Permalink
version 4.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolargo committed May 18, 2024
2 parents fecd23b + 1183b4d commit 5d88280
Show file tree
Hide file tree
Showing 144 changed files with 2,963 additions and 3,258 deletions.
2 changes: 0 additions & 2 deletions .bandit

This file was deleted.

8 changes: 0 additions & 8 deletions .flake8

This file was deleted.

97 changes: 54 additions & 43 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,32 @@ on:

jobs:

source-code-checks:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: Check formatting with Ruff
uses: chartboost/ruff-action@v1
with:
args: 'format --check'

- name: Check linting with Ruff
uses: chartboost/ruff-action@v1
with:
args: 'check'

- name: Static type check
run: |
echo "Skipping static type check for the moment, too much error...";
# pip install pyright
# pyright glances
test-linux:

needs: source-code-checks
# https://github.com/actions/runner-images?tab=readme-ov-file#available-images
runs-on: ubuntu-22.04
strategy:
Expand All @@ -17,36 +41,22 @@ jobs:

steps:

- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# Stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=.git,./docs,./glances/outputs/static
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=.git,./docs,./glances/outputs/static
- name: Static type check
run: |
echo "Skipping static type check for the moment, too much error...";
# pip install pyright
# pyright glances
- name: Unitary tests
run: |
python ./unittest-core.py
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Unitary tests
run: |
python ./unittest-core.py
# Error appear with h11, not related to Glances
# Should be tested if correction is done
Expand Down Expand Up @@ -84,6 +94,7 @@ jobs:

test-macos:

needs: source-code-checks
# https://github.com/actions/runner-images?tab=readme-ov-file#available-images
runs-on: macos-14
strategy:
Expand All @@ -92,22 +103,22 @@ jobs:

steps:

- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Unitary tests
run: |
python ./unittest-core.py
- name: Unitary tests
run: |
python ./unittest-core.py
# Error when trying to implement #2749
# pkg: No packages available to install matching 'py-pip' have been found in the repositories
Expand Down
22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-ast
- id: check-docstring-first
- id: check-json
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: detect-private-key
- id: mixed-line-ending
- id: requirements-txt-fixer

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.4
hooks:
- id: ruff-format
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
4 changes: 4 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,7 @@ http://www.macports.org/ports.php?by=name&substr=glances

John Kirkham for the conda package (at conda-forge)
https://github.com/conda-forge/glances-feedstock

Rui Chen for the Homebrew package
https://chenrui.dev/
https://formulae.brew.sh/formula/glances
9 changes: 3 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ the developers managing and developing this open source project. In return,
they should reciprocate that respect in addressing your issue or assessing
patches and features.


## Using the issue tracker

The [issue tracker](https://github.com/nicolargo/glances/issues) is
Expand All @@ -24,7 +23,6 @@ restrictions:
* Please **do not** derail or troll issues. Keep the discussion on topic and
respect the opinions of others.


## Bug reports

A bug is a _demonstrable problem_ that is caused by the code in the repository.
Expand Down Expand Up @@ -65,19 +63,17 @@ Example:
> causing the bug, and potential solutions (and your opinions on their
> merits).
>
> You can also run Glances in debug mode (-d) and paste/bin the glances.conf file (https://glances.readthedocs.io/en/latest/config.html).
> You can also run Glances in debug mode (-d) and paste/bin the glances.conf file (<https://glances.readthedocs.io/en/latest/config.html>).
>
> Glances 3.2.0 or higher have also a --issue option to run a simple test. Please use it and copy/paste the output.

## Feature requests

Feature requests are welcome. But take a moment to find out whether your idea
fits with the scope and aims of the project. It's up to *you* to make a strong
fits with the scope and aims of the project. It's up to _you* to make a strong
case to convince the project's developers of the merits of this feature. Please
provide as much detail and context as possible.


## Pull requests

Good pull requests—patches, improvements, new features—are a fantastic
Expand Down Expand Up @@ -133,6 +129,7 @@ included in the project:

5. Test you code using the Makefile:

* make format ==> Format your code thanks to the Ruff linter
* make run ==> Run Glances
* make run-webserver ==> Run a Glances Web Server
* make test ==> Run unit tests
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ include CONTRIBUTING.md
include COPYING
include NEWS.rst
include README.rst
include SECURITY.md
include conf/glances.conf
include requirements.txt
recursive-include docs *
recursive-include glances *.py
recursive-include glances/outputs/static *
12 changes: 4 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ venv-dev-python: ## Install Python 3 venv
venv-dev: venv-python ## Install Python 3 dev dependencies
./venv-dev/bin/pip install -r dev-requirements.txt
./venv-dev/bin/pip install -r doc-requirements.txt
./venv-dev/bin/pre-commit install --hook-type pre-commit

venv-dev-upgrade: ## Upgrade Python 3 dev dependencies
./venv-dev/bin/pip install --upgrade pip
Expand Down Expand Up @@ -86,15 +87,10 @@ test-min-with-upgrade: venv-min-upgrade ## Upgrade deps and run unit tests in mi
# ===================================================================

format: ## Format the code
@git ls-files 'glances/*.py' | xargs ./venv-dev/bin/python -m autopep8 --in-place --jobs 0 --global-config=.flake8
@git ls-files 'glances/*.py' | xargs ./venv-dev/bin/python -m autoflake --in-place --remove-all-unused-imports --remove-unused-variables --remove-duplicate-keys --exclude="compat.py,globals.py"
./venv-dev/bin/python -m black ./glances --exclude outputs/static
./venv-dev/bin/python -m ruff format .

flake8: ## Run flake8 linter.
@git ls-files 'glances/ *.py' | xargs ./venv-dev/bin/python -m flake8 --config=.flake8

ruff: ## Run Ruff (fastest) linter.
./venv-dev/bin/python -m ruff check . --config=./pyproject.toml
lint: ## Lint the code.
./venv-dev/bin/python -m ruff check . --fix

codespell: ## Run codespell to fix common misspellings in text files
./venv-dev/bin/codespell -S .git,./docs/_build,./Glances.egg-info,./venv*,./glances/outputs,*.svg -L hart,bu,te,statics
Expand Down
15 changes: 9 additions & 6 deletions NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,28 @@
==============================================================================

===============
Version 4.1.0
Version 4.0.5
===============

Under development, see roadmap here: https://github.com/nicolargo/glances/milestone/68
* SensorType change in REST API breaks compatibility in 4.0.4 #2788
* Please make pydantic optional dependency, not required one #2777
* Update the Grafana dashboard #2780
* 4.0.4 - On Glances startup "ERROR -- Can not init battery class #2776
* In codeSpace (with Python 3.8), an error occurs in ./unittest-restful.py #2773

Contributors are welcome !
Use Ruff as default Linter.

===============
Version 4.0.4
===============

Hostfix release for support sensors plugin on python3.8
Hostfix release for support sensors plugin on python 3.8

===============
Version 4.0.3
===============

Additional fixes for Sensor plugin.

Additional fixes for Sensor plugin

===============
Version 4.0.2
Expand Down
1 change: 0 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ Requirements
- ``defusedxml`` (in order to monkey patch xmlrpc)
- ``packaging`` (for the version comparison)
- ``ujson`` (an optimized alternative to the standard json module)
- ``pydantic`` (for the data validation support)

*Note for Python 2 users*

Expand Down

0 comments on commit 5d88280

Please sign in to comment.