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

Updates example/layout.py to use Splitter class #1142

Merged

Conversation

apoclyps
Copy link
Contributor

@apoclyps apoclyps commented Mar 29, 2021

Type of changes

  • Bug fix
  • New feature
  • Documentation / docstrings
  • Tests
  • Other

Checklist

  • I've run the latest black with default args on new code.
  • I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • I've added tests for new code.
  • I accept that @willmcgugan may be pedantic in the code review.

Description

Resolves a TypeError when running examples/layout.py using rich=10.0.0.

What's Changed

Whilst upgrading from 9.13.0 to 10.0.0 within my application I encountered a breaking changed related to direction being removed and replaced with the new Splitter class as outlined in the changelog.

Upon inspecting the source and running the example I noticed it had not been updated to reflect the latest changes.

This PR removes the unused Direction literal and updates example/layout.py to use split_row instead of direction="horizontal" to help others quickly identify the necessary change.

Steps to reproduce

Run examples/layout.py using rich==10.0.0 to produce the following TypeError:

Traceback (most recent call last):
  File "/home/host/workspace/apoclyps/rich/examples/layout.py", line 26, in <module>
    layout["main"].split(
TypeError: split() got an unexpected keyword argument 'direction'

@apoclyps apoclyps force-pushed the layout-example-using-splitter branch from fd74499 to f24b668 Compare March 29, 2021 21:36
@codecov
Copy link

codecov bot commented Mar 29, 2021

Codecov Report

Merging #1142 (f24b668) into master (34c5620) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1142      +/-   ##
==========================================
- Coverage   99.84%   99.84%   -0.01%     
==========================================
  Files          69       69              
  Lines        6323     6322       -1     
==========================================
- Hits         6313     6312       -1     
  Misses         10       10              
Flag Coverage Δ
unittests 99.84% <100.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
rich/layout.py 100.00% <ø> (ø)
rich/segment.py 100.00% <ø> (ø)
rich/constrain.py 100.00% <100.00%> (ø)
rich/repr.py 100.00% <100.00%> (ø)
rich/theme.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 57736f4...f24b668. Read the comment docs.

@willmcgugan
Copy link
Collaborator

Great. Thanks.

@willmcgugan willmcgugan merged commit 0758f2e into Textualize:master Mar 30, 2021
@apoclyps apoclyps deleted the layout-example-using-splitter branch March 30, 2021 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants