Skip to content

Commit d707056

Browse files
authored
fix(docs): update (#7)
* initial commit * initial commit * initial commit * remove mdformat from pre-commit * update mkdocs watch items | unshow `Event.get_event_field_type` * fixes * lint dependency group
1 parent 522621c commit d707056

File tree

12 files changed

+241
-65
lines changed

12 files changed

+241
-65
lines changed

.github/workflows/docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- dev
78
paths:
89
- 'LICENSE'
910
- 'CHANGELOG.md'
@@ -52,7 +53,7 @@ jobs:
5253
- name: Install dependencies
5354
run: |
5455
uv pip install -e .
55-
uv pip install --group docs
56+
uv pip install --group docs --group lint
5657
5758
- name: Deploy to GitHub Pages
5859
run: uv run mkdocs gh-deploy --force

.gitignore

Lines changed: 132 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,135 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
target/
76+
77+
# Jupyter Notebook
78+
.ipynb_checkpoints
79+
80+
# IPython
81+
profile_default/
82+
ipython_config.py
83+
84+
# pyenv
85+
.python-version
186

2-
/.venv
3-
/build
4-
/src/flet_data_table_2.egg-info
5-
/examples/datatable2_example/build/
6-
/examples/datatable2_example/src/__pycache__
7-
/examples/datatable2_example/src/flet_datatable2_example.egg-info
8-
/examples/flet_data_table_example/build
87+
# pipenv
88+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91+
# install all needed dependencies.
92+
#Pipfile.lock
93+
uv.lock
94+
95+
# celery beat schedule file
96+
celerybeat-schedule
97+
98+
# SageMath parsed files
99+
*.sage.py
100+
101+
# Environments
102+
.env
103+
.venv
104+
env/
105+
venv/
106+
ENV/
107+
env.bak/
108+
venv.bak/
109+
110+
# Spyder project settings
111+
.spyderproject
112+
.spyproject
113+
114+
# Rope project settings
115+
.ropeproject
116+
117+
# mkdocs documentation
9118
/site
10-
/src/flet_datatable2.egg-info
119+
120+
# mypy
121+
.mypy_cache/
122+
.dmypy.json
123+
dmypy.json
124+
125+
# Pyre type checker
126+
.pyre/
127+
128+
# VS Code
129+
.vscode/
130+
131+
# PDM
132+
.pdm.toml
133+
__pypackages__/
134+
11135
.DS_Store
12-
uv.lock
13-
__pycache__/

.pre-commit-config.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.12.5
4+
hooks:
5+
# Run the linter.
6+
- id: ruff
7+
args: [ --fix ]
8+
# Run the formatter.
9+
- id: ruff-format
10+
11+
- repo: https://github.com/pre-commit/pre-commit-hooks
12+
rev: v5.0.0
13+
hooks:
14+
- id: end-of-file-fixer
15+
- id: trailing-whitespace
16+
17+
- repo: https://github.com/aio-libs/sort-all
18+
rev: v1.3.0
19+
hooks:
20+
- id: sort-all

examples/datatable2_example/src/example-1.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ def main(page: ft.Page):
88
fdt.DataTable2(
99
empty=ft.Text("This table is empty."),
1010
columns=[
11-
fdt.DataColumn2(ft.Text("First name")),
12-
fdt.DataColumn2(ft.Text("Last name")),
13-
fdt.DataColumn2(ft.Text("Age"), numeric=True),
11+
fdt.DataColumn2(label=ft.Text("First name")),
12+
fdt.DataColumn2(label=ft.Text("Last name")),
13+
fdt.DataColumn2(label=ft.Text("Age"), numeric=True),
1414
],
1515
),
1616
)

