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
23 changes: 14 additions & 9 deletions .github/ISSUE_TEMPLATE/1-bug.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Bug report
about: Create a report to help us improve
about: Report for something that doesn't work as expected
title: ''
labels: bug
assignees: ''
Expand All @@ -16,19 +16,24 @@ assignees: ''

<!--
Please include a code snippet that reproduces the bug and the output that
running it gives. The following snippet templates might help:
running it gives. The following snippet templates might help. Replace "..." with
actual implementation details.

1. Using the CLI function
1. Using the auto_cli function

```python
from jsonargparse import CLI
from jsonargparse import auto_cli

# Here define one or more functions or classes
def func1(param1: int, ...):
...

# Run the CLI providing the components
CLI([func1, ...], exit_on_error=False)
# Run the CLI providing the components and arguments
auto_cli(
[func1, ...],
args=["--param1=value1", ...],
exit_on_error=False,
)
```

2. Manually constructing a parser
Expand All @@ -39,11 +44,11 @@ from jsonargparse import ArgumentParser
parser = ArgumentParser(exit_on_error=False)
# Here add to the parser only argument(s) relevant to the problem

# If a yaml config is required, it can be included in the same snippet as follows:
import yaml
# If a config is required, it can be included in the same snippet as follows:
import json

parser.add_argument("--config", action="config")
config = yaml.safe_dump(
config = json.dumps(
{
"key1": "val1",
}
Expand Down
94 changes: 94 additions & 0 deletions .github/ISSUE_TEMPLATE/2-regression.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
name: Regression report
about: Report for something that used to work but doesn't anymore
title: ''
labels: bug
assignees: ''
---

<!-- If you like this project, please ⭐ star it https://github.com/omni-us/jsonargparse/ -->

## 🕰️ Regression report

<!-- A clear and concise description of the regression. -->

### To reproduce

<!--
Please include a code snippet that reproduces the regression. Make sure that it
is a script that can be used to run git bisect. This means that when code works
correctly, the script terminates with zero exit code. When it fails an exception
is raised. The following snippet templates might help. Replace "..." with actual
implementation details.

1. a) Using the auto_cli function

```python
#!/usr/bin/env python3

from jsonargparse import auto_cli

# Here define one or more functions or classes
def func1(param1: int, ...):
...

# Run the CLI providing the components and arguments
auto_cli(
[func1, ...],
args=["--param1=value1", ...],
exit_on_error=False,
)
```

1. b) Manually constructing a parser

```python
#!/usr/bin/env python3

from jsonargparse import ArgumentParser

parser = ArgumentParser(exit_on_error=False)
# Here add to the parser only argument(s) relevant to the problem

# If a config is required, it can be included in the same snippet as follows:
import json

parser.add_argument("--config", action="config")
config = json.dumps(
{
"key1": "val1",
}
)

# If the problem is when parsing arguments
result = parser.parse_args([f"--config={config}", "--key2=val2", ...])

# If the problem is in class instantiation
parser.instantiate_classes(result)
```

2. Preferably, run git bisect and include in the report the git commit hash that
caused the regression. This would be like:

```
chmod +x regression.py # make script executable
pip3 install -e . # install as editable
git bisect start
git bisect bad <version-tag-latest>
git bisect good <version-tag-known-good>
git bisect run ./regression.py
```
-->

### Prior behavior

<!-- Please describe the prior behavior in detail, and contrast it with the behavior you are currently observing. -->

### Environment

<!-- Fill in the list below. -->

- jsonargparse version:
- Python version:
- How jsonargparse was installed:
- OS:
File renamed without changes.