Skip to content

v3.2.0

Choose a tag to compare

@BrianPugh BrianPugh released this 14 Jan 14:24
44b2a54

Features

  • Allow Parameter to be used as a decorator. by @BrianPugh in #295
    from cyclopts import App, Parameter
    from dataclasses import dataclass
    
    app = App(name="movie-maintainer")
    
    @Parameter(name="*")
    @dataclass
    class Movie:
       title: str
       year: int
    
    @app.command
    def add(movie: Movie):
       print(f"Adding movie: {movie}")
    
    app()
    See docs example for more information.

Internal

  • To allow the @Parameter decorator, we Introduce a hidden __cyclopts__ attribute that gets attached to decorated objects. Currently only created/used when @Parameter is used.

Full Changelog: v3.1.5...v3.2.0