summaryrefslogtreecommitdiff
path: root/mesonbuild/modules/python.py
AgeCommit message (Collapse)Author
2019-04-21Can run argument strings with internal Python. Closes #5217.Jussi Pakkanen
2019-04-03modules/python: normalize output for disabled by featureDylan Baker
Instead of printing a message about how python was skipped, print the normal 'Program foo found:' message, with a "disabled by feature" message added.
2019-04-03modules/python: Do disabler check after validating inputsDylan Baker
This will help developers not introduce bugs (say putting 3 instead of "python3"), and will be useful for the next patch.
2019-04-03modules/python: Report program found in find_installation()Dylan Baker
Currently find_installation is silent, which is pretty annoying. Let's log it.
2019-04-02modules/python: Remove spaces around keyword argumentsDylan Baker
just small style cleanups.
2019-03-18dependencies: fix Python linking for windows+mingwNacho García
For dynamic linking, some mingw releases don't link correctly with pythonXX.lib in all cases. This patch forces mingw to link against pyhthonXX.dll instead of the .lib file, which has a better compatiblity. Note that msys 1.0 old platform is detected as windows instead of 'mingw'
2019-02-04python: don't require a Python lib in case we don't link against it. Fixes #4841Christoph Reiter
In case extensions aren't linked against libpython we can't assume one exists at all or is available in a known directory.
2019-01-16Fix flake8 errorsXavier Claessens
2019-01-02Remove cross_info; cross file is parsed up front and discardedJohn Ericson
2019-01-02Avoid exception looking for python on windows if the launcher (py.exe) is ↵guruDanny67
not installed
2018-12-12modules/python: Add path methodDylan Baker
This would normally be exposed by the ExternalProgramHolder, but wasn't due to the implementation of the PythonInstallation module. Because of that I've duplicated the method so that we can add the FeatureNew decorator. Fixes #4070
2018-12-12modules/python: Refactor the PythonInstallation objectDylan Baker
Into a generic interpreter object. This isn't a module, it's an object returned by a module, it also happens to be a special case of an ExternalProgram, which is a normal interpreter object. Let's treat it like one.
2018-12-12modules/python: don't inherit from InterpreterObjectDylan Baker
Because ExternalProjectHolder already does
2018-12-12modules/python: Don't pass instance variable to instance methodDylan Baker
2018-12-10python: only link extension modules against libpython when distutils does ↵Christoph Reiter
too. Fixes #4117 Windows requires things to be linked, on macOS distutils doesn't link by default. On Linux etc. things are not so clear, some distros like Debian patch distutils to not link, some don't. In addition the manylinux wheels spec prohibits linking against libpython and upstream is thinking about changing the default: https://bugs.python.org/issue34814 Call into distutils to figure out what distutils does and in case it doesn't link against libpython replace the passed in Python dependency with a partial one.
2018-12-05modules/python: Do not override link_args with None largsPhilippe Normand
None is not iterable so it would trigger a TypeError later when link_args are passed on to CompilerArgs.extend_direct().
2018-11-14modules/python: Allow use of the native fileDylan Baker
Currently this just allows setting a "python" variable that always overrides, probably we want to have the option for "python2" and "python3" as well.
2018-10-23Add 'disabler' argument to functions returning not-found objectsXavier Claessens
When dependency(), find_library(), find_program(), or python.find_installation() return a not-found object and disabler is true, they return a Disabler object instead.
2018-09-18python module: Only run command once to get all infoXavier Claessens
2018-09-17Fix version check when passing feature option to find_installation()Xavier Claessens
2018-09-16find_installation: Add support for feature option in required kwargXavier Claessens
Closes: #4165.
2018-08-09Make python module more robustDavid Seifert
* Lookup is now performed according to the following order: 1. use `pkg-config` with `PKG_CONFIG_LIBDIR=LIBPC` from python 2. use plain `PKG_CONFIG_{LIBDIR,PATH}` from the environment 3. try to extract the information from SYSCONFIG The second step is necessary for relocated python installations and cross compilation scenarios, where the value of `LIBPC` might be wrong.
2018-07-27python.find_installation: only try to find python with the py launcher if it ↵Christoph Reiter
isn't in PATH Meson tries to find the interpreter path through the "py" launcher on Windows in all cases which breaks if meson is run under MSYS2 and an official CPython is installed as well. MSYS2 Python doesn't install a py launcher which results in meson finding the system one instead even though python2/python3 is in PATH. Always check if the interpreter name is in PATH before falling back to checking the py launcher.
2018-07-02FeatureNew: Fix method names for some feature checksNirbheek Chauhan
2018-07-02Remove permittedSnippetKwargs, snippets are not specialNirbheek Chauhan
All we needed to do was change _get_callee_args() to also support snippets.
2018-06-20dependencies: Don't assume self.compiler is a C compilerNirbheek Chauhan
All dependencies were using find_library, has_header, get_define, etc on self.compiler assuming that it's a compiler that outputs and consumes C-like libraries. This is not true for D (and in the future, for Rust) since although they can consume C libraries, they do not use the C ecosystem. For such purposes, we now have self.clib_compiler. Nothing uses self.compiler anymore as a result, and it has been removed.
2018-06-01Add 0.46.0 featuresSalamandar
2018-05-04Interpreter: don't flatten the arguments of various methodsMathieu Duponchelle
this fixes eg set_variable('foo', ['bar', 'baz']), which was previously erroring out complaining about the number of arguments. Closes #1481
2018-05-03python module: make it work with pypyMathieu Duponchelle
pypy installations don't usuallyy ship with pkg-config files, we thus need to replicate what their version of distutils does. In addition, we also try our best to build against other pythons that do not have pkg-config files.
2018-04-21modules/python: add some more options around path and config_varsHavard Graff
What is actually defined here varies wildly on different python-versions for different platforms. On my python2.7 on Windows len(sysconfig.get_config_vars()) returns 17, whereas in my Ubuntu that number is 517! Hence it is useful to be able to check which keys are available, as well as allowing specifying a default option.
2018-04-18Made Python module match the new init interface.Jussi Pakkanen
2018-04-09[fixup]: various minor tweaks found while documentingMathieu Duponchelle
2018-04-09[fixup]: Rename find to find_installationMathieu Duponchelle
2018-04-09[fixup]: Fix python2 detection and unit testMathieu Duponchelle
2018-04-07[fixup]: trivial fix after rebaseMathieu Duponchelle
2018-04-07[fixup]: extension_module: allow specifying install_dir OR subdirMathieu Duponchelle
2018-04-07[fixup]: Address PKG_CONFIG env vars commentsMathieu Duponchelle
2018-04-06Implement a generic python moduleMathieu Duponchelle
With contributions from Håvard Graff