aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/mpi.py
AgeCommit message (Collapse)AuthorFilesLines
2023-08-11treewide: automatic rewriting of all comment-style type annotationsEli Schwartz1-1/+1
Performed using https://github.com/ilevkivskyi/com2ann This has no actual effect on the codebase as type checkers (still) support both and negligible effect on runtime performance since __future__ annotations ameliorates that. Technically, the bytecode would be bigger for non function-local annotations, of which we have many either way. So if it doesn't really matter, why do a large-scale refactor? Simple: because people keep wanting to, but it's getting nickle-and-dimed. If we're going to do this we might as well do it consistently in one shot, using tooling that guarantees repeatability and correctness. Repeat with: ``` com2ann mesonbuild/ ```
2023-07-19fix implicit_reexport issues and enforce them going forwardEli Schwartz1-1/+2
This detects cases where module A imports a function from B, and C imports that same function from A instead of B. It's not part of the API contract of A, and causes innocent refactoring to break things.
2023-06-26dependencies: switch the delayed-import mechanism for custom dependenciesEli Schwartz1-0/+3
Simply store the module it is expected to be found in. That module then appends to the packages dict, which guarantees mypy can verify that it's got the right type -- there is no casting needed.
2023-02-01treewide: add future annotations importEli Schwartz1-0/+1
2022-12-11typing: fix some broken Sequence annotationsEli Schwartz1-2/+2
T.Sequence is a questionable concept. The idea is to hammer out generic, maximally forgiving APIs that operate on protocols, which is a fancy way of saying "I don't care if you use tuples or lists". This is rarely needed, actually, and in exchange for this fancy behavior you get free bugs. Specifically, `somestr` is of type `T.Sequence[str]`, and also `somestr[0]` is another string of type you guessed it. It's ~~turtles~~ strings all the way down. It's worth noting that trying to code for "protocols" is a broken concept if the contents have semantic meaning, e.g. it operates on "the install tags of this object" rather than "an iterable that supports efficient element access". The other way to use T.Sequence is "I don't like that T.List is invariant, but also I don't like that T.Tuple makes you specify exact ordering". This sort of works. In fact it probably does work as long as you don't allow str in your sequences, which of course everyone allows anyway. Use of Sequence has cute side effects, such as actually passing lists around, knowing that you are going to get a list and knowing that you need to pass it on as a list, and then having to re-allocate as `list(mylist)` "because the type annotations says it could be a str or tuple". Except it cannot be a str, because if it is then the application is fatally flawed and logic errors occur to disastrous end user effects, and the type annotations: - do not enforce their promises of annotating types - fail to live up to "minimal runtime penalties" due to all the `list()` Shun this broken concept, by hardening the type annotations. As it turns out, we do not actually need any of this covariance or protocol-ism for a list of strings! The whole attempt was a slow, buggy waste of time.
2022-11-30pylint: enable the set_membership pluginDylan Baker1-1/+1
Which adds the `use-set-for-membership` check. It's generally faster in python to use a set with the `in` keyword, because it's a hash check instead of a linear walk, this is especially true with strings, where it's actually O(n^2), one loop over the container, and an inner loop of the strings (as string comparison works by checking that `a[n] == b[n]`, in a loop). Also, I'm tired of complaining about this in reviews, let the tools do it for me :)
2022-11-29Fix crash when toolchain is missingSmallWood-D1-1/+1
Add a MissingCompiler class returned by compiler detecting methods intead of None - accessing such an object raises a DependencyException Fixes #10586 Co-authored-by: duckflyer <duckflyer@gmail.com>
2021-06-17move base class for system dependencies into base.pyEli Schwartz1-2/+1
In accordance with review comments; it's small enough this seems fitting.
2021-06-14dependencies: Use the SystemDependencyDylan Baker1-4/+5
This fixes these dependencies, which currently return the name of the dependency as the type. Fixes #8877
2021-06-09typing: Rename some variablesDaniel Mensinger1-8/+7
2021-06-06typing: Fully annotate dependencies.{detect,factory} + some other fixesDaniel Mensinger1-2/+3
2021-06-03deps: Split dependencies.baseDaniel Mensinger1-2/+4
Split the Factory and dependency classes out of the base.py script to improve maintainability.
2021-01-11dependencies/mpi: Add a type annotationDylan Baker1-1/+1
Some change in this series causes mypy to notice that this isn't annotated, and it makes a wrong assumption.
2020-09-08typing: fix dependencies for new follow_importsDaniel Mensinger1-2/+5
2020-09-08typing: ignore error because of untyped decoratorDaniel Mensinger1-1/+1
2020-09-02dependencies/mpi: add missing annotationDylan Baker1-3/+3
2020-03-19mpi: Use a factory functionDylan Baker1-196/+148
This makes use of proper ConfigTool and PkgConfig dependencies rather than one big ExternalDependency that internally creates other dependencies and then copies their attributes.
2020-01-29dependencies: Make Dependency initializer signatures matchDylan Baker1-1/+1
Currently PkgConfig takes language as a keyword parameter in position 3, while the others take it as positional in position 2. Because most dependencies don't actually set a language (they use C style linking), using a positional argument makes more sense. ExtraFrameworkDependencies is even more different, and duplicates some arguments from the base ExternalDependency class. For later changes I'm planning to make having all of the dependencies use the same signature is really, really helpful.
2020-01-08types: import typing as T (fixes #6333)Daniel Mensinger1-5/+5
2019-12-19dependencies: refactor to use methods properlyMichael Hirsch, Ph.D1-39/+44
2019-11-25dep: MPI make work for intel-cl and improve robustnessMichael Hirsch, Ph.D1-0/+274
optimize intelMPI variables mpi: extract version from non-OpenMPI wrapper