~tmk

~tmk/typed-flags

Last active 3 years ago
View more

Recent activity

[PATCH 4/4] Format with black 3 years ago

From Thomas M to ~tmk/typed-flags

---
 tests/test_integration.py | 10 +++-------
 typed_flags/flags.py      |  6 +++---
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/tests/test_integration.py b/tests/test_integration.py
index 1af5702..95fd6d6 100644
--- a/tests/test_integration.py
+++ b/tests/test_integration.py
@@ -85,19 +85,15 @@ class RequiredClassVariableTests(TestCase):

    def test_arg_str_required(self):
        with self.assertRaises(SystemExit):
            self.TypedFlags.parse_args(
[message trimmed]

[PATCH 3/4] Change how the main test works 3 years ago

From Thomas M to ~tmk/typed-flags

---
 tests/test_integration.py | 136 +++++++++++++++++---------------------
 1 file changed, 61 insertions(+), 75 deletions(-)

diff --git a/tests/test_integration.py b/tests/test_integration.py
index 83e6bf3..1af5702 100644
--- a/tests/test_integration.py
+++ b/tests/test_integration.py
@@ -234,88 +234,74 @@ class DefaultClassVariableTests(TestCase):
    def test_set_default_args(self) -> None:
        arg_untyped = "yes"
        arg_str = "goodbye"
        arg_int = "2"
        arg_float = "1e-2"
[message trimmed]

[PATCH 2/4] Change how Optional types work 3 years ago

From Thomas M to ~tmk/typed-flags

---
 tests/test_integration.py    | 18 ++++++++++++++++++
 typed_flags/flags.py         | 16 ++++++++++++----
 typed_flags/special_types.py | 17 ++++++++++++++++-
 3 files changed, 46 insertions(+), 5 deletions(-)

diff --git a/tests/test_integration.py b/tests/test_integration.py
index ae58b8c..83e6bf3 100644
--- a/tests/test_integration.py
+++ b/tests/test_integration.py
@@ -340,6 +340,24 @@ class DefaultClassVariableTests(TestCase):
        self.assertEqual(args.arg_dict_str_int, arg_dict_str_int)
        self.assertEqual(args.arg_positive_int, arg_positive_int)

[message trimmed]

[PATCH 1/4] Handle tabs in yaml files correctly 3 years ago

From Thomas M to ~tmk/typed-flags

---
 typed_flags/flags.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/typed_flags/flags.py b/typed_flags/flags.py
index a0069cb..f6f91b0 100644
--- a/typed_flags/flags.py
+++ b/typed_flags/flags.py
@@ -324,7 +324,7 @@ class TypedFlags(ArgumentParser):
        key, value = arg_line.split(sep=":", maxsplit=1)
        key = key.rstrip()
        value = value.strip()
        if key[0] == " ":
        if key[0] in (" ", "\t"):  # this line is indented
[message trimmed]

[PATCH 0/4] Increase usefullness of the Optional type 3 years ago

From Thomas M to ~tmk/typed-flags

Before, `Optional` could only be used to have None when no flag is
specified. But sometimes you want to set something explicitly to `None`.
Now you can do that by using "null".

Thomas M (4):
  Handle tabs in yaml files correctly
  Change how Optional types work
  Change how the main test works
  Format with black

 tests/test_integration.py    | 164 +++++++++++++++++------------------
 typed_flags/flags.py         |  24 +++--
 typed_flags/special_types.py |  17 +++-
 3 files changed, 114 insertions(+), 91 deletions(-)

[PATCH 3/3] Use PositiveInt from teext and rename types.py 4 years ago

From Thomas M to ~tmk/typed-flags

- it's better to let another library handle constraint types
- the name types.py was too generic; special_types.py is a bit more
  specific
---
 .builds/unittest.yml         |  2 ++
 tests/test_integration.py    |  6 ++++--
 typed_flags/__init__.py      |  2 +-
 typed_flags/flags.py         | 14 ++++++------
 typed_flags/special_types.py | 23 ++++++++++++++++++++
 typed_flags/types.py         | 42 ------------------------------------
 6 files changed, 37 insertions(+), 52 deletions(-)
 create mode 100644 typed_flags/special_types.py
 delete mode 100644 typed_flags/types.py
[message trimmed]

[PATCH 2/3] Fix wrong name in demo.py 4 years ago

From Thomas M to ~tmk/typed-flags

---
 demo.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/demo.py b/demo.py
index cd7663f..b7bff14 100644
--- a/demo.py
+++ b/demo.py
@@ -22,7 +22,7 @@ print(args.hidden_size)  # no autocomplete, no type inference, no source code na
add_one(args.rnn)  # no static type checking


# ----- Tap -----
# ----- TypedFlags -----
[message trimmed]

[PATCH 1/3] Improve linter tooling 4 years ago

From Thomas M to ~tmk/typed-flags

---
 .builds/formatting.yml | 2 +-
 check_all.sh           | 7 +++++++
 pyproject.toml         | 3 +++
 3 files changed, 11 insertions(+), 1 deletion(-)
 create mode 100755 check_all.sh
 create mode 100644 pyproject.toml

diff --git a/.builds/formatting.yml b/.builds/formatting.yml
index 88a634a..8000389 100644
--- a/.builds/formatting.yml
+++ b/.builds/formatting.yml
@@ -10,4 +10,4 @@ tasks:
      python -m pip install black
[message trimmed]

[PATCH 0/3] Various improvements 4 years ago

From Thomas M to ~tmk/typed-flags

Mostly, PositiveInt has been moved to an extern library. Other, smaller
things have been improved as well.

Thomas M (3):
  Improve linter tooling
  Fix wrong name in demo.py
  Use PositiveInt from teext and rename types.py

 .builds/formatting.yml       |  2 +-
 .builds/unittest.yml         |  2 ++
 check_all.sh                 |  7 ++++++
 demo.py                      |  2 +-
 pyproject.toml               |  3 +++
 tests/test_integration.py    |  6 ++++--

[ANNOUNCEMENT] Version 0.1.2 has been released 4 years ago

From Thomas M to ~tmk/typed-flags

Hi all,

release notes can be found here: https://git.sr.ht/~tmk/typed-flags/refs/v0.1.2 .

Best,
Thomas