Coder Social home page Coder Social logo

fossology-python's Introduction

FOSSology

Gitpod ready-to-code GPL-2.0 CII Best Practices Coverage Status Slack Channel GitHub release (latest by date) YouTube Channel REUSE status

About

FOSSology is an open source license compliance software system and toolkit. As a toolkit, you can run license, copyright, and export control scans from the command line. As a system, a database and web UI are provided to give you a compliance workflow. In one click you can generate an SPDX file or a ReadMe with all the copyrights notices from your software. FOSSology deduplication means that you can scan an entire distro, rescan a new version, and only the changed files will get rescanned. This is a big time saver for large projects.

Check out Who Uses FOSSology!

FOSSology does not give legal advice. https://fossology.org/

Requirements

The PHP versions 7.3 and later are supported to work for FOSSology. FOSSology requires Postgresql as the database server and apache httpd 2.6 as the web server. These and more dependencies are installed by utils/fo-installdeps.

To install Python dependencies, run install/fo-install-pythondeps.

Installation

FOSSology should work with many Linux distributions.

See https://github.com/fossology/fossology/releases for source code download of the releases.

For installation instructions see Install from Source page in Github Wiki

Docker

FOSSology comes with a Dockerfile allowing the containerized execution both as a single instance or in combination with an external PostgreSQL database. Note: It is strongly recommended to use an external database for production use since the standalone image does not take care of data persistency.

A pre-built Docker image is available from Docker Hub and can be run using the following command:

docker run -p 8081:80 fossology/fossology

The docker image can then be used using http://IP_OF_DOCKER_HOST:8081/repo user fossy password fossy.

If you want to run Fossology with an external database container, you can use Docker Compose, via the following command:

docker-compose up

Docker Compose is a tool that allows you to define and run multi-container applications using a YAML file. FOSSology provides a docker-compose.yml file that defines three services: scheduler, web, and db.

The scheduler service runs the FOSSology scheduler daemon, which handles the analysis tasks. The web service runs the FOSSology web server, which provides the web interface. The db service runs a PostgreSQL database server, which stores the FOSSology data.

The docker-compose up command starts all the three services at once.

The FOSSology web service allows you to configure its database connection using some environment variables. These variables are defined in the docker-compose.yml file under the environment key.

  • FOSSOLOGY_DB_HOST: Hostname of the PostgreSQL database server. An integrated PostgreSQL instance is used if not defined or set to localhost.
  • FOSSOLOGY_DB_NAME: Name of the PostgreSQL database. Defaults to fossology.
  • FOSSOLOGY_DB_USER: User to be used for PostgreSQL connection. Defaults to fossy.
  • FOSSOLOGY_DB_PASSWORD: Password to be used for PostgreSQL connection. Defaults to fossy.

You can change them if you want to use a different database server or credentials.

Vagrant

FOSSology comes with a VagrantFile that can be used to create an isolated environment for FOSSology and its dependencies.

Pre-requisites: Vagrant >= 2.x and Virtualbox >= 5.2.x

Steps:

git clone https://github.com/fossology/fossology
cd fossology/
vagrant up

The server must be ready at http://localhost:8081/repo/. The login credentials are:

user: fossy
pass: fossy

Test Instance

For trying out FOSSology quickly, a test instance is also available at https://fossology.osuosl.org/. This instance can be deleted or reinstalled at any time, thus it is not suitable for serving as your productive version. The login credentials are as follows:

Username: fossy
Password: fossy

Note: The test instance is not up to date with the latest release. The instance will reset every night at 2 am UTC and all the user uploaded data will be lost.

Quick dev prototype with GitPod.io

FOSSology is ready to be coded on GitPod.io. To use it, you would need to setup an account. You can directly use the following button to launch the project on GitPod.io: Link to Gitpod

Once in, you should see 2 terminals, one running FOSSology scheduler and one running the installation.

Handy scripts/aliases

