Skip to content

Commit

Permalink
bump: version 7.0.1 → 7.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
denisrosset committed Mar 15, 2022
1 parent cc890a4 commit a22b92e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v7.0.2 (2022-03-16)

### Fix

- **config**: let argparse handle positional arguments for help display

## v7.0.1 (2022-03-15)

### Fix
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "MIT"
name = "configpile"
readme = "README.rst"
repository = "https://github.com/denisrosset/configpile.git"
version = "7.0.1"
version = "7.0.2"

[tool.poetry.dependencies]
class-doc = "^0.2.6"
Expand Down Expand Up @@ -107,7 +107,7 @@ style = [
]
tag_format = "v$major.$minor.$patch$prerelease"
update_changelog_on_bump = true
version = "7.0.1"
version = "7.0.2"
version_files = [
"src/configpile/__init__.py:version",
"pyproject.toml:version",
Expand Down
2 changes: 1 addition & 1 deletion src/configpile/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "7.0.1"
__version__ = "7.0.2"

from .arg import AutoName, Expander, Param, Positional
from .config import Config
Expand Down
12 changes: 11 additions & 1 deletion tests/test_positional.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from typing_extensions import Annotated

from configpile import Config, Param, Positional, types
from configpile.arg import AutoName


@dataclass(frozen=True)
Expand All @@ -19,11 +20,20 @@ class WithPositional(Config):

strings: Annotated[
Sequence[str],
Param.append(types.word.as_sequence_of_one(), positional=Positional.ONE_OR_MORE),
Param.append(
types.word.as_sequence_of_one(),
positional=Positional.ONE_OR_MORE,
long_flag_name=AutoName.FORBIDDEN,
short_flag_name=None,
),
]


def test_positional() -> None:
res = WithPositional.from_command_line_(args=["--a", "2", "beautiful", "life"], env={})
assert res.a == 2
assert res.strings == ["beautiful", "life"]


def test_argparse() -> None:
res = WithPositional.processor_().argument_parser

0 comments on commit a22b92e

Please sign in to comment.