Skip to content

Commit ebd7adc

Browse files
ndonkoHenriCopilot
andauthored
v1: code improvements (#9)
* improvements * updates * trigger ci-build * Update examples/datatable2_example/src/data.py Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent 1b459cf commit ebd7adc

File tree

20 files changed

+137
-394
lines changed

20 files changed

+137
-394
lines changed

.ci/patch_pubspec_version.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# /// script
2+
# dependencies = ["pyyaml"]
3+
# ///
4+
15
import os
26
import pathlib
37
import sys
@@ -17,7 +21,7 @@
1721
"flet",
1822
]
1923

20-
with open(pubspec_path, "r") as f:
24+
with open(pubspec_path) as f:
2125
data = yaml.safe_load(f)
2226

2327
# patch version

.ci/patch_toml_version.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# /// script
2+
# dependencies = ["tomlkit"]
3+
# ///
4+
15
import os
26
import pathlib
37
import sys
@@ -14,7 +18,7 @@
1418
print(f"Patching TOML file {toml_path} to {ver}")
1519

1620
# read
17-
with open(toml_path, "r") as f:
21+
with open(toml_path) as f:
1822
t = tomlkit.parse(f.read())
1923

2024
# patch version

.docstr.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
paths: src/flet_datatable2
2+
badge: ./docs/assets/badges/docs-coverage.svg
3+
skip_file_doc: True
4+
skip_private: False
5+
ignore_patterns: # Dict with key/value pairs of file-pattern/node-pattern
6+
.*: __post_init__ # Ignore __post_init__ in all files
7+
fail_under: 50

.github/workflows/docs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
- dev
87
paths:
98
- 'LICENSE'
109
- 'CHANGELOG.md'

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ This package supports the following platforms:
2626
| Android ||
2727
| Web ||
2828

29-
## Installation
29+
## Usage
30+
31+
### Installation
3032

3133
To install the `flet-datatable2` package and add it to your project dependencies:
3234

@@ -45,3 +47,7 @@ To install the `flet-datatable2` package and add it to your project dependencies
4547
```bash
4648
poetry add flet-datatable2
4749
```
50+
51+
### Examples
52+
53+
For examples, see [these](./examples).

appveyor.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,20 @@ image: ubuntu
33
version: '0.1.{build}'
44

55
environment:
6+
PYTHON_VERSION: 3.12
67
UV_PUBLISH_TOKEN:
78
secure: 174ncAbF5IjSIkmioPt62jeSnzmTlRNchUkE4QdjDWH8xK1olYtySXLJpo2q95HcP7lWJky1hv4APESiRRHnBWoY0XRFafzM/mbCDMzG1tZXiXZmpP1qzHAtRP2QSCIg18xh1TMktraUdTi7sbJnjjRhqzgbW1k0kLBxKw79MPFBhYQ/TiGcmaYWZbWVZNY3HCUCb6Dt7bG1OE2Ul9rD1gvs55xwO9Oq9FOVA1VnMYw=
89

9-
stack:
10-
- python 3.12
11-
1210
install:
1311
- source .ci/update_build_version.sh
14-
- python --version
15-
- python -m ensurepip --upgrade
16-
- pip3 install --upgrade tomlkit pyyaml
1712
- curl -LsSf https://astral.sh/uv/install.sh | sh
18-
- export PATH=$HOME/.local/bin:$PATH
13+
- export PATH="$HOME/.local/bin:$PATH"
14+
- uv python install $PYTHON_VERSION
15+
- uv python pin $PYTHON_VERSION
1916

2017
build_script:
21-
- python .ci/patch_toml_version.py pyproject.toml $PYPI_VER
22-
- python .ci/patch_pubspec_version.py src/flutter/flet_*/pubspec.yaml $PKG_VER
18+
- uv run .ci/patch_toml_version.py pyproject.toml $PYPI_VER
19+
- uv run .ci/patch_pubspec_version.py src/flutter/flet_*/pubspec.yaml $PKG_VER
2320
- (cd src/flutter/* && dart pub get && dart analyze && cd -)
2421
- uv build
2522

@@ -32,4 +29,4 @@ deploy_script:
3229
artifacts:
3330
- path: dist/*.whl
3431

35-
test: off
32+
test: off

docs/changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
title: Changelog
33
---
44

5-
--8<-- "CHANGELOG.md"
5+
--8<-- "CHANGELOG.md"

docs/datatable2.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
1+
## Examples
2+
3+
[Live demo](https://flet-controls-gallery.fly.dev/layout/datatable2)
4+
5+
### Example 1
6+
7+
```python title="example_1.py"
8+
--8<-- "examples/datatable2_example/src/example_1.py"
9+
```
10+
11+
### Example 2
12+
13+
![example_2](../examples/datatable2_example/src/media/example_2.gif)
14+
15+
```python title="example_2.py"
16+
--8<-- "examples/datatable2_example/src/example_2.py"
17+
```
18+
119
::: flet_datatable2.datatable2.DataTable2
220
options:
321
filters:
422
- "!data_row_min_height"
5-
- "!data_row_max_height"
23+
- "!data_row_max_height"

docs/index.md

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,6 @@ To install the `flet-datatable2` package and add it to your project dependencies
4545
poetry add flet-datatable2
4646
```
4747

48+
### Examples
4849

49-
## Examples
50-
51-
[Live demo](https://flet-controls-gallery.fly.dev/layout/datatable2)
52-
53-
### Example 1
54-
55-
```python
56-
--8<-- "examples/datatable2_example/src/example-1.py"
57-
```
58-
59-
### Example 2
60-
61-
![DataTable2 example 2](assets/example-2.gif)
62-
63-
```
64-
```python
65-
--8<-- "examples/datatable2_example/src/example-2.py"
66-
```
50+
See [these](datatable2.md#examples).

docs/types/datacolumn_size.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
::: flet_datatable2.types.DataColumnSize
1+
::: flet_datatable2.datacolumn2.DataColumnSize
22
options:
3-
separate_signature: false
3+
separate_signature: false

0 commit comments

Comments
 (0)