For the ease of usability, following aliases/scripts have been defined and can be used:

  • conffoss: This will reconfigure cmake with all variables
  • buildfoss: This will build the FOSSology using cmake
  • installfoss: This will install FOSSology
  • fossrun: Run the FOSSology scheduler
  • pg_stop: Stop PostgreSQL server
  • pg_start: Start PostgreSQL server

Documentation

We are currently migrating our documentation to Github. At this stage, you can find general documentation at: https://www.fossology.org/get-started/basic-workflow/ and developer docs on Github Wiki and https://fossology.github.io/

Support

Mailing lists, FAQs, Release Notes, and other useful info are available by clicking the documentation tab on the project website. We encourage all users to join the mailing list and participate in discussions. There is also a #fossology IRC channel on the freenode IRC network if you'd like to talk to other FOSSology users and developers. See Contact Us

Contributing

We really like contributions in several forms, see CONTRIBUTING.md

Licensing

The original FOSSology source code and associated documentation including these web pages are Copyright (C) 2007-2012 HP Development Company, L.P. In the past years, other contributors added source code and documentation to the project, see the NOTICES file or the referring files for more information.

Any modifications or additions to source code or documentation contributed to the FOSSology project are Copyright (C) the contributor, and should be noted as such in the comments section of the modified file(s).

FOSSology is licensed under GPL-2.0

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; version 2 of the License

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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Exception:

All of the FOSSology source code is licensed under the terms of the GNU General Public License version 2, with the following exceptions:

libfossdb and libfossrepo libraries are licensed under the terms of the GNU Lesser General Public License version 2.1, LGPL-2.1.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License.

This library 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
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301  USA

Please see the LICENSE file included with this software for the full texts of these licenses.

fossology-python's People

Contributors

alpianon avatar dependabot[bot] avatar deveaud-m avatar fvalla-mta avatar gmishx avatar thsetz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fossology-python's Issues

Conditional foss_cli testing

Github workflows can last a long time, especially when the whole API is tested against a running Fossology service.

To avoid starting all the tests when working on the CLI, conditional workflows shall be defined:

  • create a new clitests.yml action specification
  • make sure this workflow only runs when changes are performed on the cli relevant files using file-changes-action
  • additionally make sure this conditional workflow only runs in the pull request context, see github-context for more information

When changes are merged into master, all tests must run.

API incompatibility with latest fossology release + fossology-python's release policy

