Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow using events on callbacks #355

Merged
merged 1 commit into from
Feb 24, 2023

Conversation

fgmacedo
Copy link
Owner

@fgmacedo fgmacedo commented Feb 22, 2023

Allows the usage of events on callbacks.

    class ChainedSM(StateMachine):
        a = State(initial=True)
        b = State()
        c = State()

        t1 = a.to(b, after="t1") | b.to(c)

Closes: #351

@codecov
Copy link

codecov bot commented Feb 22, 2023

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (37fd275) compared to base (9a64f4b).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff            @@
##           develop      #355   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           18        18           
  Lines          867       894   +27     
  Branches       142       148    +6     
=========================================
+ Hits           867       894   +27     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
statemachine/dispatcher.py 100.00% <100.00%> (ø)
statemachine/event.py 100.00% <100.00%> (ø)
statemachine/event_data.py 100.00% <100.00%> (ø)
statemachine/statemachine.py 100.00% <100.00%> (ø)
statemachine/transition.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@fgmacedo fgmacedo force-pushed the macedo/allow-using-events-on-callbacks branch from 2c82d98 to 6af8bae Compare February 24, 2023 13:33
@fgmacedo
Copy link
Owner Author

Note: This tip saved the day: fastapi/typer#371 (comment)

@fgmacedo fgmacedo marked this pull request as ready for review February 24, 2023 13:56
@fgmacedo fgmacedo force-pushed the macedo/allow-using-events-on-callbacks branch from 6af8bae to 37fd275 Compare February 24, 2023 15:17
@sonarcloud
Copy link

sonarcloud bot commented Feb 24, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@fgmacedo fgmacedo added this to the 2.0.0 milestone Feb 24, 2023
@fgmacedo fgmacedo merged commit 11c6689 into develop Feb 24, 2023
@fgmacedo fgmacedo deleted the macedo/allow-using-events-on-callbacks branch February 24, 2023 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add easy way to chain transitions
1 participant