summaryrefslogtreecommitdiffstats
path: root/utils/scanpypi
Commit message (Collapse)AuthorAgeFilesLines
* utils/scanpypi: use archive file name to specify the extraction folderYegor Yefremov2018-11-021-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some packages have archive name that is different from package name. For example websocket-client's archive name is websocket_client-*.tar.gz. scanpypi expects the temporary extract folder to be: /tmp-folder/BR-package-name/PyPI-packagename-and-version In the case of websocket-client package the real extraction folder will be different from the expected one because of the '_' in the archive file name. Use archive file name instead of package name to specify the extraction folder. As the version is already part of this file, we don't need to specify it. Bonus: remove obsolete "return None, None" as the function doesn't return anything. OSError class doesn't provide "message" member, so replace it with "strerror". Fixes: https://bugs.busybox.net/show_bug.cgi?id=11251 Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Reviewed-by: Asaf Kahlon <asafka7@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* scanpypi: improve BSD licence handlingYegor Yefremov2018-10-111-2/+2
| | | | | | | | | | | | When used without spdx_lookup the BSD licence cannot be detected correctly because many Python packages just specify BSD without the exact version in their metadata. So add a special message warning the user instead of the licence id. Bonus: fix typo. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* scanpypi: place a warning into *.mk file if licence id couldn't be detectedYegor Yefremov2018-08-311-0/+2
| | | | | | | | | | If a license file could be found, but license id couldn't be detected place following warning into *.mk file: FOO_LICENSE = FIXME: license id couldn't be detected Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* scanpypi: rework download_package error handlingYegor Yefremov2018-06-151-5/+9
| | | | | | | | | | | | Some packages don't provide source archive but only a wheel file. In this case download variable is not defined. So define this variable at the very beginning and check whether it is None after searching for source archives in the metadata. Bonus: fix PEP8 issue with wrong indentation. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* scanpypi: add support for the new PyPI infrastructureYegor Yefremov2018-04-181-14/+15
| | | | | | | | | | | https://pypi.python.org URL has been changed to https://pypi.org. Package's JSON object now contains sha256 checksum, so use it instead of locally computed one. Change comments in the hash file accordingly. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* scanpypi: generate help text compliant to check-packageRicardo Martincoski2018-04-011-1/+1
| | | | | | | | | Each line must fit in <tab><2 spaces><62 chars>. The default width for textwrap.wrap() is 70, so explicit set it to 62. Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Cc: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* utils/scanpypi: don't hardcode python2Peter Korsgaard2018-04-011-1/+1
| | | | | | | | | | | | Commit 3a0c20c5309b (scanpypi: add support for Python3) adapted the script to work with python 3.x, but the shebang still said python2 making it unlikely to work on systems without python 2.x. Change it to just 'python' instead. Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* scanpypi: fix code styleRicardo Martincoski2018-03-131-1/+3
| | | | | | | | | | Fix these warnings: E401 multiple imports on one line Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Cc: Yegor Yefremov <yegorslists@googlemail.com> Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* utils/scanpypi: correctly handle license dirs in subdirs for .hash filesPeter Korsgaard2018-03-091-1/+1
| | | | | | | | | | | | | create_hash_file() used basename(licensefile) when it writes the entry for the license file in the .hash, which is obviously not correct when license file is locate in a sub directory. Instead copy the logic from __create_mk_license() to strip the directory prefix from the absolute filename instead. Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* Merge branch 'next'Peter Korsgaard2018-03-051-19/+28
|\ | | | | | | Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
| * scanpypi: fix licence detection handling for unknown licencesYegor Yefremov2018-02-261-1/+1
| | | | | | | | | | | | | | Check for match object not being None. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
| * scanpypi: fix Py2/3 conversion leftoverYegor Yefremov2018-02-261-1/+1
| | | | | | | | | | | | | | Use urlparse from six package. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
| * scanpypi: add support for Python3Yegor Yefremov2018-02-251-17/+26
| | | | | | | | | | | | | | | | The script was changed via modernize utility. The only manual made part was the handling of StringIO. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* | utils/scanpypi: fix 'downloas' typo in error messagePeter Korsgaard2018-03-011-1/+1
|/ | | | Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* scanpypi: fix code styleRicardo Martincoski2018-01-291-4/+9
| | | | | | | | | | | | | | | | | | | | Fix these warnings: E101 indentation contains mixed spaces and tabs E128 continuation line under-indented for visual indent E231 missing whitespace after ',' E261 at least two spaces before inline comment E302 expected 2 blank lines, found 1 E305 expected 2 blank lines after class or function definition, found 1 W191 indentation contains tabs Ignore these warnings: E402 module level import not at top of file Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Yegor Yefremov <yegorslists@googlemail.com> Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* scanpypi: ignore empty elements in package requirementsYegor Yefremov2018-01-261-1/+2
| | | | | | | | | | Depending on how setup.py reads requirements files empty elements can occur. This patch takes care, that such elements will be ignored and don't crash the scanpypi script. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Tested-by: Matt Weber <matthew.weber@rockwellcollins.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* scanpypi: get rid of commented lines and also strip the package stringsYegor Yefremov2018-01-181-0/+4
| | | | | Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* scanpypi: add support for licence files checksumsYegor Yefremov2018-01-151-4/+21
| | | | | | | | | | Store the list of detected licence files in the main object and automatically add their sha256 checksums when creating *.hash file. Bonus: fix wrong indentation. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* scanpypi: get license names from SPDX databaseYegor Yefremov2018-01-121-55/+79
| | | | | | | | | | | | Use spdx_lookup package to compare packages' license file texts with SPDX database. This feature is optional. Bonus: fix wrong indentation. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* utils/scanpypi: increase error message verbosityAlexey Roslyakov2017-12-181-3/+3
| | | | | | | | When package installation fails it is good to know what happened. Signed-off-by: Alexey Roslyakov <alexey.roslyakov@gmail.com> Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* utils/scanpypi: include LICENSE.RST to supported license filesAlexey Roslyakov2017-07-201-2/+2
| | | | | | Signed-off-by: Alexey Roslyakov <alexey.roslyakov@gmail.com> Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* utils/scanpypi: don't pass any arguments to main()Alexey Roslyakov2017-07-201-2/+2
| | | | | | | | | | | | 'if __name__ == "__main__"' idiom typically calls main function that doesn't take any arguments in most cases. We shouldn't pass any tuple to it. I've tested the script with python-idna-2.5 and now it works with this little change. Signed-off-by: Alexey Roslyakov <alexey.roslyakov@gmail.com> Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* tools: rename to 'utils'Thomas Petazzoni2017-07-011-0/+653
After some discussion, we found out that "tools" has the four first letters identical to the "toolchain" subfolder, which makes it a bit unpractical with tab-completion. So, this commit renames "tools" to "utils", which is more tab-completion-friendly. This has been discussed with Arnout and Yann. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
OpenPOWER on IntegriCloud