Skip to content

Temporary repo for developing the Python version of orthw.

License

Notifications You must be signed in to change notification settings

cariad-tech/orthw-python

 
 

Repository files navigation

orthw

orthw is a command-line utility designed to simplify and speed up common tasks performed when processing ORT scan results. It supports a number of commands, which can be run in the terminal.

For example:

  • To correct license findings in an open source dependency, you can run orthw pc-create <package-id>, which generates a package configuration file.
  • To indicate that certain items are internal to the project (and so license findings should not be reported against them), you can generate scope excludes for your project's .ort.yml file with the command orthw rc-generate-scope-excludes generates scope excludes.

Benefits of orthw

orthw:

  • Simplifies common ORT scan review tasks such as clearing found licenses.
  • Offers easy to remember CLI commands (but should you forget, run orthw with no arguments to see a complete list).
  • Includes commands to format, sort, clean up and generate ORT config files such as .ort.yml and package configuration.
  • Is pre-configured to work with the ort-config repository allowing you to re-use the work of other ORT users.

Installation

1. Prerequisites

orthw requires the following tools to be installed on the system where you intend to run it:

The next step is to clone the repositories of ORT, ort-config, ScanCode and orthw. Run the commands shown below in a dedicated directory such as ~/ort-project:

mkdir -p ~/ort-project && \
cd ~/ort-project && \
git clone https://github.com/oss-review-toolkit/ort.git && \
git clone https://github.com/oss-review-toolkit/ort-config.git && \
git clone https://github.com/oss-review-toolkit/orthw.git && \
git clone https://github.com/nexB/scancode-toolkit.git

Finally, create an exports directory which will be used to store exported license finding curations and path excludes.

mkdir -p ~/ort-project/exports

2. Build ORT

Navigate to the directory where you cloned the ORT repository and run its native build command:

cd ~/ort-project/ort && \
./gradlew installDist

3. Create your orthw configuration

  • Copy the orthwconfig-template file from the orthw repository into your home directory.
cp ~/ort-project/orthw/orthwconfig-template ~/.orthwconfig
  • Open ~/.orthwconfig in a text editor.

  • Set ort_home, orthw_home, configuration_home and scancode_home to the location of the ORT, orthw, ORT configuration and ScanCode repositories which you cloned in above Prerequisites, respectively.

    If you followed examples in the previous steps and used a ort-project directory then the contents of config.yml file.

    The file is present in follow OS directories:

    • Linux ~/.config/orthw
    • Mac OS X ~/Library/Application Support/orthw
    • Windows C:\Users\\Local\orthw\Config

    and its minimal contents should be shown below:

configuration_home: ~/ort-project/ort-config

ort_home: ~/ort-project/ort

scancode_home: ~/ort-project/scancode-toolkit

exports_home: ~/ort-project/exports

orthw_home: ~/ort-project/orthw

4. Install orthw

5. Test if Everything Works

Verify that orthw works by running orthw in a new terminal window: orthw should print the full list of available commands and no error messages.

Usage

Follow the Getting Started guide to learn how to use orthw to:

Development

PYTHONPATH=$PWD/src export PYTHONPATH pip install poetry python -m poetry poetry install python -m orthw

poetry up -> update deps

To check your path is correctly configured

python -c "import sys; print('\n'.join(sys.path))"

python -m orthw package-config create Maven:org.eclipse.platform:org.eclipse.osgi:3.18.200

pip install ptpython

pip install pre-commit poetry self update pre-commit run --all

Contributing to orthw and Questions

All contributions are welcome. If you are interested in contributing, please read our contributing guide. To get quick answers to any of your questions we recommend that you join our Slack community.

License

Copyright (C) 2018-2024 The ORTHW Project Authors.

See the LICENSE file in the root of this project for license details.

OSS Review Toolkit (ORT) is a Linux Foundation project and part of ACT.

About

Temporary repo for developing the Python version of orthw.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.7%
  • Other 0.3%