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

Add Travertino to Toga repository #3086

Merged
merged 55 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
9e03714
Add Travertino verbatim (except for line-length fixes and removed git…
HalfWhitt Jan 9, 2025
3349fbd
Move tests and fix configurations
HalfWhitt Jan 10, 2025
c1eace4
Switch to dataclass style properties
HalfWhitt Jan 10, 2025
7cd22b2
Remove Travertino 0.3.0 compat code in Toga
HalfWhitt Jan 10, 2025
105afca
Added changenote
HalfWhitt Jan 10, 2025
30b270d
Ran pre-commit to reorder imports across Toga
HalfWhitt Jan 10, 2025
3a0fda4
Moved Travertino tests back; altered tox and CI
HalfWhitt Jan 18, 2025
96f243f
Merge branch 'main' into add_travertino
HalfWhitt Jan 18, 2025
46959b6
Add Travertino to RTD install
HalfWhitt Jan 18, 2025
e604846
Fixed test imports, and fail handling in CI coverage
HalfWhitt Jan 18, 2025
48667e8
Fixed matrix location in CI
HalfWhitt Jan 18, 2025
cac6e91
Fixed job needs names
HalfWhitt Jan 18, 2025
36db68d
Fixed style mixin with validated_property
HalfWhitt Jan 18, 2025
0cb994e
Missing $
HalfWhitt Jan 18, 2025
c2f461e
Fix coverage file name
HalfWhitt Jan 18, 2025
71f4c95
Fix it *more*
HalfWhitt Jan 18, 2025
8e89176
Add -trav to tox call
HalfWhitt Jan 18, 2025
b839a5e
Add Travertino to Testbed pyproject; set project root for tox in CI
HalfWhitt Jan 18, 2025
6855af7
Revert tox root
HalfWhitt Jan 18, 2025
f92e866
Add Travertino to textual testbed
HalfWhitt Jan 18, 2025
c0027d2
Separate isort settings so Toga reverts to treating Travertino as thi…
HalfWhitt Jan 18, 2025
e652c07
Make sure style mixin works for property aliases too
HalfWhitt Jan 18, 2025
a73b150
Fix rcfile for coverage-trav
HalfWhitt Jan 18, 2025
bd37dec
Add dev extras to Travertino and use as tox project root in CI
HalfWhitt Jan 18, 2025
51ebc6a
put env name parts in right order
HalfWhitt Jan 18, 2025
807c9bc
consistent env var names, updated Travertino URLs
HalfWhitt Jan 18, 2025
4afdc85
Fix layout() signature in gtk container.py
HalfWhitt Jan 20, 2025
9257749
Only test Travertino on one platform
HalfWhitt Jan 20, 2025
e62e1cd
Fix more links in readme
HalfWhitt Jan 20, 2025
26b529e
Remove placeholder future Pack properties in old format
HalfWhitt Jan 20, 2025
61d5a19
remove more backwards compat; switch Travertino test to Ubuntu
HalfWhitt Jan 21, 2025
f0d545c
Merge branch 'main' into add_travertino
HalfWhitt Jan 21, 2025
5d260e5
Remove subclass_init to fix MicroPython
HalfWhitt Jan 22, 2025
12f61db
Remove non-MicroPython-compatible syntax
HalfWhitt Jan 22, 2025
e46124b
Change matrix variable name
HalfWhitt Jan 22, 2025
0878634
Change matrix variable name
HalfWhitt Jan 22, 2025
f0b609e
Change matrix variable name
HalfWhitt Jan 22, 2025
17ad086
Right folder for version
HalfWhitt Jan 22, 2025
1933350
Add coverage to envlist
HalfWhitt Jan 22, 2025
c3d533e
Change matrix variable name
HalfWhitt Jan 22, 2025
52a2738
trim Travertino test deps; editable install for docs-live
HalfWhitt Jan 23, 2025
2347dc2
Add Travertino changelog, including 0.5.0
HalfWhitt Jan 23, 2025
4c65c7d
re-add tox
HalfWhitt Jan 23, 2025
54f0763
Change name back to dev, makes things simpler
HalfWhitt Jan 23, 2025
8fe41d2
Fixed markdown link to RST
HalfWhitt Jan 23, 2025
986f99d
Escape | in RST
HalfWhitt Jan 23, 2025
618d50c
Standardize RST formatting
HalfWhitt Jan 23, 2025
8079fa4
Added to how-to; added test-core and test-trav labels
HalfWhitt Jan 23, 2025
4b4536a
Added Travertino to spelling list
HalfWhitt Jan 23, 2025
37251ce
Add Travertino to dependabot.yml
HalfWhitt Jan 23, 2025
1ea9df7
Rearrange mixin_dict to avoid creating intermediate dict
HalfWhitt Jan 23, 2025
858d2a1
Promote release note to Feature.
freakboy3742 Jan 24, 2025
0bee60a
Minor edits to Travertino release notes.
freakboy3742 Jan 24, 2025
30dd277
Minor tweaks to contribution docs.
freakboy3742 Jan 24, 2025
55988b8
Minor tweaks to Travertino project metadata.
freakboy3742 Jan 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/config-file-deps-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
uses: beeware/.github/.github/workflows/dep-version-bump.yml@main
secrets: inherit
with:
subdirectory: . core dummy android cocoa demo gtk iOS testbed textual toga web winforms
subdirectory: . core dummy android cocoa demo gtk iOS testbed textual toga travertino web winforms
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- "toga_iOS"
- "toga_web"
- "toga_winforms"
- "travertino"
steps:
- name: Get packages
uses: dsaltares/[email protected]
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
- "toga_textual"
- "toga_web"
- "toga_winforms"
- "travertino"
steps:
- name: Get Packages
uses: actions/[email protected]
Expand Down
1 change: 1 addition & 0 deletions android/src/toga_android/colors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from android.graphics import Color

from travertino.colors import TRANSPARENT

CACHE = {TRANSPARENT: Color.TRANSPARENT}
Expand Down
2 changes: 1 addition & 1 deletion android/src/toga_android/widgets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from android.view import Gravity, View
from android.widget import RelativeLayout
from org.beeware.android import MainActivity
from travertino.size import at_least

from toga.constants import CENTER, JUSTIFY, LEFT, RIGHT, TRANSPARENT
from travertino.size import at_least

from ..colors import native_color

Expand Down
1 change: 1 addition & 0 deletions android/src/toga_android/widgets/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from android.view import View
from android.widget import Button as A_Button
from java import dynamic_proxy

from travertino.size import at_least

from .label import TextViewWidget
Expand Down
1 change: 1 addition & 0 deletions android/src/toga_android/widgets/divider.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from android.graphics import Color
from android.view import View
from android.widget import LinearLayout

from travertino.size import at_least

from .base import Widget
Expand Down
1 change: 1 addition & 0 deletions android/src/toga_android/widgets/internal/pickers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from android.view import View
from android.widget import EditText
from java import dynamic_proxy

from travertino.size import at_least

from ..label import TextViewWidget
Expand Down
2 changes: 1 addition & 1 deletion android/src/toga_android/widgets/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from android.util import TypedValue
from android.view import Gravity, View
from android.widget import TextView
from travertino.size import at_least

from toga.constants import JUSTIFY
from toga_android.colors import native_color
from travertino.size import at_least

from .base import Widget, android_text_align

Expand Down
1 change: 1 addition & 0 deletions android/src/toga_android/widgets/multilinetextinput.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from android.text import InputType
from android.view import Gravity

from travertino.size import at_least

from .textinput import TextInput
Expand Down
2 changes: 1 addition & 1 deletion android/src/toga_android/widgets/optioncontainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
NavigationBarView = None

from java import dynamic_proxy
from travertino.size import at_least

import toga
from travertino.size import at_least

from ..container import Container
from .base import Widget
Expand Down
1 change: 1 addition & 0 deletions android/src/toga_android/widgets/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from android.view import View
from android.widget import CompoundButton, Switch as A_Switch
from java import dynamic_proxy

from travertino.size import at_least

from .label import TextViewWidget
Expand Down
1 change: 1 addition & 0 deletions changes/3086.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Travertino has moved from its own repository to Toga's and is now released to coincide with each version release of Toga.
3 changes: 1 addition & 2 deletions cocoa/src/toga_cocoa/widgets/box.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from travertino.size import at_least

from toga_cocoa.container import TogaView
from travertino.size import at_least

from .base import Widget

Expand Down
2 changes: 1 addition & 1 deletion cocoa/src/toga_cocoa/widgets/button.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from rubicon.objc import SEL, objc_method, objc_property
from travertino.size import at_least

from toga.colors import TRANSPARENT
from toga.fonts import SYSTEM_DEFAULT_FONT_SIZE
Expand All @@ -10,6 +9,7 @@
NSButton,
NSMomentaryPushInButton,
)
from travertino.size import at_least

