Skip to content

Commit

Permalink
Bump0220 (#2405)
Browse files Browse the repository at this point in the history
* Version bump

* upate version

* fix domain name

* wrong project

* skip on Windows

* disable demo snapshot

* 37 fix
  • Loading branch information
willmcgugan committed Apr 27, 2023
1 parent dd70a7a commit 124c45e
Show file tree
Hide file tree
Showing 5 changed files with 152 additions and 145 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [0.22.0] - Unreleased
## [0.22.0] - 2023-04-27

### Fixed

Expand Down Expand Up @@ -820,6 +820,7 @@ https://textual.textualize.io/blog/2022/11/08/version-040/#version-040
- New handler system for messages that doesn't require inheritance
- Improved traceback handling

[0.22.0]: https://github.com/Textualize/textual/compare/v0.21.0...v0.22.0
[0.21.0]: https://github.com/Textualize/textual/compare/v0.20.1...v0.21.0
[0.20.1]: https://github.com/Textualize/textual/compare/v0.20.0...v0.20.1
[0.20.0]: https://github.com/Textualize/textual/compare/v0.19.1...v0.20.0
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "textual"
version = "0.21.0"
version = "0.22.0"
homepage = "https://github.com/Textualize/textual"
description = "Modern Text User Interface framework"
authors = ["Will McGugan <[email protected]>"]
Expand Down
6 changes: 2 additions & 4 deletions src/textual/_resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,7 @@ def resolve_box_models(
# If all box models have been calculated
widget_styles = [widget.styles for widget in widgets]
if resolve_dimension == "width":
total_remaining = int(
sum([width for width, _, _ in filter(None, box_models)], start=Fraction())
)
total_remaining = int(sum([width for width, _, _ in filter(None, box_models)]))
remaining_space = int(max(0, size.width - total_remaining - margin_width))
fraction_unit = resolve_fraction_unit(
[
Expand All @@ -237,7 +235,7 @@ def resolve_box_models(
height_fraction = Fraction(margin_size.height)
else:
total_remaining = int(
sum([height for _, height, _ in filter(None, box_models)], start=Fraction())
sum([height for _, height, _ in filter(None, box_models)])
)
remaining_space = int(max(0, size.height - total_remaining - margin_height))
fraction_unit = resolve_fraction_unit(
Expand Down
275 changes: 137 additions & 138 deletions tests/snapshot_tests/__snapshots__/test_snapshots.ambr

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion tests/snapshot_tests/test_snapshots.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from pathlib import Path
import sys

import pytest

Expand Down Expand Up @@ -319,11 +320,19 @@ def test_demo(snap_compare):
"""Test the demo app (python -m textual)"""
assert snap_compare(
Path("../../src/textual/demo.py"),
press=["down", "down", "down", "wait:500"],
terminal_size=(100, 30),
)


# def test_demo_with_keys(snap_compare):
# """Test the demo app (python -m textual)"""
# assert snap_compare(
# Path("../../src/textual/demo.py"),
# press=["down", "down", "down", "wait:500"],
# terminal_size=(100, 30),
# )


def test_label_widths(snap_compare):
"""Test renderable widths are calculate correctly."""
assert snap_compare(SNAPSHOT_APPS_DIR / "label_widths.py")
Expand Down

0 comments on commit 124c45e

Please sign in to comment.