Skip to content

Releases: treykeown/arguably

v1.3.0 - Add 3.12, drop 3.8, fixes

10 May 01:08
Compare
Choose a tag to compare
  • Add support for Python 3.12
  • Drop support for Python 3.8
  • Remove dependency on typing_extensions
  • Update dependencies
  • Fix missing factory argument in subtype()
  • Fix asyncio.get_event_loop() deprecation warning

Full Changelog: v1.2.5...v1.3.0

v1.2.5 - More flexible [-o/--option] config

29 Jun 11:09
Compare
Choose a tag to compare

--options are now able to be configured four different ways:

  • [-o]-o is the short name
  • [--option]--option is the long name
  • [-o/--option]-o is the short name, --option is the long name (this can also be [--option/-o])
  • [-o/]-o is the short name, the default long name is removed.

Additionally, there are now warnings if this sort of format is incorrectly specified.

Full Changelog: v1.2.4...v1.2.5

v1.2.4 - Fix logging for command function calls

23 Jun 09:24
Compare
Choose a tag to compare

In addition to argparse-related calls, function invocations for @arguably.command are now also logged. This can be seen if using python3 -m arguably --debug your_script.py, or if you set up logging in your script that utilizes arguably.

This was intended behavior from the start, but was not implemented.

Full Changelog: v1.2.3...v1.2.4

v1.2.3 - Override option name

20 Jun 11:09
Compare
Choose a tag to compare

Allows long option names to be overriden - instead of writing the docstring as some_arg: [-s], write it as some_arg: [-s/--long-name]

Full Changelog: v1.2.2...v1.2.3

v1.2.2 - Fail faster on bad configs

19 Jun 12:56
Compare
Choose a tag to compare

arguably will now fail much faster if a bad configuration is given to @arguably.command. The validation logic was shifted around to fix some cases that caused arguably to fail if invoked directly on a script via python3 -m arguably your_script.py.

Full Changelog: v1.2.1...v1.2.2

v1.2.1 - Async support

18 Jun 21:45
Compare
Choose a tag to compare

This release adds support for decorating async functions with @arguably.command.

Full Changelog: v1.2.0...v1.2.1

v1.2.0 - Public Release

16 Jun 21:29
Compare
Choose a tag to compare
1.2.0 Release

v1.1.0 - Ability to run arbitrary files, added warnings, added debug logging

09 Jun 14:57
Compare
Choose a tag to compare

Files can now be run without any integration with arguably. Simply call it like this: python3 -m arguably file_to_run.py. You'll get a help message with all callable functions. This includes staticmethods and classmethods for classes in the file. As an example:

# test_script.py
def test(name: str, age: int) -> None:
    """
    just a test
    :param name: the name
    :param age: the age
    """
    print(f"name: {name}, age+1: {age + 1}")


class Foo:
    def __init__(self, bar: int):
        """
        foo!
        :param bar: bar!
        """
        print(f"{type(self).__name__} initialized with {bar}")
    
    @staticmethod
    def sm(name: str) -> None:
        """
        staticmethod test func
        :param name: the name
        """
        print(f"{name}")

    @classmethod
    def cm(cls, name: str = "testname") -> None:
        """classmethod test func"""
        print(f"{cls}, {name}")

    def normal(self, foo: int) -> None:
        """a normal method, should not appear"""
        print(f"{self}, foo+1: {foo+1}")

Run it like this:

user@machine:~$ python3 -m arguably test_script.py
usage: test_script [-h] command ...

positional arguments:
  command
    test      just a test
    foo       foo!
    foo.sm    staticmethod test func
    foo.cm    classmethod test func

options:
  -h, --help  show this help message and exit

v1.0.2 - Python 3.8 support, tests with nox

08 Jun 13:05
Compare
Choose a tag to compare

v1.0.1

07 Jun 14:36
Compare
Choose a tag to compare

Version number bumped to fix PyPI readme.