from .base import Widget

Expand Down
2 changes: 1 addition & 1 deletion cocoa/src/toga_cocoa/widgets/canvas.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from math import ceil

from rubicon.objc import CGSize, objc_method, objc_property
from travertino.size import at_least

from toga.colors import BLACK, TRANSPARENT, color
from toga.constants import Baseline, FillRule
Expand All @@ -27,6 +26,7 @@
kCGPathFill,
kCGPathStroke,
)
from travertino.size import at_least

from .base import Widget

Expand Down
2 changes: 1 addition & 1 deletion cocoa/src/toga_cocoa/widgets/detailedlist.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from rubicon.objc import SEL, objc_method, objc_property
from travertino.size import at_least

from toga_cocoa.libs import (
NSIndexSet,
Expand All @@ -12,6 +11,7 @@
from toga_cocoa.widgets.internal.cells import TogaDetailedCell
from toga_cocoa.widgets.internal.data import TogaData
from toga_cocoa.widgets.internal.refresh import RefreshableScrollView
from travertino.size import at_least


class TogaList(NSTableView):
Expand Down
3 changes: 1 addition & 2 deletions cocoa/src/toga_cocoa/widgets/divider.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from travertino.size import at_least

from toga_cocoa.libs import NSBox, NSBoxType
from travertino.size import at_least

from .base import Widget

Expand Down
3 changes: 1 addition & 2 deletions cocoa/src/toga_cocoa/widgets/label.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from travertino.size import at_least

from toga_cocoa.colors import native_color
from toga_cocoa.libs import NSTextAlignment, NSTextField
from travertino.size import at_least

from .base import Widget

Expand Down
2 changes: 1 addition & 1 deletion cocoa/src/toga_cocoa/widgets/mapview.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import math

from rubicon.objc import objc_method, objc_property
from travertino.size import at_least

from toga.types import LatLng
from travertino.size import at_least

from ..libs import (
CLLocationCoordinate2D,
Expand Down
2 changes: 1 addition & 1 deletion cocoa/src/toga_cocoa/widgets/multilinetextinput.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from rubicon.objc import objc_method, objc_property
from travertino.size import at_least

from toga.colors import TRANSPARENT
from toga_cocoa.colors import native_color
Expand All @@ -11,6 +10,7 @@
NSViewHeightSizable,
NSViewWidthSizable,
)
from travertino.size import at_least

from .base import Widget

Expand Down
2 changes: 1 addition & 1 deletion cocoa/src/toga_cocoa/widgets/numberinput.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from decimal import Decimal, InvalidOperation

from rubicon.objc import SEL, objc_method, objc_property
from travertino.size import at_least

from toga.colors import TRANSPARENT
from toga.widgets.numberinput import _clean_decimal, _clean_decimal_str
Expand All @@ -22,6 +21,7 @@
NSTextView,
NSView,
)
from travertino.size import at_least

