Commit Graph

14 Commits

Author SHA1 Message Date
Christian Clauss a5020857f3 Fix typos discovered by codespell 2021-10-10 16:12:25 -04:00
Xavier Claessens 709d151eb9 typed_kwargs: Fix when ContainerTypeInfo is used in a tuple
info.types could be a tuple like (str, ContainerTypeInfo()). That means
we have to check types one by one and only print error if none of them
matched.

Also fix the case when default value is None for a container type, it
should leave the value to None to be able to distinguish between unset
and empty list.
2021-10-09 18:13:34 -04:00
Eli Schwartz e8a85fa8a2
various python neatness cleanups
All changes were created by running

"pyupgrade --py3-only"

and committing the results. Although this has been performed in the
past, newer versions of pyupgrade can automatically catch more
opportunities, notably list comprehensions can use generators instead,
in the following cases:
- unpacking into function arguments as function(*generator)
- unpacking into assignments of the form x, y = generator
- as the argument to some builtin functions such as min/max/sorted

Also catch a few creeping cases of new code added using older styles.
2021-10-04 16:29:30 -04:00
Xavier Claessens ca866bcfc7 coredata: 0.59.1 -> 0.59.99 is a major version difference
Remove test_minor_version_does_not_reconfigure_wipe() because when run
during dev cycle that test reconfigure with .99 -> .100 which is
considered a major version change now. It is covered by a more efficient
internal test now anyway.

While at it, remove no-op `with Path(self.builddir):` statement, the
intention was clearly to set workdir.

Fixes: #9260
2021-09-21 18:09:12 +02:00
Dylan Baker bd691b847c interpreter: use python dunders instead of lock for unpicklability
This simplifies things for us, as we don't have to have threading
imported for no other reason, and we can remove the
`an_unpicklable_object` from the Interpreter and mesonlib, since there
was only one user of this.
2021-08-31 16:59:37 -07:00
Dylan Baker 042016a555 unittests: add a test to Interpreter is unpicklable
We want this, so let's test it.
2021-08-31 16:59:37 -07:00
Dylan Baker f073c3cfe1 environment: correctly handle cpu value aarch64_be
Fixes #9191
2021-08-30 10:41:12 -07:00
Dylan Baker 78f8a286d0 environment: add ppc -> ppc64 for aix to detect_cpu
This seems like an oversight, that we'd replace ppc with ppc64 on AIX
for the cpu_family, but not for the specific cpu.
2021-08-30 10:38:47 -07:00
Dylan Baker b8cdae7003 unittests: add tests for detect_cpu
Same thing, but for the more specific cases
2021-08-30 10:37:41 -07:00
Dylan Baker 84fff3521a unittests: Add a test case for detect_cpu_family
This should help prevent regressions.
2021-08-30 10:33:28 -07:00
Dylan Baker 11fbaf29d8 interpreter: fix cases of `KwargInfo(..., T, default=None)`
The correct way to mark these is `KwargInfo(..., (T, type(None)))`.
There's also a few cases of `(T, None)` which is invalid, as `None`
isn't a type
2021-08-27 14:54:29 -07:00
Dylan Baker aa895b383c interpreter: Add a helper for checking constrained inputs
This is quite valuable for enum-like inputs, where only a certain set
of values is allowed.
2021-08-27 14:49:23 -07:00
Dylan Baker a450f8c6bc interenaltests: Add some version strings with ansi escapes in them
AS we've run into a few programs using ansi escapes in their version
outputs, we'd like to test them as well.
2021-07-30 10:19:28 -07:00
Xavier Claessens 7eb4c23156 Split run_unittests.py file 2021-07-26 15:19:13 -04:00