Skip to content

Development environment improvements and clarifications #688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 10, 2025
Merged
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
- Update contribution guidelines.
- Added default python version for pre-commit.
- Don't test python 3.8 in mac and windows.
  • Loading branch information
mauvilsa committed Mar 6, 2025
commit 68567c22525bdd3f3577f8cf27df907499350645
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: [3.8, 3.9, "3.10", 3.11, 3.12, 3.13]
python: [3.9, "3.10", 3.11, 3.12, 3.13]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
@@ -73,7 +73,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: [3.8, "3.10", 3.12]
python: ["3.10", 3.12]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
6 changes: 4 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
fail_fast: true
default_install_hook_types: [pre-commit, pre-push]
default_language_version:
python: python3.12

ci:
skip:
@@ -29,7 +31,7 @@ repos:
- id: black

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.6
rev: v0.9.9
hooks:
- id: ruff
args: ["--fix"]
@@ -40,7 +42,7 @@ repos:
- id: yesqa

- repo: https://github.com/crate-ci/typos
rev: v1.29.5
rev: v1.30.1
hooks:
- id: typos
args: []
22 changes: 15 additions & 7 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -59,14 +59,18 @@ is done as follows:

.. note::

The ``.pre-commit-config.yaml`` file was changed such that some hooks are
now run on ``pre-push``. If you have an old development environment, please
run ``pre-commit install`` again to update the git hooks.
``.pre-commit-config.yaml`` is configured to run the hooks using python
3.12. Thus, you need to have python 3.12 installed for pre-commit to work.

The ``pre-push`` stage runs several hooks (tests, doctests, mypy, coverage) that
take some time. These are intended to let developers know problems which must be
resolved for any pull request to be considered for merging. If you wish to push
without running these hooks, use the command ``git push --no-verify``.
take some time. These hooks are intended to inform developers of issues that
must be resolved before any pull request can be considered for merging. If you
wish to push without running these hooks, use the command ``git push
--no-verify``.

Formatting of the code is done automatically by pre-commit. If some pre-commit
hooks fail and you decide to skip them, the formatting will be automatically
applied by a github action in pull requests.

Documentation
-------------
@@ -86,7 +90,8 @@ Tests
Running the unit tests can be done either using using `pytest
<https://docs.pytest.org/>`__ or `tox
<https://tox.readthedocs.io/en/stable/>`__. The tests are also installed with
the package, thus can be run in a production system.
the package, thus can be run in a production system. Also pre-commit runs some
additional tests.

.. code-block:: bash

@@ -96,6 +101,9 @@ the package, thus can be run in a production system.
python -m jsonargparse_tests # Run tests on installed package (requires pytest and pytest-subtests)
pre-commit run -a --hook-stage pre-push # Run pre-push git hooks (tests, doctests, mypy, coverage)

Coverage
--------

For a nice html test coverage report, run:

.. code-block:: bash