from .base import Widget

Expand Down
2 changes: 1 addition & 1 deletion cocoa/src/toga_cocoa/widgets/optioncontainer.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import warnings

from rubicon.objc import SEL, objc_method
from travertino.size import at_least

from toga_cocoa.container import Container
from toga_cocoa.libs import NSTabView, NSTabViewItem
from travertino.size import at_least

from ..libs import objc_property
from .base import Widget
Expand Down
3 changes: 1 addition & 2 deletions cocoa/src/toga_cocoa/widgets/progressbar.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from travertino.size import at_least

from toga_cocoa.libs import NSProgressIndicator, NSProgressIndicatorBarStyle
from travertino.size import at_least

from .base import Widget

Expand Down
2 changes: 1 addition & 1 deletion cocoa/src/toga_cocoa/widgets/scrollcontainer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from rubicon.objc import SEL, objc_method, objc_property
from travertino.size import at_least

from toga_cocoa.container import Container
from toga_cocoa.libs import (
Expand All @@ -12,6 +11,7 @@
NSScrollViewDidEndLiveScrollNotification,
NSScrollViewDidLiveScrollNotification,
)
from travertino.size import at_least

from .base import Widget

Expand Down
3 changes: 1 addition & 2 deletions cocoa/src/toga_cocoa/widgets/selection.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from travertino.size import at_least

from toga_cocoa.libs import SEL, NSPopUpButton, objc_method, objc_property
from travertino.size import at_least

