Skip to content

Support for Python 3.7 #16

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

Merged
merged 5 commits into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 6 additions & 4 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@ environment:
job_group: build_flet
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey

# - job_name: Linux
# job_group: tests
# APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu

- job_name: Build Fletd
job_group: build_flet
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu

- job_name: Test Python 3.7
job_group: python_tests
job_depends_on: build_flet
python_version: 3.7
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu

- job_name: Test Python 3.8
job_group: python_tests
job_depends_on: build_flet
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Requirements

* Python 3.8 or above on Windows, Linux or macOS
* Python 3.7 or above on Windows, Linux or macOS

## Installation

Expand Down
5 changes: 0 additions & 5 deletions sdk/python/flet/alert_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
from flet.control import Control, MainAxisAlignment, PaddingValue
from flet.ref import Ref

try:
from typing import Literal
except:
from typing_extensions import Literal


class AlertDialog(Control):
def __init__(
Expand Down
3 changes: 0 additions & 3 deletions sdk/python/flet/alignment.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import dataclasses
from typing import Union

from beartype._decor.main import beartype


@beartype
@dataclasses.dataclass
class Alignment:
x: Union[float, int]
Expand Down
8 changes: 2 additions & 6 deletions sdk/python/flet/app_bar.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import json
from typing import Literal, Optional, Union
from typing import Optional

from beartype import beartype
from beartype.typing import List

from flet import padding
from flet.constrained_control import ConstrainedControl
from flet.control import Control, OptionalNumber, PaddingValue
from flet.embed_json_encoder import EmbedJsonEncoder
from flet.control import Control, OptionalNumber
from flet.ref import Ref


Expand Down
5 changes: 0 additions & 5 deletions sdk/python/flet/banner.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
from flet.control import Control, PaddingValue
from flet.ref import Ref

try:
from typing import Literal
except:
from typing_extensions import Literal


class Banner(Control):
def __init__(
Expand Down
4 changes: 0 additions & 4 deletions sdk/python/flet/border.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import dataclasses
from typing import Union

from beartype._decor.main import beartype


@beartype
@dataclasses.dataclass
class BorderSide:
width: Union[None, float, int]
color: str = dataclasses.field(default=None)


@beartype
@dataclasses.dataclass
class Border:
top: BorderSide
Expand Down
3 changes: 0 additions & 3 deletions sdk/python/flet/border_radius.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import dataclasses
from typing import Union

from beartype._decor.main import beartype


@beartype
@dataclasses.dataclass
class BorderRadius:
topLeft: Union[float, int]
Expand Down
12 changes: 2 additions & 10 deletions sdk/python/flet/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,11 @@

from beartype import beartype

from flet import border_radius, margin, padding
from flet.alignment import Alignment
from flet.border import Border
from flet.border_radius import BorderRadius
from flet import margin
from flet.constrained_control import ConstrainedControl
from flet.control import BorderStyle, Control, MarginValue, OptionalNumber, PaddingValue
from flet.control import Control, MarginValue, OptionalNumber
from flet.ref import Ref

try:
from typing import Literal
except:
from typing_extensions import Literal


class Card(ConstrainedControl):
def __init__(
Expand Down
6 changes: 4 additions & 2 deletions sdk/python/flet/checkbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from beartype import beartype

from flet.constrained_control import ConstrainedControl
from flet.control import Control, OptionalNumber
from flet.control import OptionalNumber
from flet.ref import Ref

try:
Expand Down Expand Up @@ -66,7 +66,9 @@ def _get_control_name(self):
# value
@property
def value(self):
return self._get_attr("value", data_type="bool?", def_value=False if not self.tristate else None)
return self._get_attr(
"value", data_type="bool?", def_value=False if not self.tristate else None
)

@value.setter
@beartype
Expand Down
3 changes: 1 addition & 2 deletions sdk/python/flet/clipboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
import time
from typing import Optional

from beartype._decor.main import beartype
from beartype import beartype

from flet.control import Control
from flet.ref import Ref


@beartype
@dataclasses.dataclass
class ClipboardData:
ts: str
Expand Down
1 change: 0 additions & 1 deletion sdk/python/flet/flet.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import os
import signal
import socket
import sys
import tarfile
import tempfile
import threading
Expand Down
3 changes: 0 additions & 3 deletions sdk/python/flet/focus.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
import time
from typing import Optional

from beartype._decor.main import beartype


@beartype
@dataclasses.dataclass
class FocusData:
ts: str = dataclasses.field(default=str(time.time()))
Expand Down
3 changes: 0 additions & 3 deletions sdk/python/flet/margin.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import dataclasses
from typing import Union

from beartype._decor.main import beartype


@beartype
@dataclasses.dataclass
class Margin:
left: Union[float, int]
Expand Down
7 changes: 6 additions & 1 deletion sdk/python/flet/navigation_rail.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Literal, Optional, Union
from typing import Optional, Union

from beartype import beartype
from beartype.typing import List
Expand All @@ -8,6 +8,11 @@
from flet.control import Control, OptionalNumber, PaddingValue
from flet.ref import Ref

try:
from typing import Literal
except:
from typing_extensions import Literal

NavigationRailLabelType = Literal[None, "none", "all", "selected"]


Expand Down
3 changes: 0 additions & 3 deletions sdk/python/flet/padding.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import dataclasses
from typing import Union

from beartype._decor.main import beartype


@beartype
@dataclasses.dataclass
class Padding:
left: Union[float, int]
Expand Down
9 changes: 2 additions & 7 deletions sdk/python/flet/progress_ring.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
from typing import Optional, Union
from typing import Union

from beartype import beartype

from flet.constrained_control import ConstrainedControl
from flet.control import Control, OptionalNumber
from flet.control import OptionalNumber
from flet.ref import Ref

try:
from typing import Literal
except:
from typing_extensions import Literal


class ProgressRing(ConstrainedControl):
def __init__(
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/flet/radio.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from beartype import beartype

from flet.constrained_control import ConstrainedControl
from flet.control import Control, OptionalNumber
from flet.control import OptionalNumber
from flet.ref import Ref

try:
Expand Down
5 changes: 0 additions & 5 deletions sdk/python/flet/snack_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
from flet.control import Control
from flet.ref import Ref

try:
from typing import Literal
except:
from typing_extensions import Literal


class SnackBar(Control):
def __init__(
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/flet/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from beartype import beartype

from flet.constrained_control import ConstrainedControl
from flet.control import Control, OptionalNumber
from flet.control import OptionalNumber
from flet.ref import Ref

try:
Expand Down
3 changes: 0 additions & 3 deletions sdk/python/flet/theme.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import dataclasses
from dataclasses import field

from beartype._decor.main import beartype

try:
from typing import Literal
except:
from typing_extensions import Literal


@beartype
@dataclasses.dataclass
class Theme:
color_scheme_seed: str = field(default=None)
Expand Down
Loading