Commit 6ee9adae authored by Maximilian Dolling's avatar Maximilian Dolling

improved python package from url detection

parent c1d9bbc0
......@@ -53,7 +53,7 @@ def get_python_libs(file_path=''):
while line:
if line[0] != '#' and line != '' and line[0:2] != '-r' and line != '\n':
stripped_down_line = line.strip().split('#')[0].replace(' ', '')
if stripped_down_line[0:4] == 'http':
if ('/' or ':') in stripped_down_line:
used_libs_without_stdlib_list.extend([{stripped_down_line: 'unknown'}])
elif '/' in stripped_down_line:
used_libs_without_stdlib_list.extend([{stripped_down_line: 'unknown'}])
......
......@@ -59,7 +59,7 @@ def get_python_libraries_license(libraries_dict):
license_dict['licenses'][lib] = 'Python-2.0'
continue
# handle unknown location
if lib[0:4] == 'http' or '.' in lib or '/' in lib:
if '.' in lib or '/' in lib or ':' in lib:
license_dict['unknowns'][lib] = 'unknown location'
continue
# handle unknown version
......
......@@ -272,7 +272,8 @@ report = {'name': project_name,
'report version': report_version,
'list used licenses': {'description': 'Generates a list of dependencies and their license.',
'result': {'license list': cumulated_licenses_dict,
'unknowns': unknowns}}}
'unknowns': unknowns},
'debug used libs': used_libs_dict}}
# create report
......
......@@ -36,7 +36,7 @@ tail -n +7 test/test_report.md > test/tmp_test_report.md
IS_CHK_SUM=$(sha512sum meta/ci-services-report.md | awk '{ print $1 }')
PASS_CHK_SUM=$(sha512sum test/tmp_test_report.md | awk '{ print $1 }')
rm test/tmp_test_report.md
#rm test/tmp_test_report.md
if [ "$IS_CHK_SUM" != "$PASS_CHK_SUM" ]; then
echo "Generated report does not equal the test template"
......
# ci-services
# This Software provides services to check and improve the source code quality of software-projects
#
# SPDX-FileCopyrightText: 2020 Helmholtz Centre Potsdam - GFZ German Research Centre for Geosciences Potsdam, Germany (https://www.gfz-potsdam.de/)
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version, complemented with
# the following provision:
# For the scientific transparency and verification of results obtained
# and communicated to the public after using a modified version of the
# work, You (as the recipient of the source code and author of this
# modified version, used to produce the published results in scientific
# communications) commit to make this modified source code available in
# a repository that is easily and freely accessible for a duration of
# five years after the communication of the obtained results.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from django.contrib.auth.mixins import UserPassesTestMixin
from django.shortcuts import redirect
from django.urls import reverse
import httpretty
......@@ -24,4 +24,5 @@ http://wxpython.org/Phoenix/snapshot-builds/wxPython_Phoenix-3.0.3.dev1820+49a88
# Same as 1st section, just here to show that you can put things in any order.
rejected
green
httpretty == 1.0.2
#
\ No newline at end of file
# Software Quality Report
> **Note:** This report is automatically generated by [ci-services](https://gitext.gfz-potsdam.de/software/services/fair/ci-services)
---
## Meta Data
**Software Name:** ci-services
**Software Location:** local
**Last Commit:** 0
**Report Time:** 0
**Report Version:** 0.4.1
---
## Completed Services
### list authors
> **Description: Lists all people that committed to this repository.**
* ci-services@gitext.gfz-potsdam.de
* mdolling@gfz-potsdam.de
### list used languages
> **Description: Detects used programming languages.**
|language|bytes of code|
|---|---|
|Dockerfile|0|
|HTML|0|
|Python|0|
|Ruby|0|
|Shell|0|
### list used licenses
> **Description: Generates a list of dependencies and their license.**
#### found licenses
|license|count|libraries|
|---|---|---|
|Apache 2.0|1|requests|
|GPL-3.0-or-later AND Apache-2.0 AND CC0-1.0 AND CC-BY-SA-4.0|1|reuse|
|MIT|2|PyYAML <br> stdlib-list|
|Python-2.0|10|datetime <br> importlib.util <br> json <br> os <br> pathlib <br> re <br> shutil <br> sys <br> time <br> unittest|
|mock|1|stdlib|
#### Unknown objects
**unknown language**
* src/services/apply-license/data/templates/dep5_template
* test/linter/pylintrc
* test/testfiles/unknown_language/test.testlanguage
**unknown license**
* Python / ./downloads/numpy-1.9.2-cp34-none-win32.whl / unknown location
* Python / Mopidy-Dirble / unsupported version modifier (~=1.1)
* Python / beautifulsoup4 / unknown version
* Python / coverage / unsupported version modifier (!=3.5)
* Python / docopt / unsupported version modifier (>=0.5.0)
* Python / green / unknown version
* Python / http://wxpython.org/Phoenix/snapshot-builds/wxPython_Phoenix-3.0.3.dev1820+49a8884-cp34-none-win_amd64.whl / unknown location
* Python / keyring / unsupported version modifier (>=4.1.1)
* Python / nose / unknown version
* Python / nose-cov / unknown version
* Python / rejected / unknown version
### reuse linter
> **Description: Prints the result of the [reuse](https://reuse.software/spec/) linter**
* Bad licenses:
* Deprecated licenses:
* Licenses without file extension:
* Missing licenses:
* Unused licenses:
* Used licenses: CC-BY-4.0, CC0-1.0, GPL-3.0-or-later
* Read errors: 0
* Files with copyright information: 68 / 68
* Files with license information: 68 / 68
Congratulations! Your project is compliant with version 3.0 of the REUSE Specification :-)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment