aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lib/recipetool/create_buildsys_python.py
AgeCommit message (Collapse)Author
2017-11-13recipetool: create: fix failure handling included dictspaule/recipetool-fix2Paul Eggleton
If a setup dict in a python setup.py file pulled in the contents of another dict (e.g. **otherdict), then we got an error when mapping the keys because the key is None in that case. Skip those keys to avoid the error (we pick up the values directly in any case). A quick reproducer for this issue: recipetool create https://files.pythonhosted.org/packages/source/p/pyqtgraph/pyqtgraph-0.10.0.tar.gz Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-12-16scripts: remove True option to getVar callsJoshua Lock
getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-08recipetool: fix encoding-related errors creating python recipesPaul Eggleton
Yet another instance of us expecting a string back from subprocess when in Python 3 what you get back is bytes. Just decode the output within run_command() so we avoid this everywhere. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-09-19recipetool: create: improve python recipe license handlingPaul Eggleton
Try to ensure that for Apache, GPL and LGPL where the values extracted from the "Classifiers" field may not be version-specific, if there is a versioned license in the free-form license field then use that instead. Also insert the free-form license field as a comment in the recipe for the user's reference. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-19recipetool: create: fix picking up name from local python source treePaul Eggleton
Make use of the extravalues dict to send back other variable values from the python handling plugin, and enable passing back PV and PN. This not only places variable values in the final recipe a bit more consistently with other types of source, it also allows the name and version to be picked up fron a local source tree and not just when the recipe is fetched from a remote URL that happens to have those in it. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-08recipetool: create: fix mapping python dependencies to python-dbg packagePaul Eggleton
When trying to map python module dependencies to the packages that provide them, if we're looking for .so files that satisfy dependencies then we need to exclude files found under the .debug directory, otherwise the dependency will get mapped to the python-dbg package which isn't correct. For example, this fixes creating a recipe for pyserial and not getting python-fcntl in RDEPENDS_${PN}, leading to errors when trying to use the serial module on the target. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-02scripts: python3: convert iterables to listsEd Bartosh
Converted return value of items() keys() and values() to lists when dictionary is modified in the loop and when the result is added to the list. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02scripts: Fix encoding errors for python3Ed Bartosh
Moved call of decode('utf-8') as close as possible to call of subprocess API to avoid calling it in a lot of other places. Decoded binary data to utf-8 where appropriate to fix devtool and recipetool tests in python 3 environment. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2016-06-02scripts: Replace basestring -> str for python3Ed Bartosh
Python 3 doesn't have basestring type as all string are unicode strings. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2016-06-02scripts: Fix deprecated dict methods for python3Ed Bartosh
Replaced iteritems -> items, itervalues -> values, iterkeys -> keys or 'in' Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2016-02-21recipetool: create: add additional extension mechanismsPaul Eggleton
Add a means of extending the dependency extraction for autotools and cmake. Note: in order to have this work, you need to have an __init__.py in the lib/recipetool directory within your layer along with the module implementing the handlers, and the __init__.py needs to contain: # Enable other layers to have modules in the same named directory from pkgutil import extend_path __path__ = extend_path(__path__, __name__) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-22recipetool: create: support extracting name and version from build scriptsPaul Eggleton
Some build systems (notably autotools) support declaring the name and version of the program being built; since we need those for the recipe we can attempt to extract them. It's a little fuzzy as they are often omitted or may not be appropriately formatted for our purposes, but it does work on a reasonable number of software packages to be useful. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-22recipetool: create: minor fix for potential issue in python handlingPaul Eggleton
If SRC_URI happened not to be in the pre-generated lines then this code would error out. This is unlikely to happen with the way the create code is structured at the moment, but handle it just in case. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12devtool: make plugin_init optionalEd Bartosh
So far all devtool and recipetool plugins were expected to have plugin_init function. This function is empty in most of plugins as they don't require initialisation. Making plugin_init optional would allow not having empty plugin_init in every plugin. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-01-23recipetool: add python dependency scanning supportChristopher Larson
This uses a standalone python script named `pythondeps` which now lives in scripts. It supports scanning for provided packages and imported modules/packages, the latter via the python ast. It's not perfect, and obviously conditional imports and try/except import blocks are handled naively, listing all the imports even if they aren't all used at once, but it gives the user a solid starting point for the recipe. Currently `python_dir` from setup.py isn't being handled in an ideal way. This is easily seen when testing the python-async package. There, the root of the project is the async package, so the root has __init__.py and friends, and the python provides scanning currently just assumes the basedir of that dir is the package name in this case, which is not correct. Forthcoming patches will resolve this. Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-01-23recipetool: add python buildsystem supportChristopher Larson
- Handles distutils & setuptools. - Supports pulling metadata from PKG-INFO, .egg-info, & setup.py (via two different mechanisms). - Doesn't handle python 3 yet. Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>