Commit Graph

11 Commits

Author SHA1 Message Date
Ralf Gommers 6834224d72 Fix `ERROR: no toolchain found` when run from unittests
[skip actions]
2023-05-05 12:23:52 -04:00
Ralf Gommers 91c7e79519 Use release buildtype in Cython tests, and skip unless ninja backend
This matches the tests for Python extensions.

Also include some other cleanups to these `meson.build` files:

Adding `python_dep` is no longer needed, this is automatic now.
Use a single line for `import('python').find_installation()`,
because the result of `import('python')` by itself is not used
for anything.
2023-05-05 12:23:52 -04:00
Eli Schwartz 94a190baa2
cython: add unittest to verify that depfiles work 2023-02-10 02:16:54 -05:00
Thomas Li 9b999ddc87 BUG: Fix generated sources not being included as dependencies in cython transpilation 2023-01-15 16:59:47 -05:00
Tristan Partin c65abc568c Add support for cython_args
cython_args was previoously ignored by Meson.
2022-03-23 15:44:01 -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
Dylan Baker 68c23a6120 Add option to to transpile Cython to C++
This patch adds a new meson built-in option for cython, allowing it to
target C++ instead of C as the intermediate language. This can, of
course, be done on a per-target basis using the `override_options`
keyword argument, or for the entire project in the project function.

There are some things in this patch that are less than ideal. One of
them is that we have to add compilers in the build layer, but there
isn't a better place to do it because of per target override_options.
There's also some design differences between Meson and setuptools, in
that Meson only allows options on a per-target rather than a per-file
granularity.

Fixes #9015
2021-09-24 22:56:46 +03:00
Dylan Baker 630a41eb81 ninjabackend: use get_subdir() instead of subdir attribute for cython
As this works correctly for CustomTarget, CustomTargetIndex, and
GeneratedList, but .subdir doesn't work for CustomTargetIndex.
2021-08-03 14:03:33 -07:00
Ralf Gommers bc6df45663 Fix issue with generated Cython code in a subdir
This is a follow-up to gh-8706, which contained the initial fix
to ninjabackend.py but somehow lost it. This re-applies the fix
and adds a test for it.

Without the fix, the error is:

  ninja: error: 'ct2.pyx', needed by 'libdir/ct2.cpython-39-x86_64-linux-gnu.so.p/ct2.pyx.c',
  missing and no known rule to make it
2021-06-14 09:36:28 -07:00
Dylan Baker a2fc2e2165 cython: Add a test for generated files 2021-06-07 09:17:40 -07:00
Dylan Baker 74ed27f776 cython: add 1 basic test 2021-06-07 09:17:40 -07:00