Eli Schwartz
2c71b63e77
more f-strings everywhere
...
pyupgrade didn't catch many .format() methods which were too complex
(e.g. multiline or applied to templates rather than string literals)
4 years ago
Jussi Pakkanen
40e8a67a83
Merge pull request #8706 from dcbaker/wip/2021-04/cython-language
...
1st class Cython language support
4 years ago
Jussi Pakkanen
d53ea7da2d
Fix macpkg generator import path. [skip ci]
4 years ago
Dylan Baker
0bc18f26a2
cython: Add an option for selecting python 3 vs python 2 output
4 years ago
Dylan Baker
0cb05004ca
docs: Add cython docs
4 years ago
Dylan Baker
a2fc2e2165
cython: Add a test for generated files
4 years ago
Dylan Baker
74ed27f776
cython: add 1 basic test
4 years ago
Dylan Baker
b9f33c2380
Add C compiler when using Cython
...
Since cython transpiles to C.
4 years ago
Dylan Baker
ec4d8143df
ninjabackend: generate cython compilation rules
4 years ago
Dylan Baker
80cdbe41bd
ninjabackend: cython doesn't use a linker
4 years ago
Dylan Baker
4d1cbd1b8a
compilers: Add cython file suffixes
4 years ago
Dylan Baker
cf17ef3867
environment: Add detection logic for cython
4 years ago
Dylan Baker
edf1a21722
compilers: Expose Cython compiler
4 years ago
Dylan Baker
e9681b463d
hack: compilers/cython: hardcode python 3 not 2
4 years ago
Dylan Baker
79e50caa7f
compilers: Add a cython Compiler
4 years ago
Dylan Baker
b6eb5c231c
build: Add type annotations for Generator
...
They're not 100% complete, but it's mostly there.
4 years ago
Daniel Mensinger
30e329aac9
typing: Fully annotate dependencies.framework
4 years ago
Daniel Mensinger
25875ae0d3
typing: Fully annotate dependencies.{detect,factory} + some other fixes
4 years ago
Daniel Mensinger
71906c4bf8
typing: Fully annotate dependencies.cmake
4 years ago
Daniel Mensinger
125566b329
typing: Fully annotate dependencies.platform
4 years ago
Daniel Mensinger
96473085e0
typing: Fully annotate dependencies.dub
4 years ago
Daniel Mensinger
6798bc8146
typing: Fully annotate dependencies.pkgconfig
4 years ago
Jussi Pakkanen
d13999f5b4
Merge pull request #8796 from xclaesse/wrapdbv2
...
wrap: Port to v2 protocol
4 years ago
Xavier Claessens
769fd50373
docs: Generate a table of all wrapdb releases
...
wrapdb CI will trigger Meson's CI to regenerate the list when
releases.json is updated.
4 years ago
Daniel Mensinger
240434b167
typing: Fully annotate dependencies.cuda
4 years ago
Daniel Mensinger
27bb5f536a
typing: mlog use StringProtocol
4 years ago
Daniel Mensinger
969ee9d85b
typing: Fully annotate dependencies.configtool
4 years ago
Daniel Mensinger
1d0bd562f1
typing: Fully annotate dependencies.coarrays
4 years ago
Dylan Baker
e0f62d1812
dependencies/detect: Add type annotations to find_external_dependency
4 years ago
Dylan Baker
6f562ed734
interpreterobjects: Fix type annotation for CustomTargetHolder
4 years ago
Dylan Baker
ff0fd7d44c
build: Add a type annotation to CustomTarget
4 years ago
Dylan Baker
b107171307
interpreterbase: Allow safely using mutable default values with typed_kwargs
...
It's really inconvenient to want a thing that is always a list, but not
be able to provide a default value of a list because of mutation. To
that end the typed_kwargs method now makes a shallow copy of the default
when using a `ContainerTypeInfo` as the type. This mean that using a
default of `[]` is perfectly safe.
4 years ago
Dylan Baker
8890a62499
interpreterbase: fix type annotations for typed_pos_args
...
It takes a tuple of any length, for optargs and varargs, not a tuple of
length 1
4 years ago
Xavier Claessens
62c53b834d
wrap: Port to v2 protocol
...
Fixes : #8754 .
4 years ago
Daniel Mensinger
df4d2bd247
typing: Fully annotate dependencies.base
4 years ago
Daniel Mensinger
f502a38d1c
typing: mlog: Simplify some typing with a TV_ variables
4 years ago
Daniel Mensinger
95b70bcb97
deps: Split dependencies.base
...
Split the Factory and dependency classes out
of the base.py script to improve maintainability.
4 years ago
Dylan Baker
201dc64226
add a couple more type annotations
4 years ago
Dylan Baker
145d92aa27
build: Use ImmutableSetProtocol for lru_cache'd value
...
To avoid mutation if possible.
4 years ago
Dylan Baker
cfb847a1f0
build: use typing.Mapping for lru_cached dicts
...
Thankfully the typing module provides us an immutable protocol for
mappings, so we don't have to write one ourselves.
4 years ago
Dylan Baker
113a159514
use an immutable list for an lru_cached functions
...
When mutable items are stored in an lru cache, changing the returned
items changes the cached items as well. Therefore we want to ensure that
we're not mutating them. Using the ImmutableListProtocol allows mypy to
find mutations and reject them. This doesn't solve the problem of
mutable values inside the values, so you could have to do things like:
```python
ImmutableListProtocol[ImmutableListProtocol[str]]
```
or equally hacky. It can also be used for input types and acts a bit
like C's const:
```python
def foo(arg: ImmutableListProtocol[str]) -> T.List[str]:
arg[1] = 'foo' # works while running, but mypy errors
```
4 years ago
Dylan Baker
f8be4f8fc7
adding a _typing module
...
this is a place that *must* only be imported inside a if
typing.TYPE_CHECKING block. It is a mixture of smoothing over thinigs
that moved from typing_extensions to typing in later python versions and
useful but typing only code.
This makes typing_extensions required for python versions older than
3.8 *when running mypy*. typing_extensions should *only* be imported
inside an `if typing.TYPE_CHECKING` block (include the new _typing.py
module) to ensure that it doesn't become a runtime dependency
4 years ago
Dylan Baker
023722b2c6
test cases/common/103 has header symbol: set c++ standard
...
On mac this appears to default to c++98, which in turn falls over with
boost that requires at least c++11
4 years ago
Jussi Pakkanen
99452dde26
Merge pull request #8812 from mensinda/cmakeToolchain
...
CMake toolchain file improvements (fixes #8293 )
4 years ago
Jussi Pakkanen
83581f7fc1
Do not delete workdir in case scan-build fails.
4 years ago
Xavier Claessens
4516b7a8a9
docs: Fix typo in github pages repo URL
4 years ago
Xavier Claessens
4dec7dbb71
ci: Automatically update website when pushing to master
4 years ago
Xavier Claessens
16c3f03394
typed_kwargs: Add since and deprecated annotations
4 years ago
Dylan Baker
6aef800ba8
modules/fs: Use typed_kwargs
4 years ago
Dylan Baker
521b92e499
interpreterbase: Add a function for type checking keyword arguments
4 years ago