aboutsummaryrefslogtreecommitdiff
path: root/test cases/python
AgeCommit message (Collapse)AuthorFilesLines
2023-08-14Python: Add 'limited_api' kwarg to extension_moduleAndrew McNulty6-0/+129
This commit adds a new keyword arg to extension_module() that enables a user to target the Python Limited API, declaring the version of the limited API that they wish to target. Two new unittests have been added to test this functionality.
2023-08-08tests: fix "4 custom target depends extmodule" with Python 3.8+ on WindowsChristoph Reiter1-0/+3
Since CPython 3.8 .pyd files no longer look in PATH for loading libraries, but require the DLL directory to be explicitely added via os.add_dll_directory(). This resulted in those tests failing with 3.8+ on Windows. Add the DLL build directory with os.add_dll_directory() to fix them. This was never noticed in CI because it only uses Python 3.7 and the MSYS2 CPython still used the old behaviour until now.
2023-05-05Use release buildtype in Cython tests, and skip unless ninja backendRalf Gommers2-6/+5
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-02tests: add a python test for bytecode compilationEli Schwartz10-3/+58
Some tweaks are added to the test case so that it supports python2 as well.
2023-05-02python module: add an automatic byte-compilation stepEli Schwartz2-2/+3
For all source `*.py` files installed via either py.install_sources() or an `install_dir: py.get_install_dir()`, produce `*.pyc` files at install time. Controllable via a module option.
2023-04-23fix python.version() not working in some casesCharles Brunet1-0/+3
import('python').find_installation('python').version() causes exception because of a missing initialization, when `find_installation()` receives a name or a path.
2023-04-11fix various spelling issuesJosh Soref1-1/+1
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-03-28test that python modules nominally compile without warningsEli Schwartz1-1/+1
Because we poke around with the dependency, so we might introduce some, and have at least once.
2023-03-20backends: add a new "none" backendEli Schwartz2-0/+7
It can only be used for projects that don't have any rules at all, i.e. they are purely using Meson to: - configure files - run (script?) tests - install files that exist by the end of the setup stage This can be useful e.g. for Meson itself, a pure python project.
2022-11-14tests: fix edge case where non-default python is used, by skipping itEli Schwartz1-5/+12
In a couple of python module tests, we try to test things that rely on the default python being the same one we look up in the python module. This is unsolvable for the deprecated python3 module, as it actually uses the in-process version of python for everything. For the python module, we could actually look up the default system python instead of the one we are running with, but then we wouldn't be testing the functionality of that alternative python... and also the install manifest tests would see files installed for the wrong version of python, and report a combination of missing+extra files... Solve both tests by just skipping the parts we cannot check.
2022-09-19python module: allow specifying the pure kwarg in the installation objectEli Schwartz2-1/+15
Fixes #10523
2022-07-08implement the new preserve_path kwarg for install_data tooEli Schwartz9-0/+17
Primarily interesting to me because it is then available for the python module's install_sources method. Based on the new feature in install_headers.
2022-06-19python module: implicitly add python dep to extensionsEli Schwartz3-3/+0
If there isn't a preexisting dependency on python, append one. It's almost assuredly needed, so just do the right thing out of the box.
2022-03-18tests: make python2 dependency on 32-bit windows non-fatalEli Schwartz1-6/+18
Apparently Azure provides 64-bit python2 when we try to test 32-bit, and that breaks everything on the 32-bit test runner. I don't understand the environment setup, and that runner is disappearing soon anyway. Hopefully this shuts up the known breakage.
2022-03-17tests: don't skip python version tests if python is found but its dep is brokenEli Schwartz1-10/+6
If a version of python is installed for testing against, we should assume it's actually important to test against it.
2022-03-16unittests: convert python tests to project testsEli Schwartz6-0/+122
Perhaps when this test case was originally created, project tests could not use a matrix of options? This is certainly possible today, so don't write special unittest handling for this instead. This adds proper visibility into what gets run and what doesn't. Now we know which python executables got tested and which got skipped.
2021-10-08python: Add platlibdir and purelibdir optionsXavier Claessens3-0/+16
2021-09-29tests: take into account Debian Python pathsFilipe Laíns1-2/+2
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-08-18tests: python module should install files correctlyEli Schwartz7-3/+51
- default to python site-packages - subdir to site-packages/subdir - arbitrary install_dir
2021-08-16interpreter: Fix holder_map not being updated when subproject failsXavier Claessens2-0/+9
Fixes: #9038
2021-08-15Revert "interpreter: Fix holder_map not being updated when subproject fails"Jussi Pakkanen2-9/+0
This reverts commit 566383c727219fc20cf1c90c0fe7dae4bcac5c96.
2021-08-09interpreter: Fix holder_map not being updated when subproject failsXavier Claessens2-0/+9
Fixes: #9038
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz2-2/+2
performed by running "pyupgrade --py36-plus" and committing the results
2020-07-12simplify/correct test logicMichael Hirsch3-33/+36
before this, tests were being skipped on Ubuntu 20.04 with Anaconda Python Now, all 5 tests success
2020-07-12some python test cases don't care about backend, so run them in any caseMichael Hirsch3-14/+29
2020-07-12raise SystemExit() generally preferred to sys.exit(1)Michael Hirsch5-20/+9
2020-07-12c lang not needed for this testMichael Hirsch1-1/+2
2020-07-12setuptools is not stdlib, but distutils isMichael Hirsch1-1/+1
2019-10-20Disable extension module tests with Python 3.8 and VS2015.Jussi Pakkanen1-0/+5
2019-06-12modules/python: add a modules keyword argumentDylan Baker1-0/+7
This mirrors the modules keyword argument that some dependencies (such as qt and llvm) take. This allows an easier method to determine if modules are installed.
2019-04-03modules/python: Report program found in find_installation()Dylan Baker1-1/+1
Currently find_installation is silent, which is pretty annoying. Let's log it.
2018-12-12tests: Add tests for the python moduleDylan Baker24-0/+403
This doesn't touch everything as it's just based on the python3 module tests, ported to the python module. It's still better than the one very basic test in the unit test module.
2018-05-03python module: Move tests to test cases/unitNirbheek Chauhan5-105/+0
The tests are only run via unit tests, so that's where they should be.
2018-04-09[fixup]: Rename find to find_installationMathieu Duponchelle1-1/+1
2018-04-06Implement a generic python moduleMathieu Duponchelle5-0/+105
With contributions from HÃ¥vard Graff