Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,26 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install coverage
pip install -e ".[tests,lint,typing]"
uv sync --python ${{ matrix.python-version }} --extra tests --extra lint --extra typing
uv pip install coverage
- name: Run linter
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
uv run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# 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
uv run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run type checking
run: |
mypy
uv run mypy
- name: Run tests
run: |
pytest -v --cov=. --cov-report term-missing --cov-report xml --junitxml=junit.xml -o junit_family=legacy
uv run pytest -v --cov=. --cov-report term-missing --cov-report xml --junitxml=junit.xml -o junit_family=legacy
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v5
with:
Expand Down
59 changes: 48 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,45 +124,82 @@ And type username and password when required.
`Base64 <https://en.wikipedia.org/wiki/Base64>`_ method and is not actually
*encrypted*!

Running tests & linting
~~~~~~~~~~~~~~~~~~~~~~~
Running tests
~~~~~~~~~~~~~

Install tests dependencies (`tox <http://tox.readthedocs.org/en/latest/>`_
and `flake8 <https://flake8.readthedocs.org/>`_):
Using uv (recommended)
^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: bash

$ pip install -e ".[tests,lint]"
# Install uv (if not already installed)
$ pipx install uv
# Or see https://docs.astral.sh/uv/getting-started/installation/

# Sync test dependencies
$ uv sync --extra tests

# Run tests with tox
$ uv run tox

Test the code against all supported Python versions and check it against **PEP8** with ``tox``:
Using pip
^^^^^^^^^

Install test dependencies and run tests:

.. code-block:: bash

$ pip install -e ".[tests]"
$ tox

Check **PEP8** only:
Linting
~~~~~~~

Using uv (recommended)
^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: bash

$ tox -e pep8
# Sync linting dependencies
$ uv sync --extra lint

# Run linting with tox
$ uv run tox -e lint

Using pip
^^^^^^^^^

Install linting dependencies and check code style:

.. code-block:: bash

$ pip install -e ".[lint]"
$ tox -e lint

Type checking
~~~~~~~~~~~~~

**noipy** uses type hints to improve code quality and maintainability.

Install type checking dependencies `mypy <https://mypy.readthedocs.io/>`_):
Using uv (recommended)
^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: bash

$ pip install -e ".[typing]"
# Sync type checking dependencies
$ uv sync --extra typing

# Run type checking with mypy
$ uv run mypy noipy/

Using pip
^^^^^^^^^

Run type checking with mypy:
Install type checking dependencies and run mypy:

.. code-block:: bash

$ pip install -e ".[typing]"
$ mypy noipy/


Expand Down
Loading
Loading