No description
Find a file
2025-05-24 02:46:32 +08:00
docs docs: Fix broken external links 2025-02-20 10:15:54 +00:00
swh/lister add tests 2025-05-24 02:46:32 +08:00
.copier-answers.yml Apply swh-py-template v0.3.3 with copier 2025-02-17 13:44:24 +01:00
.git-blame-ignore-revs Add latest blackify to git-blame-ignore-revs 2023-12-05 14:04:51 +01:00
.gitignore Apply swh-py-template 0.1.6 2023-12-03 17:54:52 +01:00
.pre-commit-config.yaml Apply swh-py-template v0.3.3 with copier 2025-02-17 13:44:24 +01:00
ACKNOWLEDGEMENTS add ACKNOWLEDGEMENTS 2015-04-26 15:54:25 +02:00
AUTHORS Migrate to copier-based swh-py-template 2023-11-29 17:23:28 +01:00
CODE_OF_CONDUCT.md Apply swh-py-template v0.2.3 2024-08-27 16:25:53 +02:00
conftest.py tests: Fix mocking of sleep calls with tenacity 8.4.2 2024-06-28 18:15:36 +02:00
CONTRIBUTORS gogs: Introduce Gogs lister 2022-08-03 16:22:06 +05:30
LICENSE add license information 2015-04-26 16:24:32 +02:00
Makefile Makefile: add from swh-py-template 2015-10-27 14:35:54 +01:00
pyproject.toml add fdroid lister 2025-05-18 16:37:02 +08:00
README.rst Remove the outdated list of swh.lister submodules from the readme 2024-01-17 18:05:58 +01:00
requirements-swh.txt Migration to psycopg3 2025-03-21 17:05:07 +01:00
requirements-test.txt Use swh-scheduler[pytest] instead of swh-scheduler[testing] 2025-03-31 18:57:11 +02:00
requirements.txt Migration to psycopg3 2025-03-21 17:05:07 +01:00
tox.ini Apply swh-py-template v0.3.3 with copier 2025-02-17 13:44:24 +01:00

Software Heritage - Listers
===========================

Collection of listers for source code distribution places like development
forges, FOSS distributions, package managers, etc. Each lister is in charge to
enumerate the software origins (e.g., VCS, packages, etc.) available at a
source code distribution place.

A lister is a component from the Software Heritage stack aims to produce
listings of software origins and their urls hosted on various public developer
platforms or package managers. As these operations are quite similar, this
package provides a set of Python modules abstracting common software origins
listing behaviors.

It also provides several lister implementations, contained in the Python
``swh.lister.*`` modules. See `this documentation
<https://docs.softwareheritage.org/user/listers.html>`_ for the list of
supported listers.


Dependencies
------------

All required python dependencies can be found in the ``requirements*.txt`` files
located at the root of the repository.

In order to be able to run all the listers (and thus execute the tests), some
tools must be available on your system, namely:

- ``opam``
- ``tar``
- ``psql``

On a Debian-like system, you may use:

.. code-block: console

   $ sudo apt update
   $ sudo apt install opam tar postgresql-client-common


Local deployment
----------------

Lister configuration
++++++++++++++++++++

Each lister implemented so far by Software Heritage (``bitbucket``, ``cgit``,
``cran``, ``debian``, ``gitea``, ``github``, ``gitlab``, ``gnu``, ``golang``,
``launchpad``, ``npm``, ``packagist``, ``phabricator``, ``pypi``, ``tuleap``,
``maven``) must be configured by following the instructions below (please note
that you have to replace ``<lister_name>`` by one of the lister name introduced
above).

Preparation steps
~~~~~~~~~~~~~~~~~

1. ``mkdir ~/.config/swh/``
2. create configuration file ``~/.config/swh/listers.yml``

Configuration file sample
+++++++++++++++++++++++++

Minimalistic configuration shared by all listers to add in file
``~/.config/swh/listers.yml``:

.. code-block:: yaml

   scheduler:
     cls: 'remote'
     args:
       url: 'http://localhost:5008/'

   credentials: {}

Note: This expects scheduler (5008) service to run locally

Executing a lister
------------------

Once configured, a lister can be executed by using the ``swh`` CLI tool with
the following options and commands:

.. code-block:: shell

   $ swh --log-level DEBUG lister -C ~/.config/swh/listers.yml run --lister <lister_name> [lister_parameters]


Examples:

.. code-block:: shell

   $ swh --log-level DEBUG lister -C ~/.config/swh/listers.yml run --lister bitbucket

   $ swh --log-level DEBUG lister -C ~/.config/swh/listers.yml run --lister cran

   $ swh --log-level DEBUG lister -C ~/.config/swh/listers.yml run --lister gitea url=https://codeberg.org/api/v1/

   $ swh --log-level DEBUG lister -C ~/.config/swh/listers.yml run --lister gitlab url=https://salsa.debian.org/api/v4/

   $ swh --log-level DEBUG lister -C ~/.config/swh/listers.yml run --lister npm

   $ swh --log-level DEBUG lister -C ~/.config/swh/listers.yml run --lister pypi


Licensing
---------

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.

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.

See top-level LICENSE file for the full text of the GNU General Public License
along with this program.