We have been consolidating all of our Python configuration in
`pyproject.toml`, so we can move our one `uv` specific setting there as
well.
Testing: There is no easy way to write an automated test for this but I
confirmed it work by running `uv run --show-settings`.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This will complete the type annotation on `codegen.py` so we can safely
remove the ignore from `pyproject` configurataion
---------
Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
`uv` logs a warning if the pyproject.toml does not contain a project
table.
There is not really much point in adding the table, but no downsides
either,
so lets just add the table to make `uv` happy.
Testing: Manual run of `RUST_LOG=warn ./mach run`
Fixes: #38761
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This is part of introducing the Ruff rule [flake8-annotations
(ANN)](https://docs.astral.sh/ruff/rules/#flake8-annotations-ann) into
the script_bindings folder.
Since `codegen.py` has 10k lines of code, the strategy is to introduce
the rule first while ignoring the `ANN` Ruff rule for `codegen.py`. We
will then gradually add type annotations slice by slice to ensure no new
errors occur outside of `ANN`.
Testing: `./mach test-wpt webidl`
---------
Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
This part of function strictly typed in python by adding ANN rule in
ruff, similiar to #38531.
Testing: `./mach test-tidy`
Fixes: Not related to any issues
---------
Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
This changes will introduce [flake8-annotations
(ANN)](https://docs.astral.sh/ruff/rules/#flake8-annotations-ann) for
python type annotation, this will make all thing related to function
strictly typed in python
This rule will start to affected this directory from now:
- /python -> Root directory
- /python/tidy
- /python/wpt
Testing: `./mach test-tidy`
Fixes: Not related to any issues
---------
Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
Introduce type checking with Pyrefly in `components/script_bindings`
This commit adds Pyrefly-based type checking to the
`components/script_bindings` directory. The primary goal is to catch
type inconsistencies early and reduce the likelihood of unexpected
runtime errors.
This change affects the `webidl` component, as these script bindings are
responsible for connecting WebIDL specifications to the Rust codebase.
Testing: `./mach test-wpt webidl`
Fixes: *Link to an issue this pull requests fixes or remove this line if
there is no issue*
---------
Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
This is the first stage of adopting Pyrefly. It introduces the Python
folder and focuses on fixing issues around it.
Testing: *Describe how this pull request is tested or why it doesn't
require tests*
Fixes: *Link to an issue this pull requests fixes or remove this line if
there is no issue*
---------
Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>