examples/datatable2_example/src/example-2.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,44 +22,44 @@ def all_selected(e: ft.ControlEvent):
2222
def get_data_columns():
2323
data_columns = [
2424
ftd.DataColumn2(
25-
ft.Text("Name"),
25+
label=ft.Text("Name"),
2626
size=ftd.DataColumnSize.L,
2727
on_sort=sort_column,
2828
heading_row_alignment=ft.MainAxisAlignment.START,
2929
),
3030
ftd.DataColumn2(
31-
ft.Text("Calories"),
31+
label=ft.Text("Calories"),
3232
on_sort=sort_column,
3333
numeric=True,
3434
heading_row_alignment=ft.MainAxisAlignment.END,
3535
),
3636
ftd.DataColumn2(
37-
ft.Text("Fat"),
37+
label=ft.Text("Fat"),
3838
on_sort=sort_column,
3939
numeric=True,
4040
),
4141
ftd.DataColumn2(
42-
ft.Text("Carbs"),
42+
label=ft.Text("Carbs"),
4343
on_sort=sort_column,
4444
numeric=True,
4545
),
4646
ftd.DataColumn2(
47-
ft.Text("Protein"),
47+
label=ft.Text("Protein"),
4848
on_sort=sort_column,
4949
numeric=True,
5050
),
5151
ftd.DataColumn2(
52-
ft.Text("Sodium"),
52+
label=ft.Text("Sodium"),
5353
on_sort=sort_column,
5454
numeric=True,
5555
),
5656
ftd.DataColumn2(
57-
ft.Text("Calcium"),
57+
label=ft.Text("Calcium"),
5858
on_sort=sort_column,
5959
numeric=True,
6060
),
6161
ftd.DataColumn2(
62-
ft.Text("Iron"),
62+
label=ft.Text("Iron"),
6363
on_sort=sort_column,
6464
numeric=True,
6565
),

mkdocs.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,17 @@ validation:
9595
# Watch
9696
watch:
9797
- docs
98-
- src
98+
- src/flet_datatable2
99+
- CHANGELOG.md
100+
- LICENSE
101+
- README.md
99102

100103
# Plugins
101104
plugins:
102105
# - footnotes
103106
- search:
104107
lang: en
108+
- open-in-new-tab
105109
- mike:
106110
alias_type: symlink
107111
- glightbox
@@ -131,17 +135,12 @@ plugins:
131135
preload_modules: [ flet ]
132136
filters:
133137
- "!^_" # Exclude private members starting with only one underscore
134-
- "!before_update"
135-
- "!before_event"
136-
- "!clean"
137-
- "!did_mount"
138-
- "!init"
139-
- "!is_isolated"
140-
- "!update"
141-
- "!will_unmount"
138+
- "!get_event_field_type"
142139
extensions:
143140
- griffe_modernized_annotations
141+
- griffe_warnings_deprecated
144142
inventories:
143+
- url: https://docs.flet.dev/objects.inv
145144
- url: https://docs.python.org/3/objects.inv
146145
domains: [ py, std ]
147146
- url: https://typing-extensions.readthedocs.io/en/latest/objects.inv

pyproject.toml

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,43 @@ Issues = "https://github.com/flet-dev/flet-datatable2/issues"
2020
"flutter.flet_datatable2" = ["**/*"]
2121

2222
[dependency-groups]
23+
test = [
24+
"pytest >=7.2.0",
25+
]
26+
lint = [
27+
"ruff >=0.11.7",
28+
]
2329
dev = [
24-
"pre-commit>=4.2.0",
25-
"ruff>=0.11.7",
30+
"pre-commit >=4.2.0",
31+
{ include-group = 'lint' },
32+
{ include-group = 'test' },
33+
]
34+
docs-coverage = [
35+
"docstr-coverage >=2.3.2",
2636
]
2737
docs = [
28-
"mkdocs",
29-
"mkdocs-material",
30-
"mkdocstrings[python]",
31-
"mkdocstrings-python-xref",
32-
"mike",
33-
"markdown>=3.6",
34-
"pymdown-extensions",
35-
"mkdocs-glightbox",
36-
"mkdocs-section-index",
37-
"griffe-modernized-annotations",
38-
"pygments>=2.16",
38+
"mkdocs >=1.6.1",
39+
"mkdocs-material >=9.6.15",
40+
"mkdocstrings-python >=1.16.12",
41+
"mkdocstrings-python-xref >=1.16.3",
42+
"mike >=2.1.3",
43+
"markdown >=3.6",
44+
"pymdown-extensions >=10.16",
45+
"mkdocs-exclude >=1.0.2",
46+
"mkdocs-glightbox >=0.4.0",
47+
"mkdocs-open-in-new-tab >=1.0.8",
48+
"mkdocs-section-index >=0.3.10",
49+
"griffe-modernized-annotations >=1.0.8",
50+
"griffe-warnings-deprecated >=1.1.0",
51+
"pygments >=2.16",
52+
"markdown-exec[ansi] >=1.11.0",
53+
"pydocstyle >=6.3.0",
54+
"linkcheckmd >=1.4.0",
55+
{ include-group = 'docs-coverage' },
56+
]
57+
all = [
58+
{ include-group = 'dev' },
59+
{ include-group = 'docs' },
3960
]
4061

4162
[build-system]
@@ -64,8 +85,9 @@ select = [
6485
"I"
6586
]
6687
preview = true
88+
pydocstyle = { convention = 'google' }
6789

6890
[tool.ruff.format]
6991
quote-style = "double"
7092
indent-style = "space"
71-
line-ending = "auto"
93+
line-ending = "auto"

src/flet_datatable2/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,10 @@
22
from .datarow2 import DataRow2
33
from .datatable2 import DataTable2
44
from .types import DataColumnSize
5+
6+
__all__ = [
7+
"DataColumn2",
8+
"DataColumnSize",
9+
"DataRow2",
10+
"DataTable2",
11+
]

0 commit comments

Comments
 (0)