Skip to content
Merged
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
20 changes: 0 additions & 20 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,26 +111,6 @@ repos:
pass_filenames: false
verbose: true

- id: test-without-future-annotations
name: test-without-future-annotations
entry: bash -c '
set -e;
if [ $(pip3 list 2>/dev/null | grep -F "$(pwd)" | grep -c ^jsonargparse) = 0 ]; then
echo "$(tput setaf 6) Skipped, jsonargparse not installed as editable $(tput sgr0)";
else
TEST_DIR=$(mktemp -d -t _jsonargparse_tests_XXXXXX);
cleanup () { rm -rf "$TEST_DIR"; };
trap cleanup EXIT;
cp jsonargparse_tests/*.py "$TEST_DIR";
cd "$TEST_DIR";
sed -i -e "/^from __future__ import annotations$/d" *.py;
pytest $TEST_DIR;
fi'
stages: [pre-push]
language: system
pass_filenames: false
verbose: true

- id: doctest
name: sphinx-build -M doctest sphinx sphinx/_build sphinx/index.rst
entry: bash -c '
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Fixed
<https://github.com/omni-us/jsonargparse/pull/746>`__).
- Introspection of postponed annotations from jax not working (`#749
<https://github.com/omni-us/jsonargparse/pull/749>`__).
- ``without-future-annotations`` test not included in local coverage (`#751
<https://github.com/omni-us/jsonargparse/pull/751>`__).


v4.40.1 (2025-07-24)
Expand Down
16 changes: 15 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ Villegas = "Villegas"
[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py{38,39,310,311,312,313}-{all,no}-extras,omegaconf,pydantic-v1,without-pyyaml
envlist = py{38,39,310,311,312,313}-{all,no}-extras,omegaconf,pydantic-v1,without-pyyaml,without-future-annotations
skip_missing_interpreters = true

[testenv]
Expand Down Expand Up @@ -238,4 +238,18 @@ extras = test,coverage,all
commands =
pip uninstall -y argcomplete omegaconf pyyaml reconplogger responses ruyaml types-PyYAML
python -m pytest {posargs}

[testenv:without-future-annotations]
extras = test,coverage,all
allowlist_externals = sh
commands =
sh -c "\
rm -rf /tmp/_without_future_annotations; \
mkdir /tmp/_without_future_annotations; \
cp *.py /tmp/_without_future_annotations; \
sed -i -e '/^from __future__ import annotations$/d' /tmp/_without_future_annotations/*.py; \
"
python -m pytest /tmp/_without_future_annotations {posargs}
commands_post =
sh -c "rm -rf /tmp/_without_future_annotations"
"""