Skip to content

Commit 5e455ee

Browse files
Support for Python 3.7 (#16)
* Test against Python 3.7 * Update pdm.lock * Fix typing import * Test all pythons * Update .appveyor.yml
1 parent c9646cf commit 5e455ee

23 files changed

+77
-124
lines changed

.appveyor.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,16 @@ environment:
3232
job_group: build_flet
3333
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
3434

35-
# - job_name: Linux
36-
# job_group: tests
37-
# APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
38-
3935
- job_name: Build Fletd
4036
job_group: build_flet
4137
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
4238

39+
- job_name: Test Python 3.7
40+
job_group: python_tests
41+
job_depends_on: build_flet
42+
python_version: 3.7
43+
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
44+
4345
- job_name: Test Python 3.8
4446
job_group: python_tests
4547
job_depends_on: build_flet

sdk/python/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Requirements
66

7-
* Python 3.8 or above on Windows, Linux or macOS
7+
* Python 3.7 or above on Windows, Linux or macOS
88

99
## Installation
1010

sdk/python/flet/alert_dialog.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
from flet.control import Control, MainAxisAlignment, PaddingValue
77
from flet.ref import Ref
88

9-
try:
10-
from typing import Literal
11-
except:
12-
from typing_extensions import Literal
13-
149

1510
class AlertDialog(Control):
1611
def __init__(

sdk/python/flet/alignment.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import dataclasses
22
from typing import Union
33

4-
from beartype._decor.main import beartype
54

6-
7-
@beartype
85
@dataclasses.dataclass
96
class Alignment:
107
x: Union[float, int]

sdk/python/flet/app_bar.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
import json
2-
from typing import Literal, Optional, Union
1+
from typing import Optional
32

43
from beartype import beartype
54
from beartype.typing import List
65

7-
from flet import padding
8-
from flet.constrained_control import ConstrainedControl
9-
from flet.control import Control, OptionalNumber, PaddingValue
10-
from flet.embed_json_encoder import EmbedJsonEncoder
6+
from flet.control import Control, OptionalNumber
117
from flet.ref import Ref
128

139

sdk/python/flet/banner.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
from flet.control import Control, PaddingValue
77
from flet.ref import Ref
88

9-
try:
10-
from typing import Literal
11-
except:
12-
from typing_extensions import Literal
13-
149

1510
class Banner(Control):
1611
def __init__(

sdk/python/flet/border.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
import dataclasses
22
from typing import Union
33

4-
from beartype._decor.main import beartype
54

6-
7-
@beartype
85
@dataclasses.dataclass
96
class BorderSide:
107
width: Union[None, float, int]
118
color: str = dataclasses.field(default=None)
129

1310

14-
@beartype
1511
@dataclasses.dataclass
1612
class Border:
1713
top: BorderSide

sdk/python/flet/border_radius.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import dataclasses
22
from typing import Union
33

4-
from beartype._decor.main import beartype
54

6-
7-
@beartype
85
@dataclasses.dataclass
96
class BorderRadius:
107
topLeft: Union[float, int]

sdk/python/flet/card.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,11 @@
22

33
from beartype import beartype
44

5-
from flet import border_radius, margin, padding
6-
from flet.alignment import Alignment
7-
from flet.border import Border
8-
from flet.border_radius import BorderRadius
5+
from flet import margin
96
from flet.constrained_control import ConstrainedControl
10-
from flet.control import BorderStyle, Control, MarginValue, OptionalNumber, PaddingValue
7+
from flet.control import Control, MarginValue, OptionalNumber
118
from flet.ref import Ref
129

13-
try:
14-
from typing import Literal
15-
except:
16-
from typing_extensions import Literal
17-
1810

1911
class Card(ConstrainedControl):
2012
def __init__(

sdk/python/flet/checkbox.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from beartype import beartype
44

55
from flet.constrained_control import ConstrainedControl
6-
from flet.control import Control, OptionalNumber
6+
from flet.control import OptionalNumber
77
from flet.ref import Ref
88

99
try:
@@ -66,7 +66,9 @@ def _get_control_name(self):
6666
# value
6767
@property
6868
def value(self):
69-
return self._get_attr("value", data_type="bool?", def_value=False if not self.tristate else None)
69+
return self._get_attr(
70+
"value", data_type="bool?", def_value=False if not self.tristate else None
71+
)
7072

7173
@value.setter
7274
@beartype

sdk/python/flet/clipboard.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
import time
33
from typing import Optional
44

5-
from beartype._decor.main import beartype
5+
from beartype import beartype
66

77
from flet.control import Control
88
from flet.ref import Ref
99

1010

11-
@beartype
1211
@dataclasses.dataclass
1312
class ClipboardData:
1413
ts: str

sdk/python/flet/flet.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import os
44
import signal
55
import socket
6-
import sys
76
import tarfile
87
import tempfile
98
import threading

sdk/python/flet/focus.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
import time
33
from typing import Optional
44

5-
from beartype._decor.main import beartype
65

7-
8-
@beartype
96
@dataclasses.dataclass
107
class FocusData:
118
ts: str = dataclasses.field(default=str(time.time()))

sdk/python/flet/margin.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import dataclasses
22
from typing import Union
33

4-
from beartype._decor.main import beartype
54

6-
7-
@beartype
85
@dataclasses.dataclass
96
class Margin:
107
left: Union[float, int]

sdk/python/flet/navigation_rail.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Literal, Optional, Union
1+
from typing import Optional, Union
22

33
from beartype import beartype
44
from beartype.typing import List
@@ -8,6 +8,11 @@
88
from flet.control import Control, OptionalNumber, PaddingValue
99
from flet.ref import Ref
1010

11+
try:
12+
from typing import Literal
13+
except:
14+
from typing_extensions import Literal
15+
1116
NavigationRailLabelType = Literal[None, "none", "all", "selected"]
1217

1318

sdk/python/flet/padding.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import dataclasses
22
from typing import Union
33

4-
from beartype._decor.main import beartype
54

6-
7-
@beartype
85
@dataclasses.dataclass
96
class Padding:
107
left: Union[float, int]

sdk/python/flet/progress_ring.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
from typing import Optional, Union
1+
from typing import Union
22

33
from beartype import beartype
44

55
from flet.constrained_control import ConstrainedControl
6-
from flet.control import Control, OptionalNumber
6+
from flet.control import OptionalNumber
77
from flet.ref import Ref
88

9-
try:
10-
from typing import Literal
11-
except:
12-
from typing_extensions import Literal
13-
149

1510
class ProgressRing(ConstrainedControl):
1611
def __init__(

sdk/python/flet/radio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from beartype import beartype
44

55
from flet.constrained_control import ConstrainedControl
6-
from flet.control import Control, OptionalNumber
6+
from flet.control import OptionalNumber
77
from flet.ref import Ref
88

99
try:

sdk/python/flet/snack_bar.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55
from flet.control import Control
66
from flet.ref import Ref
77

8-
try:
9-
from typing import Literal
10-
except:
11-
from typing_extensions import Literal
12-
138

149
class SnackBar(Control):
1510
def __init__(

sdk/python/flet/switch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from beartype import beartype
55

66
from flet.constrained_control import ConstrainedControl
7-
from flet.control import Control, OptionalNumber
7+
from flet.control import OptionalNumber
88
from flet.ref import Ref
99

1010
try:

sdk/python/flet/theme.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import dataclasses
22
from dataclasses import field
33

4-
from beartype._decor.main import beartype
5-
64
try:
75
from typing import Literal
86
except:
97
from typing_extensions import Literal
108

119

12-
@beartype
1310
@dataclasses.dataclass
1411
class Theme:
1512
color_scheme_seed: str = field(default=None)

0 commit comments

Comments
 (0)