Today I installed fossology-python on a new machine but while testing it I got the following error when trying to upload a package:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/fossology/uploads.py", line 232, in upload_file
    upload = self.detail_upload(response.json()["message"], wait_time)
  File "/usr/local/lib/python3.7/dist-packages/tenacity/__init__.py", line 333, in wrapped_f
    return self(f, *args, **kw)
  File "/usr/local/lib/python3.7/dist-packages/tenacity/__init__.py", line 423, in __call__
    do = self.iter(retry_state=retry_state)
  File "/usr/local/lib/python3.7/dist-packages/tenacity/__init__.py", line 360, in iter
    return fut.result()
  File "/usr/lib/python3.7/concurrent/futures/_base.py", line 425, in result
    return self.__get_result()
  File "/usr/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.7/dist-packages/tenacity/__init__.py", line 426, in __call__
    result = fn(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/fossology/uploads.py", line 62, in detail_upload
    return Upload.from_json(response.json())
  File "/usr/local/lib/python3.7/dist-packages/fossology/obj.py", line 428, in from_json
    return cls(**json_dict)
TypeError: __init__() missing 1 required positional argument: 'hash'

I realized that this is due to the fact that I am using fossology 3.9.0 (release) that supports API v.1.0.16 while latest version of fossology-python supports API v.1.1.1, which is incompatible with API v.1.0.16, and is not supported by any official release of fossology yet. Thus I am left with two options:

  • using the latest commit from fossology's master branch instead of an official release
  • downgrading fossology-python to 0.2.0, therefore losing any possible improvements and bug fixes

Both options would be sub-optimal for me.

I think that I should be better to have consistency between fossology and fossology-python releases, and to keep at least two development branches, one compatible with the latest fossology release (say, "stable" branch), and one compatible with the current master branch of fossology (say, "dev" branch) but with improvements and bug fixes backported to the stable branch.

Since I need it, I could help in maintaining the backport part.

What do you think?

foss_cli: Not able to upload a file (error:fossology.exceptions.FossologyApiError: Upload upload via foss-cli could not be performed: Require uploadType (400))

Hi,

I installed fossology 3.2.0 and used the foss_cli. The fossology server is spinned up using docker and available and running at http://localhost:8081/repo
These are the commands followed:

  1. foss_cli config
  2. foss_cli -vv create_group FossGroup
  3. foss_cli -vv create_folder FossFolder --folder_group FossGroup --folder_description "Description of FossFolder"
  4. foss_cli -vv upload_file --folder_name FossFolder --access_level public /mnt/c/Users/xxx/Downloads/xxx.tar.gz

Step1 to 3 works, but for Step4, this is the output I get,


2024-04-30 11:20:23,035 - DEBUG - [foss_cli.py:305] - foss_cli called with: ['/home/xxxx/env_fossology/bin/foss_cli',
'-vv',
'upload_file',
'--folder_name',
'FossFolder',
'--access_level',
'public',
'/mnt/c/Users/xxxx/Downloads/xxxx.tar.gz']
2024-04-30 11:20:23,035 - DEBUG - [foss_cli.py:146] - Function needs_later_initialization_of_foss_instance called {'DEBUG': False,
'IS_REQUEST_FOR_CONFIG': False,
'IS_REQUEST_FOR_HELP': False,
'RESULT_DIR': '.foss_cli_results',
'TOKEN': None,
'VERBOSE': 2}
2024-04-30 11:20:23,035 - DEBUG - [foss_cli.py:309] - Initializing Fossology client according to the CLI context
2024-04-30 11:20:23,035 - DEBUG - [foss_cli.py:198] - INIT FOSS
2024-04-30 11:20:23,035 - DEBUG - [foss_cli.py:207] - Set server token from configfile http://localhost:8081/repo:xxxx
2024-04-30 11:20:23,179 - DEBUG - [foss_cli.py:224] - Logged in as user fossy
2024-04-30 11:20:23,184 - DEBUG - [foss_cli.py:555] - Try to upload file /mnt/c/Users/xxxx/Downloads/xxxx.tar.gz
2024-04-30 11:20:23,184 - DEBUG - [foss_cli.py:94] - Found upload folder FossFolder with id 3
Traceback (most recent call last):
File "/home/xxxx/env_fossology/bin/foss_cli", line 8, in
sys.exit(main())
^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/fossology/foss_cli.py", line 813, in main
cli(obj=d) # pragma: no cover
^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/fossology/foss_cli.py", line 570, in upload_file
the_upload = foss.upload_file(
^^^^^^^^^^^^^^^^^
File "/home/xxxx/env_fossology/lib/python3.12/site-packages/fossology/uploads.py", line 309, in upload_file
raise FossologyApiError(description, response)
fossology.exceptions.FossologyApiError: Upload upload via foss-cli could not be performed: Require uploadType (400)


I also tried different other type of files (*.zip, *.txt) to upload, but could not do it successfully. However, uploading manually is successfull. Can you let me know what is wrong.

Thanks and regards,
Irin

fix token generation instructions in README

I was trying to create a token following the instructions, and I encountered an error (to understand which kind of error it was I had to open a couple of other issues 🙂 ).

It is a small detail, but fundamental to make it work: the server url must use the "repo" path and must not have the trailing slash, like in "https://fossology.example.com/repo". If you add a trailing slash it returns Resource not found (404).

Moreover, now to import fossology_token one should do from fossology import fossology_token and not from fossology.obj import fossology_token, which does not work any more

The README should be updated accordingly

Missing Fossology API features

This issue is meant to collect features supported by the Fossology REST API and not integrated into the Python wrapper.

Missing features for Fossology 4.2.0:

Missing features for Fossology 4.3.0:

Missing features for Fossology 4.x:

To be continued...

Sometimes "License Information" field is empty

Sometimes, especially when invoke multi fossology-python at the same time, "License Information" field is empty without error or warning.The spdx file look like as following:

$ cat  build/tmp/deploy/spdx/m4-1.4.18.spdx | tail
© Seindal [email protected] Richard A Nelson [email protected] Richard Stallman [email protected] Robert Bernstein [email protected] Robert Bihlmeyer [email protected] Roland H. Pesch [email protected] Roland McGrath [email protected] Ronny Peine [email protected] Sami Liedes [email protected] Santiago Vila [email protected] Scott Bartram deneb!scottb Scott McCreary [email protected] Sergey Poznyakoff [email protected] Simon Leinen [email protected] Skip Montanaro [email protected] Stepan Kasal [email protected] Stephen Perkins [email protected] Steve Williamson [email protected] Steven Augart [email protected] Thomas Klausner [email protected] Thorsten Ohl [email protected] Todd Rinaldo [email protected] Tom G. Christensen [email protected] Tom McConnell tmcconne@sedona
Copyright (C) 2000, 2006-2014, 2016 Free Software Foundation, Inc. </text>




##-------------------------
## License Information
##-------------------------

leimh@pum$</text>




##-------------------------
## License Information
##-------------------------

Fail for some OSS

The error will occur when scan huge source code(e.g. kernel) or some special OSS (e.g. https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz) by fossology-python, the error message is as following:

0258: try:
0259: # Plain text
*** 0260: report = foss.download_report(report_id)
0261: with open(report_name, "w+") as report_file:
0262: report_file.write(report)
0263: except FossologyApiError as error:
0264: bb.error(error.message)
File: '/common/home/test/.local/lib/python3.8/site-packages/tenacity/init.py', lineno: 329, function: wrapped_f
0325: :param f: A function to wraps for retrying.
0326: """
0327: @_utils.wraps(f)
0328: def wrapped_f(*args, **kw):
*** 0329: return self.call(f, *args, **kw)
0330:
0331: def retry_with(*args, **kwargs):
0332: return self.copy(*args, **kwargs).wraps(f)
0333:
File: '/common/home/test/.local/lib/python3.8/site-packages/tenacity/init.py', lineno: 409, function: call
0405:
0406: retry_state = RetryCallState(
0407: retry_object=self, fn=fn, args=args, kwargs=kwargs)
0408: while True:
*** 0409: do = self.iter(retry_state=retry_state)
0410: if isinstance(do, DoAttempt):
0411: try:
0412: result = fn(*args, **kwargs)
0413: except BaseException:
File: '/common/home/test/.local/lib/python3.8/site-packages/tenacity/init.py', lineno: 369, function: iter
0365: return self.retry_error_callback(retry_state=retry_state)
0366: retry_exc = self.retry_error_cls(fut)
0367: if self.reraise:
0368: raise retry_exc.reraise()
*** 0369: six.raise_from(retry_exc, fut.exception())
0370:
0371: if self.wait:
0372: sleep = self.wait(retry_state=retry_state)
0373: else:
File: '', lineno: 3, function: raise_from
File "", line 3, in raise_from


If I increase the sleep time in fossology/report.py, things have been better.

Question: Is there a bulk text match API?

I'm working on migrating an app from using fossdriver to this fossology-python.

I've worked out most of the mapping with the exception of the bulk text match described here.

Is there an equivalent function in this library or API? If not, any advice on how to migrate that feature over?

Error after upgrade 1.3.0 to 1.3.4. (typehints not supported in python < 3.9)

Hi, I upgraded fossology-python from 1.3.0 to 1.3.4 by pip3. And I met the following error:


File: '/ubinux-dev/common/home/ubinux/ubinux/ubinux2021.9/yocto-ubinux-202109/meta-spdxscanner/classes/fossology-python.bbclass', lineno: 108, function: do_foss_upload
     0104:    logger = logging.getLogger()
     0105:    logger.setLevel(logging.INFO)
     0106:    logging.basicConfig(level=logging.INFO)
     0107:
 *** 0108:    from fossology import Fossology, fossology_token
     0109:    from fossology.obj import TokenScope
     0110:    from fossology.exceptions import FossologyApiError, AuthenticationError
     0111:    from tenacity import retry, TryAgain, stop_after_attempt
     0112:
File: '/ubinux-dev/common/home/ubinux/.local/lib/python3.8/site-packages/fossology/__init__.py', lineno: 20, function: <module>
     0016:)
     0017:from fossology.folders import Folders
     0018:from fossology.groups import Groups
     0019:from fossology.jobs import Jobs
 *** 0020:from fossology.license import LicenseEndpoint
     0021:from fossology.obj import (
     0022:    Agents,
     0023:    File,
     0024:    SearchTypes,
File: '/ubinux-dev/common/home/ubinux/.local/lib/python3.8/site-packages/fossology/license.py', lineno: 29, function: <module>
     0025:        pass
     0026:    return False
     0027:
     0028:
 *** 0029:class LicenseEndpoint:
     0030:    """Class dedicated to all "license" related endpoints"""
     0031:
     0032:    def list_licenses(
     0033:        self,
File: '/ubinux-dev/common/home/ubinux/.local/lib/python3.8/site-packages/fossology/license.py', lineno: 39, function: LicenseEndpoint
     0035:        kind: LicenseType = LicenseType.ALL,
     0036:        page_size: int = 100,
     0037:        page: int = 1,
     0038:        all_pages: bool = False,
 *** 0039:    ) -> list[License]:
     0040:        """Get all license from the DB
     0041:
     0042:        API Endpoint: GET /license
     0043:
Exception: TypeError: 'type' object is not subscriptable

Is there any body tell me what the problem is?

upload_file does not give unpack job the time to start

After calling file upload API, the method upload_file does not wait even a second to try to get upload data to check if upload has been successful. This implies that one has to wait 60 sec almost every time she uploads a package.

DEBUG:fossology.uploads:Retry GET upload 18 after 60 seconds: Ununpack job not started. Please check job status at /api/v1/jobs?upload=18

Maybe adding an optional sleep command in the middle would help...

foss_cli cmd to upload source package

Create a (one liner) foss_cli cmd:

  • to upload a source package, trigger an analysis and download the reports
  • it should be possible to "reuse":
    • old uploads of the filename
    • old analyze sessions

missing super().__init__(message) in exception classes

in fossology/exceptions.py, all exception classes miss the super().__init__(message) call, so in case of errors the message is not displayed, and something like AuthenticationError: ('Authentication error', <Response [404]>) is displayed instead.

Moreover, if the response code is an error code, `if response:" is always False, so it never displays the actual error message.

Something like this should work:

class AuthenticationError(Error):
    """Authentication error"""

    def __init__(self, description, response=None):
        if response is not None:
            try:
                message = response.json().get("message")
            except JSONDecodeError:
                message = response.text
            self.message = f"{description}: {message} ({response.status_code})"
        else:
            self.message = description
        super().__init__(self.message)

VCS upload fails for larger repositories

Seen in fossology-0.1.1:

I upload using this code:

root_folder = foss.list_folders()[0]
my_product_folder = foss.create_folder(root_folder, 'My_Product', 'My_Product')

vcs = {
    "vcsType": "git",
    "vcsName": "my-product-master",
    "vcsUrl": "https://gerrit-server/path/to/repo",
    "vcsUsername": "",
    "vcsPassword": "",
    "vcsBranch": "master"
}

my_product_upload = foss.upload_file(my_product_folder, vcs=vcs,
                                     access_level=AccessLevel.PUBLIC,
                                     description='My_Product source')

Now, this works for small repositories, but on larger ones (clone time > 3 mins), I get this failure:

Traceback (most recent call last):
  File "/home/deverett/.virtualenvs/fossology/lib/python3.8/site-packages/tenacity/__init__.py", line 412, in call
    result = fn(*args, **kwargs)
  File "/home/deverett/.virtualenvs/fossology/lib/python3.8/site-packages/fossology/uploads.py", line 41, in detail_upload
    raise TryAgain
tenacity.TryAgain

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "upload_scan.py", line 30, in <module>
    my_product_upload = foss.upload_file(my_product_folder, vcs=vcs,
  File "/home/deverett/.virtualenvs/fossology/lib/python3.8/site-packages/fossology/uploads.py", line 162, in upload_file
    upload = self.detail_upload(response.json()["message"])
  File "/home/deverett/.virtualenvs/fossology/lib/python3.8/site-packages/tenacity/__init__.py", line 329, in wrapped_f
    return self.call(f, *args, **kw)
  File "/home/deverett/.virtualenvs/fossology/lib/python3.8/site-packages/tenacity/__init__.py", line 409, in call
    do = self.iter(retry_state=retry_state)
  File "/home/deverett/.virtualenvs/fossology/lib/python3.8/site-packages/tenacity/__init__.py", line 369, in iter
    six.raise_from(retry_exc, fut.exception())
  File "<string>", line 3, in raise_from
tenacity.RetryError: RetryError[<Future at 0x7f38d2aecbb0 state=finished raised TryAgain>]

Create sample scan workflow

New Fossology users have a hard time understand how a typical scan workflow works.

A small code sample in this project would be useful:

  • login on Fossology
  • create a "clearing" group
  • upload a source file (visible for the group)
  • start default scan jobs
  • generate report
  • download report

Create fossology cli

Using click with basic commands:

  • upload source
  • get upload summary
  • start/restart scan jobs
  • generate and download report

list_uploads() broken in 0.1.2

This was not present in 0.1.1, but in 0.1.2 I get

Traceback (most recent call last):
  File "generate_report.py", line 19, in <module>
    upload_list = foss.list_uploads()
  File "/home/deverett/.virtualenvs/fossology/lib/python3.8/site-packages/fossology/uploads.py", line 372, in list_uploads
    f"Retrieved page {page} of uploads, {response.headers['X-TOTAL-PAGES']} pages are in total available"
  File "/home/deverett/.virtualenvs/fossology/lib/python3.8/site-packages/requests/structures.py", line 54, in __getitem__
    return self._store[key.lower()][1]
KeyError: 'x-total-pages'

when using list_uploads()

The headers do not contain an X-TOTAL-PAGES entry - dumping response.headers I get

{'Date': 'Fri, 25 Sep 2020 09:57:46 GMT', 'Server': 'Apache/2.4.25 (Debian)', 'Cache-Control': 'max-age=0, private, must-revalidate', 'Content-Length': '221', 'Keep-Alive': 'timeout=5, max=96', 'Connection': 'Keep-Alive', 'Content-Type': 'application/json;charset=utf-8'}

I am running against the 3.9.0 fossology server (latest Docker image).

NameError: name 'exit' is not defined

I started playing with the latest version of fossology-python, and when connecting to a wrong server url I got this error:

/data/alberto/playground/fossy_new/lib/python3.10/site-packages/fossology/__init__.py in fossology_token(url, username, password, token_name, token_scope, token_expire)
     78             raise FossologyApiError(description, response)
     79     except requests.exceptions.ConnectionError as error:
---> 80         exit(f"Server {url} does not seem to be running or is unreachable: {error}")
     81 
     82 

NameError: name 'exit' is not defined

The affected line is this one

I don't know if it was intended to be sys.exit or if it should be raising some exception instead

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.