from .base import Widget

Expand Down
3 changes: 1 addition & 2 deletions cocoa/src/toga_cocoa/widgets/slider.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from travertino.size import at_least

from toga.widgets.slider import SliderImpl
from toga_cocoa.libs import (
SEL,
Expand All @@ -8,6 +6,7 @@
objc_method,
objc_property,
)
from travertino.size import at_least

from .base import Widget

Expand Down
2 changes: 1 addition & 1 deletion cocoa/src/toga_cocoa/widgets/splitcontainer.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from rubicon.objc import SEL, objc_method, objc_property
from travertino.size import at_least

from toga.constants import Direction
from toga_cocoa.container import Container
from toga_cocoa.libs import NSSplitView
from travertino.size import at_least

from .base import Widget

Expand Down
3 changes: 1 addition & 2 deletions cocoa/src/toga_cocoa/widgets/switch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from travertino.size import at_least

from toga_cocoa.libs import (
SEL,
NSBezelStyle,
Expand All @@ -10,6 +8,7 @@
objc_method,
objc_property,
)
from travertino.size import at_least

from .base import Widget

Expand Down
2 changes: 1 addition & 1 deletion cocoa/src/toga_cocoa/widgets/table.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from rubicon.objc import SEL, NSPoint, at, objc_method, objc_property
from travertino.size import at_least

import toga
from toga_cocoa.libs import (
Expand All @@ -12,6 +11,7 @@
NSTableViewAnimation,
NSTableViewColumnAutoresizingStyle,
)
from travertino.size import at_least

from .base import Widget
from .internal.cells import TogaIconView
Expand Down
3 changes: 1 addition & 2 deletions cocoa/src/toga_cocoa/widgets/textinput.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from travertino.size import at_least

from toga.colors import TRANSPARENT
from toga.constants import LEFT, RIGHT
from toga_cocoa.colors import native_color
Expand All @@ -20,6 +18,7 @@
objc_property,
send_super,
)
from travertino.size import at_least

from .base import Widget

Expand Down
2 changes: 1 addition & 1 deletion cocoa/src/toga_cocoa/widgets/tree.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from rubicon.objc import SEL, at, objc_method, objc_property
from travertino.size import at_least

import toga
from toga_cocoa.libs import (
Expand All @@ -14,6 +13,7 @@
from toga_cocoa.widgets.base import Widget
from toga_cocoa.widgets.internal.cells import TogaIconView
from toga_cocoa.widgets.internal.data import TogaData
from travertino.size import at_least


def node_impl(node):
Expand Down
2 changes: 1 addition & 1 deletion cocoa/src/toga_cocoa/widgets/webview.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from http.cookiejar import Cookie, CookieJar

from rubicon.objc import objc_id, objc_method, objc_property, py_from_ns
from travertino.size import at_least

from toga.widgets.webview import CookiesResult, JavaScriptResult
from travertino.size import at_least

from ..libs import NSURL, NSURLRequest, WKWebView
from .base import Widget
Expand Down
8 changes: 5 additions & 3 deletions core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ classifiers = [
"Topic :: Software Development :: User Interfaces",
"Topic :: Software Development :: Widget Sets",
]
dependencies = [
"travertino >= 0.3.0, < 0.4.0",
]

[project.optional-dependencies]
# Extras used by developers *of* Toga are pinned to specific versions to
Expand Down Expand Up @@ -104,6 +101,11 @@ pil = "toga.plugins.image_formats.PILConverter"
[tool.setuptools_scm]
root = ".."

[tool.setuptools_dynamic_dependencies]
dependencies = [
"travertino == {version}",
]

[tool.coverage.run]
parallel = true
branch = true
Expand Down
6 changes: 3 additions & 3 deletions core/src/toga/fonts.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

from pathlib import Path

import toga
from toga.platform import get_platform_factory

# Use the Travertino font definitions as-is
from travertino import constants
from travertino.constants import (
Expand All @@ -20,9 +23,6 @@
)
from travertino.fonts import Font as BaseFont

import toga
from toga.platform import get_platform_factory

SYSTEM_DEFAULT_FONTS = {SYSTEM, MESSAGE, SERIF, SANS_SERIF, CURSIVE, FANTASY, MONOSPACE}
SYSTEM_DEFAULT_FONT_SIZE = -1
FONT_WEIGHTS = {NORMAL, BOLD}
Expand Down
Loading
Loading