Commit Graph

20 Commits

Author SHA1 Message Date
Eli Schwartz 0bb1647fd1
move various bits of type-checking only code to TYPE_CHECKING blocks
Mostly detected with flake8-type-checking. Also quote T.cast() first
arguments, since those are not affected by future annotations.
2023-07-19 18:31:37 -04:00
Jussi Pakkanen d391e5281c
Merge pull request #11742 from xclaesse/link-whole-cases
Fix niche cases when linking static libs
2023-07-05 01:10:58 +03:00
Dylan Baker 5d16bd5308 modules/rust: Add a keyword argument to pass extra args to the rust compiler
This may be necessary to, for example, stop rustc complaining about
unused functions
2023-06-27 11:53:18 -07:00
Dylan Baker c5b16ab8b9 modules/rust: Add a machine file property for extra clang args with bindgen
It's currently impossible to inject extra clang arguments when using
bindgen, which is problematic when cross compiling since you may need
critical arguments like `--target=...`. Because such arguments must be
passed after the `--` it's impossible to inject them currently without
going to something like a wrapper script.

Fixes: #11805
2023-06-27 11:53:18 -07:00
Dylan Baker 43f24060f3 modules/rust: Add a `link_with` kwarg to the test method
This was requested by Mesa, where a bunch of `declare_dependency`
objects are being created as a workaround for the lack of this keyword
2023-06-27 11:53:18 -07:00
Xavier Claessens 01949df4f6 build: Don't do a deep copy of kwargs
It seems to only be used by the Rust module now, and it already does a
copy.
2023-05-01 12:57:45 -04:00
Dylan Baker 73981b2c34 modules/rust: Add -DNDEBUG to bindgen if b_ndebug is false
Otherwise bindgen may generate different behavior than the compiled C
code actually has.
2023-04-21 15:18:56 +05:30
Xavier Claessens 0f67913dee typed_kwargs: Extend since_values and deprecated_values for types 2023-03-04 14:19:27 -05:00
Eli Schwartz 680b5ff819
treewide: add future annotations import 2023-02-01 17:01:30 -05:00
Dylan Baker a67f04eb23 modules/rust: Fix annotation for _bindgen_bin
Which suffers from the same issue as the gnome module
2023-01-10 09:53:22 -08:00
Dylan Baker d49e6bc038 modules/rust: Add support for dependencies in bindgen
This is needed for cases where we need external C headers, which are
passed to clang.
2022-12-05 12:23:55 -08:00
Dylan Baker 24b0024065 modules/rust: Use `__future__.annotations` 2022-12-05 12:22:09 -08:00
Dylan Baker 33ba2c6f95 modules/rust: use the shared DEPENDENCIES_KW 2022-12-05 12:22:08 -08:00
Dylan Baker bb875280b6 modules/rust: Add support for string include_directories
Which we support for basically every other case, but not this one.
2022-12-05 15:20:09 -05:00
Dylan Baker 010f525cc5 interpreter: move TEST_KW from interpreter.py to type_checking.py
Since it's also used in the rust module, it should be in a common place.
Also rename from `TEST_KWARGS` to `TEST_KWS`, which is more in line with
the `*_KW` naming scheme used in the type_checking module.
2022-12-05 15:20:09 -05:00
Dylan Baker c642a7693e modules/rust: stabilize
Mesa is using the rust module in production, so we should stabilize
it.
2022-11-19 23:00:53 +02:00
Dylan Baker 8526b8c1a9 modules/rust: Also include generated sources for tests
When we create a test from a non-executable, we weren't copying the
generated sources, just the static ones.
2022-11-17 19:07:15 -05:00
Dylan Baker 20d76b8353
pylint: enable unnecessary-comprehension 2022-10-03 00:14:43 -04:00
Alf Henrik Sauge 28dff2ca6d Fix indentation issues reported by flake8, requiring code restructuring
Strictly speaking code restructuring isn't needed, but making this PEP8
compliant results in indentation of the code that reduces the
readability. By moving the offending code on the outside of the method
call, the readability is maintained.
2022-08-26 17:12:40 -04:00
Dylan Baker a78992dd81 interpreter: move handling of module stability to interpreter
Thanks to `ModuleInfo`, all modules are just named `foo.py` instead of
`unstable_foo.py`, which simplifies the import method a bit. This also
allows for accurate FeatureNew/FeatureDeprecated use, as we know when
the module was added and if/when it was stabilized.
2022-08-17 16:25:36 -04:00