Skip to main content

List license requirement of a project based on configuration file.

Project description

List license information from package specification file

Conda

For Conda environment:

  1. Create an environment specification file. Please follow this guide to create this file.
  2. Edit the file and remove all unnecessary dependencies (very important, otherwise the it is easy to get inundated with too many packages). For example, remove things like ipython, ipykernel, which are used for purpose other than the library itself.
  3. Install this package.
  4. Run:
listcondalic conda environment.yml > output.json

Here environment.yml should be the environment specification file. The package licence information will be saved at output.json.

Pip

Note: We use liccheck internally to produce the analysis.

  1. Create your package specification file (e.g. requirements.txt) including all the packages required. pipreqs is a good helping tool for this as well.
  2. Install this package
  3. Run:
listcondalic pip requirements.txt > output.json

The package licence information will be saved at output.json.

Existing problems

This packages isn't quite clever yet:

  • It tries to skip a few packages such as python, setuptools, wheel and pip. Hopefully, we won't neglect any important packages.
  • It only understand very basic package specifications in the conda environment file. Complicated package sources will likely create bugs in the result. In particular, it does not suppoprt:
    • "." (dot) package, or in general, if you specify a path to a local python package, this library will not attempt to analyze the packaged located in that folder. Instead, it will be registered as a package named, e.g. ".", and therefore it will report the package's licence as NotFound.
    • GitHub URL package, for reasons mentioned above.

GitHub action template

For a pip-based requirements.txt:

name: Report licence status

on:
  workflow_dispatch:

jobs:
  check-using-pip:
    name: Report using a pip environment
    runs-on: ubuntu-20.04
    steps:
    - uses: actions/checkout@master
    - name: Set up Python 3.7
      uses: actions/setup-python@v1
      with:
        python-version: 3.7
    - name: Install packages and listcondalic
      run: |
        pip install -r requirements.txt
        pip install listcondalic
    - name: Produce report
      run: listcondalic pip requirements.txt

For a conda produced environment.yml:

name: Report licence status

on:
  workflow_dispatch:

jobs:
  check-using-conda:
    name: Report using a conda environment
    runs-on: ubuntu-20.04
    steps:
    - uses: actions/checkout@master
    - name: Install conda and prepare the environment
      uses: conda-incubator/setup-miniconda@v2
      with:
        activate-environment: YOUR_ENVIRONMENT_NAME
        environment-file: environment.yml
        python-version: 3.7
        auto-activate-base: false
    - name: Install listcondalic
      shell: 'bash -l {0}' # this is required by the conda action
      run: pip install listcondalic
    - name: Produce report
      shell: 'bash -l {0}' # this is required by the conda action
      run: listcondalic conda environment.yml

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

listcondalic-0.1.1.tar.gz (26.0 kB view details)

Uploaded Source

Built Distribution

listcondalic-0.1.1-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

Details for the file listcondalic-0.1.1.tar.gz.

File metadata

  • Download URL: listcondalic-0.1.1.tar.gz
  • Upload date:
  • Size: 26.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for listcondalic-0.1.1.tar.gz
Algorithm Hash digest
SHA256 193a0ffb7558fa72658e8e3cb229c86abe4b40bb33351ca4ccc9c2158c29ecad
MD5 fbf6915fa25424132070069bc9636661
BLAKE2b-256 454cc95fabe199199b405b2b3ba565242e2229ea26a1d68cf48fb6712c0c9fb1

See more details on using hashes here.

File details

Details for the file listcondalic-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: listcondalic-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 26.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for listcondalic-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 06e886a2a6bb4b4e02ff3d2de147cedf044733330598856f33499ac767f1f3a8
MD5 fd716d5b0d66fd11b037e73ee05b8a58
BLAKE2b-256 4b533cf030a9af1c4867364e6ea09c4e37abe3173678625bf347328a976a2b6a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page