diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..96c89ceb --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +# Ignore all Git auto CR/LF line endings conversions +* -text +pyproject.toml export-subst diff --git a/.github/workflows/docs-ci.yml b/.github/workflows/docs-ci.yml new file mode 100644 index 00000000..656d6248 --- /dev/null +++ b/.github/workflows/docs-ci.yml @@ -0,0 +1,37 @@ +name: CI Documentation + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-20.04 + + strategy: + max-parallel: 4 + matrix: + python-version: [3.7] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Give permission to run scripts + run: chmod +x ./docs/scripts/doc8_style_check.sh + + - name: Install Dependencies + run: pip install -e .[docs] + + - name: Check Sphinx Documentation build minimally + working-directory: ./docs + run: sphinx-build -E -W source build + + - name: Check for documentation style errors + working-directory: ./docs + run: ./scripts/doc8_style_check.sh + + diff --git a/.gitignore b/.gitignore index efe052e1..339dca50 100644 --- a/.gitignore +++ b/.gitignore @@ -1,40 +1,73 @@ -*.pyc -*.db -.installed.cfg -parts -develop-eggs -bin -eggs -downloads -lib -lib64 -build -.project -.pydevproject -include -.settings -TAGS -.idea -Include -Lib -.env -Procfile -tmp -.Python -local.cfg -_build -pip-selfcheck.json -pyvenv.cfg -geckodriver.log -.DS_Store +# Python compiled files +*.py[cod] # virtualenv and other misc bits -.venv/ +*.egg-info +/dist /build -build/ +/bin +/lib +/scripts +/Scripts +/Lib +/pip-selfcheck.json +/tmp +/venv +.Python +/include +/Include +/local +*/local/* +/local/ +/share/ +/tcl/ +/.eggs/ + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.cache +.coverage +.coverage.* +nosetests.xml +htmlcov + +# Translations +*.mo # IDEs +.project +.pydevproject +.idea +org.eclipse.core.resources.prefs .vscode +.vs # Sphinx docs/_build +docs/bin +docs/build +docs/include +docs/Lib +doc/pyvenv.cfg +pyvenv.cfg + +# Various junk and temp files +.DS_Store +*~ +.*.sw[po] +.build +.ve +*.bak +/.cache/ + +# pyenv +/.python-version +/man/ +/.pytest_cache/ +lib64 +tcl + +# Ignore Jupyter Notebook related temp files +.ipynb_checkpoints/ diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 00000000..1b71cd9e --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,18 @@ +# .readthedocs.yml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Where the Sphinx conf.py file is located +sphinx: + configuration: docs/source/conf.py + +# Setting the python version and doc build requirements +python: + install: + - method: pip + path: . + extra_requirements: + - docs diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 458d6ca9..00000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -sudo: false -language: python -python: -- '3.6' -install: -- pip install Sphinx sphinx_rtd_theme doc8 -before_install: -- chmod +x ./docs/scripts/doc8_style_check.sh -script: -- cd docs -- "./scripts/doc8_style_check.sh" -notifications: - slack: - secure: i2YByZfJB5RDtM+51eR3Bs2C8Sj00pljlllpZdMsbap/2uKepN+2qvuU+xhkfU64+sSqwE/VgknCO1v7SdB9PmtuZX+7LFUnWzoCSLLsqoDBFROTCb/siTR5OhxEMOWhKTXjsNsAb0jsx+fbfhohUdh5xDHxKxloAqa07Sg3W083yyd02VRAlsyw5a0iJo0Xq35z/FSsPH7y2rIVTQjj15M24qoQS9R4mqIF/HLGO21p527T0w+U7sZegCMayBgc0+fW8b/IbzfPWHNQ6pKv/zTIGQUDTkxmxdVOVokJ6KWVnLTgRjMNv3/mV6t/8r8HYuO9i9le3jVFX7BE7jxS1kQATR27UjKj1p3IA6xRIggxeH8apq22/GpCoCJZzlA/LRWX06IMhFu9MzB2OQeI2opn7FekIINjJIcmwL8Azsws14xD84H8rdbBD23kCWlzq/38u9wdHitLv7lEHAvdLlZbJAoF9vb1Ui0m5OylhQ4auW3ZqiXKfYshgdcLmMStQGiIsDvB4RORBDTHAig+XbBzP3YuAvQE/JvrJO7C7392rSqkZgClIs5a0+ZqJdvLcX3F8+WXkqFoQ7vQ01STTzhGBxA/deizvk7MvX4uMY2T4xxU6OPai1px608q34pDiuEchBpasU1sHJagO8rrWOEfjlbT7RuS7t5PIhwR648= diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..ef3721e8 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,15 @@ +graft src + +include *.LICENSE +include NOTICE +include *.ABOUT +include *.toml +include *.yml +include *.rst +include setup.* +include configure* +include requirements* +include .git* + +global-exclude *.py[co] __pycache__ *.*~ + diff --git a/NOTICE b/NOTICE new file mode 100644 index 00000000..65936b2b --- /dev/null +++ b/NOTICE @@ -0,0 +1,19 @@ +# +# Copyright (c) nexB Inc. and others. +# SPDX-License-Identifier: Apache-2.0 +# +# Visit https://aboutcode.org and https://github.com/nexB/ for support and download. +# ScanCode is a trademark of nexB Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/README.md b/README.md index e9d6b505..30e15707 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ These are important questions when there are millions of free and open source so ### Documentation Build Status -[![Build Status](https://travis-ci.org/nexB/aboutcode.svg?branch=master)](https://travis-ci.org/nexB/aboutcode) +![Doc Build](https://github.com/nexB/aboutcode/actions/workflows/docs-ci.yml/badge.svg) ### Important Links @@ -30,6 +30,11 @@ AboutCode Documentation Group Email Addresses: If you want to get in touch with the team with issues other than documentation, head to the gitter channel [here](https://gitter.im/aboutcode-org/discuss). +Look at our [wiki](https://github.com/nexB/aboutcode/wiki) for information about our participation +in the GSoC and GSoD programs. + +We have a weekly meeting, see more details [here](https://github.com/nexB/aboutcode/wiki/MeetingMinutes). + ### Projects Each AboutCode project has its own repository: @@ -39,6 +44,8 @@ Each AboutCode project has its own repository: - **[Scancode.io](https://github.com/nexB/scancode.io)**: a web-based and API to run and review scans in rich scripted ScanPipe pipelines. +- **[VulnerableCode](https://github.com/nexB/vulnerablecode)**: an emerging server-side application to collect and track known package vulnerabilities. + - **[Scancode Workbench](https://github.com/nexB/scancode-workbench)**: a desktop application (based on Electron) to review the results of a scan and document your conclusions about the origin and license of software components and packages. - **[AboutCode Toolkit](https://github.com/nexB/aboutcode-toolkit)**: a set of command line tools to document the provenance of your code and generate attribution notices. AboutCode Toolkit uses small yaml files to document code provenance inside a codebase. The lead maintainer is @chinyeungli @@ -54,8 +61,6 @@ API to run and review scans in rich scripted ScanPipe pipelines. - **[DeltaCode](https://github.com/nexB/deltacode)**: a command line tool to compare scans and determine if and where there are material differences that affect licensing. -- **[VulnerableCode](https://github.com/nexB/vulnerablecode)**: an emerging server-side application to collect and track known package vulnerabilities. - We also co-started and work closely with other FOSS orgs and projects: diff --git a/apache-2.0.LICENSE b/apache-2.0.LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/apache-2.0.LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/configure b/configure new file mode 100755 index 00000000..54f7cf38 --- /dev/null +++ b/configure @@ -0,0 +1,192 @@ +#!/usr/bin/env bash +# +# Copyright (c) nexB Inc. and others. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# See http://www.apache.org/licenses/LICENSE-2.0 for the license text. +# See https://github.com/nexB/ for support or download. +# See https://aboutcode.org for more information about nexB OSS projects. +# + +set -e +#set -x + +################################ +# A configuration script to set things up: +# create a virtualenv and install or update thirdparty packages. +# Source this script for initial configuration +# Use configure --help for details +# +# NOTE: please keep in sync with Windows script configure.bat +# +# This script will search for a virtualenv.pyz app in etc/thirdparty/virtualenv.pyz +# Otherwise it will download the latest from the VIRTUALENV_PYZ_URL default +################################ +CLI_ARGS=$1 + +################################ +# Defaults. Change these variables to customize this script +################################ + +# Requirement arguments passed to pip and used by default or with --dev. +REQUIREMENTS="--editable . " +DOCS_REQUIREMENTS="--editable .[docs]" + +# where we create a virtualenv +VIRTUALENV_DIR=venv + +# Cleanable files and directories to delete with the --clean option +CLEANABLE="build venv" + +# extra arguments passed to pip +PIP_EXTRA_ARGS=" " + +# the URL to download virtualenv.pyz if needed +VIRTUALENV_PYZ_URL=https://bootstrap.pypa.io/virtualenv.pyz +################################ + + +################################ +# Current directory where this script lives +CFG_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +CFG_BIN_DIR=$CFG_ROOT_DIR/$VIRTUALENV_DIR/bin + + +################################ +# Thirdparty package locations and index handling +# Find packages from the local thirdparty directory or from thirdparty.aboutcode.org +if [ -f "$CFG_ROOT_DIR/thirdparty" ]; then + PIP_EXTRA_ARGS="--find-links $CFG_ROOT_DIR/thirdparty" +fi +PIP_EXTRA_ARGS="$PIP_EXTRA_ARGS --find-links https://thirdparty.aboutcode.org/pypi/simple/links.html" + + +################################ +# Set the quiet flag to empty if not defined +if [[ "$CFG_QUIET" == "" ]]; then + CFG_QUIET=" " +fi + + +################################ +# Find a proper Python to run +# Use environment variables or a file if available. +# Otherwise the latest Python by default. +find_python() { + if [[ "$PYTHON_EXECUTABLE" == "" ]]; then + # check for a file named PYTHON_EXECUTABLE + if [ -f "$CFG_ROOT_DIR/PYTHON_EXECUTABLE" ]; then + PYTHON_EXECUTABLE=$(cat "$CFG_ROOT_DIR/PYTHON_EXECUTABLE") + else + PYTHON_EXECUTABLE=python3 + fi + fi +} + + +################################ +create_virtualenv() { + # create a virtualenv for Python + # Note: we do not use the bundled Python 3 "venv" because its behavior and + # presence is not consistent across Linux distro and sometimes pip is not + # included either by default. The virtualenv.pyz app cures all these issues. + + VENV_DIR="$1" + if [ ! -f "$CFG_BIN_DIR/python" ]; then + + mkdir -p "$CFG_ROOT_DIR/$VENV_DIR" + + if [ -f "$CFG_ROOT_DIR/etc/thirdparty/virtualenv.pyz" ]; then + VIRTUALENV_PYZ="$CFG_ROOT_DIR/etc/thirdparty/virtualenv.pyz" + else + VIRTUALENV_PYZ="$CFG_ROOT_DIR/$VENV_DIR/virtualenv.pyz" + wget -O "$VIRTUALENV_PYZ" "$VIRTUALENV_PYZ_URL" 2>/dev/null || curl -o "$VIRTUALENV_PYZ" "$VIRTUALENV_PYZ_URL" + fi + + $PYTHON_EXECUTABLE "$VIRTUALENV_PYZ" \ + --wheel embed --pip embed --setuptools embed \ + --seeder pip \ + --never-download \ + --no-periodic-update \ + --no-vcs-ignore \ + $CFG_QUIET \ + "$CFG_ROOT_DIR/$VENV_DIR" + fi +} + + +################################ +install_packages() { + # install requirements in virtualenv + # note: --no-build-isolation means that pip/wheel/setuptools will not + # be reinstalled a second time and reused from the virtualenv and this + # speeds up the installation. + # We always have the PEP517 build dependencies installed already. + + "$CFG_BIN_DIR/pip" install \ + --upgrade \ + --no-build-isolation \ + $CFG_QUIET \ + $PIP_EXTRA_ARGS \ + $1 +} + + +################################ +cli_help() { + echo An initial configuration script + echo " usage: ./configure [options]" + echo + echo The default is to configure for regular use. Use --dev for development. + echo + echo The options are: + echo " --clean: clean built and installed files and exit." + echo " --dev: configure the environment for development." + echo " --help: display this help message and exit." + echo + echo By default, the python interpreter version found in the path is used. + echo Alternatively, the PYTHON_EXECUTABLE environment variable can be set to + echo configure another Python executable interpreter to use. If this is not + echo set, a file named PYTHON_EXECUTABLE containing a single line with the + echo path of the Python executable to use will be checked last. + set +e + exit +} + + +################################ +clean() { + # Remove cleanable file and directories and files from the root dir. + echo "* Cleaning ..." + for cln in $CLEANABLE; + do rm -rf "${CFG_ROOT_DIR:?}/${cln:?}"; + done + set +e + exit +} + + +################################ +# Main command line entry point +CFG_REQUIREMENTS=$REQUIREMENTS + +# We are using getopts to parse option arguments that start with "-" +while getopts :-: optchar; do + case "${optchar}" in + -) + case "${OPTARG}" in + help ) cli_help;; + clean ) find_python && clean;; + docs ) CFG_REQUIREMENTS="$DOCS_REQUIREMENTS";; + esac;; + esac +done + +PIP_EXTRA_ARGS="$PIP_EXTRA_ARGS" + +find_python +create_virtualenv "$VIRTUALENV_DIR" +install_packages "$CFG_REQUIREMENTS" +. "$CFG_BIN_DIR/activate" + + +set +e diff --git a/configure.bat b/configure.bat new file mode 100644 index 00000000..240c30cb --- /dev/null +++ b/configure.bat @@ -0,0 +1,205 @@ +@echo OFF +@setlocal + +@rem Copyright (c) nexB Inc. and others. All rights reserved. +@rem SPDX-License-Identifier: Apache-2.0 +@rem See http://www.apache.org/licenses/LICENSE-2.0 for the license text. +@rem See https://github.com/nexB/ for support or download. +@rem See https://aboutcode.org for more information about nexB OSS projects. + + +@rem ################################ +@rem # A configuration script to set things up: +@rem # create a virtualenv and install or update thirdparty packages. +@rem # Source this script for initial configuration +@rem # Use configure --help for details + +@rem # NOTE: please keep in sync with POSIX script configure + +@rem # This script will search for a virtualenv.pyz app in etc\thirdparty\virtualenv.pyz +@rem # Otherwise it will download the latest from the VIRTUALENV_PYZ_URL default +@rem ################################ + + +@rem ################################ +@rem # Defaults. Change these variables to customize this script +@rem ################################ + +@rem # Requirement arguments passed to pip and used by default or with --dev. +set "REQUIREMENTS=--editable . " +set "DOCS_REQUIREMENTS=--editable .[docs]" + +@rem # where we create a virtualenv +set "VIRTUALENV_DIR=venv" + +@rem # Cleanable files and directories to delete with the --clean option +set "CLEANABLE=build venv" + +@rem # extra arguments passed to pip +set "PIP_EXTRA_ARGS= " + +@rem # the URL to download virtualenv.pyz if needed +set VIRTUALENV_PYZ_URL=https://bootstrap.pypa.io/virtualenv.pyz +@rem ################################ + + +@rem ################################ +@rem # Current directory where this script lives +set CFG_ROOT_DIR=%~dp0 +set "CFG_BIN_DIR=%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\Scripts" + + +@rem ################################ +@rem # Thirdparty package locations and index handling +@rem # Find packages from the local thirdparty directory or from thirdparty.aboutcode.org +if exist "%CFG_ROOT_DIR%\thirdparty" ( + set PIP_EXTRA_ARGS=--find-links "%CFG_ROOT_DIR%\thirdparty" +) +set "PIP_EXTRA_ARGS=%PIP_EXTRA_ARGS% --find-links https://thirdparty.aboutcode.org/pypi/simple/links.html" + + +@rem ################################ +@rem # Set the quiet flag to empty if not defined +if not defined CFG_QUIET ( + set "CFG_QUIET= " +) + + +@rem ################################ +@rem # Main command line entry point +set "CFG_REQUIREMENTS=%REQUIREMENTS%" +set "NO_INDEX=--no-index" + +:again +if not "%1" == "" ( + if "%1" EQU "--help" (goto cli_help) + if "%1" EQU "--clean" (goto clean) + if "%1" EQU "--docs" ( + set "CFG_REQUIREMENTS=%DOCS_REQUIREMENTS%" + ) + shift + goto again +) + +set "PIP_EXTRA_ARGS=%PIP_EXTRA_ARGS%" + + +@rem ################################ +@rem # Find a proper Python to run +@rem # Use environment variables or a file if available. +@rem # Otherwise the latest Python by default. +if not defined PYTHON_EXECUTABLE ( + @rem # check for a file named PYTHON_EXECUTABLE + if exist "%CFG_ROOT_DIR%\PYTHON_EXECUTABLE" ( + set /p PYTHON_EXECUTABLE=<"%CFG_ROOT_DIR%\PYTHON_EXECUTABLE" + ) else ( + set "PYTHON_EXECUTABLE=py" + ) +) + + +@rem ################################ +:create_virtualenv +@rem # create a virtualenv for Python +@rem # Note: we do not use the bundled Python 3 "venv" because its behavior and +@rem # presence is not consistent across Linux distro and sometimes pip is not +@rem # included either by default. The virtualenv.pyz app cures all these issues. + +if not exist "%CFG_BIN_DIR%\python.exe" ( + if not exist "%CFG_BIN_DIR%" ( + mkdir "%CFG_BIN_DIR%" + ) + + if exist "%CFG_ROOT_DIR%\etc\thirdparty\virtualenv.pyz" ( + %PYTHON_EXECUTABLE% "%CFG_ROOT_DIR%\etc\thirdparty\virtualenv.pyz" ^ + --wheel embed --pip embed --setuptools embed ^ + --seeder pip ^ + --never-download ^ + --no-periodic-update ^ + --no-vcs-ignore ^ + %CFG_QUIET% ^ + "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%" + ) else ( + if not exist "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\virtualenv.pyz" ( + curl -o "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\virtualenv.pyz" %VIRTUALENV_PYZ_URL% + + if %ERRORLEVEL% neq 0 ( + exit /b %ERRORLEVEL% + ) + ) + %PYTHON_EXECUTABLE% "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\virtualenv.pyz" ^ + --wheel embed --pip embed --setuptools embed ^ + --seeder pip ^ + --never-download ^ + --no-periodic-update ^ + --no-vcs-ignore ^ + %CFG_QUIET% ^ + "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%" + ) +) + +if %ERRORLEVEL% neq 0 ( + exit /b %ERRORLEVEL% +) + + +@rem ################################ +:install_packages +@rem # install requirements in virtualenv +@rem # note: --no-build-isolation means that pip/wheel/setuptools will not +@rem # be reinstalled a second time and reused from the virtualenv and this +@rem # speeds up the installation. +@rem # We always have the PEP517 build dependencies installed already. + +"%CFG_BIN_DIR%\pip" install ^ + --upgrade ^ + --no-build-isolation ^ + %CFG_QUIET% ^ + %PIP_EXTRA_ARGS% ^ + %CFG_REQUIREMENTS% + + +@rem ################################ +:create_bin_junction +@rem # Create junction to bin to have the same directory between linux and windows +if exist "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\bin" ( + rmdir /s /q "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\bin" +) +mklink /J "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\bin" "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\Scripts" + +if %ERRORLEVEL% neq 0 ( + exit /b %ERRORLEVEL% +) + +exit /b 0 + + +@rem ################################ +:cli_help + echo An initial configuration script + echo " usage: configure [options]" + echo " " + echo The default is to configure for regular use. Use --dev for development. + echo " " + echo The options are: + echo " --clean: clean built and installed files and exit." + echo " --dev: configure the environment for development." + echo " --help: display this help message and exit." + echo " " + echo By default, the python interpreter version found in the path is used. + echo Alternatively, the PYTHON_EXECUTABLE environment variable can be set to + echo configure another Python executable interpreter to use. If this is not + echo set, a file named PYTHON_EXECUTABLE containing a single line with the + echo path of the Python executable to use will be checked last. + exit /b 0 + + +@rem ################################ +:clean +@rem # Remove cleanable file and directories and files from the root dir. +echo "* Cleaning ..." +for %%F in (%CLEANABLE%) do ( + rmdir /s /q "%CFG_ROOT_DIR%\%%F" >nul 2>&1 + del /f /q "%CFG_ROOT_DIR%\%%F" >nul 2>&1 +) +exit /b 0 diff --git a/docs/Makefile b/docs/Makefile index 69fe55ec..d0c3cbf1 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,9 +1,10 @@ # Minimal makefile for Sphinx documentation # -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build SOURCEDIR = source BUILDDIR = build @@ -16,4 +17,4 @@ help: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/make.bat b/docs/make.bat index 543c6b13..6247f7e2 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -25,11 +25,11 @@ if errorlevel 9009 ( exit /b 1 ) -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% goto end :help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% :end popd diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index c9e8c654..00000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,29 +0,0 @@ -alabaster==0.7.12 -Babel==2.9.1 -certifi==2019.9.11 -chardet==3.0.4 -doc8==0.8.0 -docutils==0.15.2 -idna==2.8 -imagesize==1.1.0 -Jinja2==2.11.3 -MarkupSafe==1.1.1 -packaging==19.2 -pbr==5.4.3 -Pygments==2.7.4 -pyparsing==2.4.2 -pytz==2019.3 -requests==2.22.0 -restructuredtext-lint==1.3.0 -six==1.12.0 -snowballstemmer==2.0.0 -Sphinx==2.2.0 -sphinx-rtd-theme==0.4.3 -sphinxcontrib-applehelp==1.0.1 -sphinxcontrib-devhelp==1.0.1 -sphinxcontrib-htmlhelp==1.0.2 -sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.2 -sphinxcontrib-serializinghtml==1.1.3 -stevedore==1.31.0 -urllib3==1.25.6 diff --git a/docs/scripts/doc8_style_check.sh b/docs/scripts/doc8_style_check.sh index 91d7fb0b..4e1c8542 100755 --- a/docs/scripts/doc8_style_check.sh +++ b/docs/scripts/doc8_style_check.sh @@ -6,4 +6,4 @@ set -e # not in the same source folder as the include statement.) # [ToDo 1. Expand Scan to All Docs (source/) 2. Fix this D000 workaround if possible] # Doc Contribution Guide is at scancode-toolkit/contribute/contrib_doc.rst -doc8 --max-line-length 100 source/ --ignore D000 --quiet \ No newline at end of file +doc8 --max-line-length 100 source/ --ignore D000 --quiet diff --git a/docs/scripts/sphinx_build_link_check.sh b/docs/scripts/sphinx_build_link_check.sh index c5426863..f6fdd6c4 100755 --- a/docs/scripts/sphinx_build_link_check.sh +++ b/docs/scripts/sphinx_build_link_check.sh @@ -2,4 +2,4 @@ # halt script on error set -e # Build locally, and then check links -sphinx-build -E -W -b linkcheck source build \ No newline at end of file +sphinx-build -E -W source build \ No newline at end of file diff --git a/docs/source/_static/theme_overrides.css b/docs/source/_static/theme_overrides.css index f889139a..9662d63a 100644 --- a/docs/source/_static/theme_overrides.css +++ b/docs/source/_static/theme_overrides.css @@ -1,95 +1,69 @@ body { color: #000000; - /* this is the font-family used in the SPATS wiki */ - /* font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji; */ } p { margin-bottom: 10px; } -/* ul, ul.simple { - margin-bottom: 10px; -} */ - .wy-plain-list-disc, .rst-content .section ul, .rst-content .toctree-wrapper ul, article ul { margin-bottom: 10px; } -h1, h2, h3, h4, h5, h6 { - margin-bottom: 10px; +.custom_header_01 { + color: #cc0000; + font-size: 22px; + font-weight: bold; + line-height: 50px; } -h2, h3, h4, h5, h6 { +h1, h2, h3, h4, h5, h6 { + margin-bottom: 20px; margin-top: 20px; - margin-top: 30px; } h5 { - font-size: 17px; font-size: 18px; - color: #666666; color: #000000; font-style: italic; margin-bottom: 10px; } h6 { - font-size: 16px; - color: #666666; - color: #999999; - color: #778899; - color: #009999; - color: #006666; - color: #996633; - color: #009933; - color: #661aff; - /* color: #666699; */ - - /* font-style: italic; */ - /* font-weight: normal; */ + font-size: 15px; + color: #000000; + font-style: italic; margin-bottom: 10px; } /* custom admonitions */ /* success */ .custom-admonition-success .admonition-title { - color: #ffffff; color: #000000; - background: #009900; - background: #00b33c; background: #ccffcc; border-radius: 5px 5px 0px 0px; } div.custom-admonition-success.admonition { color: #000000; - background: #f5f5f5; background: #ffffff; - border: solid 1px #e8e8e8; border: solid 1px #cccccc; border-radius: 5px; - /* box-shadow: 5px 5px 18px #d8d8d8; */ box-shadow: 1px 1px 5px 3px #d8d8d8; margin: 20px 0px 30px 0px; } /* important */ .custom-admonition-important .admonition-title { - color: #ffffff; color: #000000; - background: #009900; - background: #00b33c; background: #ccffcc; border-radius: 5px 5px 0px 0px; + border-bottom: solid 1px #000000; } div.custom-admonition-important.admonition { color: #000000; - background: #f5f5f5; background: #ffffff; - border: solid 1px #e8e8e8; border: solid 1px #cccccc; border-radius: 5px; - /* box-shadow: 5px 5px 18px #d8d8d8; */ box-shadow: 1px 1px 5px 3px #d8d8d8; margin: 20px 0px 30px 0px; } @@ -97,20 +71,15 @@ div.custom-admonition-important.admonition { /* caution */ .custom-admonition-caution .admonition-title { color: #000000; - background: #ffff66; background: #ffff99; - background: #fff3cd; border-radius: 5px 5px 0px 0px; border-bottom: solid 1px #e8e8e8; } div.custom-admonition-caution.admonition { color: #000000; - background: #f5f5f5; background: #ffffff; - border: solid 1px #e8e8e8; border: solid 1px #cccccc; border-radius: 5px; - /* box-shadow: 5px 5px 18px #d8d8d8; */ box-shadow: 1px 1px 5px 3px #d8d8d8; margin: 20px 0px 30px 0px; } @@ -118,24 +87,14 @@ div.custom-admonition-caution.admonition { /* note */ .custom-admonition-note .admonition-title { color: #ffffff; - /* color: #000000; */ - background: #3399ff; background: #006bb3; - background: #cce5ff; - background: #b3d7ff; - background: #2196f3; border-radius: 5px 5px 0px 0px; } div.custom-admonition-note.admonition { color: #000000; - background: #f5f5f5; background: #ffffff; - border: solid 1px #e8e8e8; border: solid 1px #cccccc; - /* border: solid 1px #80bdff; */ - /* border: solid 1px #2196f3; */ border-radius: 5px; - /* box-shadow: 5px 5px 18px #d8d8d8; */ box-shadow: 1px 1px 5px 3px #d8d8d8; margin: 20px 0px 30px 0px; } @@ -143,34 +102,15 @@ div.custom-admonition-note.admonition { /* todo */ .custom-admonition-todo .admonition-title { color: #000000; - color: #cc0000; background: #cce6ff; - background: #ffcc00; - background: #ffeb99; - background: #ccffff; - background: #ffd9b3; - background: #ffffff; border-radius: 5px 5px 0px 0px; border-bottom: solid 1px #99ccff; - border-bottom: solid 1px #ffcc00; - border-bottom: solid 1px #ffeb99; - border-bottom: solid 1px #e8e8e8; - border-bottom: solid 1px #ffd9b3; - border-bottom: solid 1px #d8d8d8; } div.custom-admonition-todo.admonition { color: #000000; - background: #f5f5f5; background: #ffffff; - border: solid 1px #e8e8e8; - border: solid 1px #cccccc; border: solid 1px #99ccff; - border: solid 1px #ffcc00; - border: solid 1px #ffeb99; - border: solid 1px #ffd9b3; - border: solid 1px #cc0000; border-radius: 5px; - /* box-shadow: 5px 5px 18px #d8d8d8; */ box-shadow: 1px 1px 5px 3px #d8d8d8; margin: 20px 0px 30px 0px; } @@ -178,28 +118,20 @@ div.custom-admonition-todo.admonition { /* examples */ .custom-admonition-examples .admonition-title { color: #000000; - /* color: #ffffff; */ - background: #f5f5f5; - background: #e8e8e8; background: #ffe6cc; - /* background: #606060; */ border-radius: 5px 5px 0px 0px; border-bottom: solid 1px #d8d8d8; } div.custom-admonition-examples.admonition { color: #000000; - background: #f5f5f5; background: #ffffff; border: solid 1px #cccccc; border-radius: 5px; - /* box-shadow: 5px 5px 18px #d8d8d8; */ box-shadow: 1px 1px 5px 3px #d8d8d8; margin: 20px 0px 30px 0px; } .wy-nav-content { - /* max-width: 800px; */ - /* max-width: 1200px; */ max-width: 100%; padding-right: 100px; padding-left: 100px; @@ -209,42 +141,17 @@ div.custom-admonition-examples.admonition { div.rst-content { background-color: #ffffff; border: solid 1px #e5e5e5; - padding: 20px; padding: 20px 40px 20px 40px; } .rst-content .guilabel { - /* border: 1px solid #7fbbe3; */ - /* border: 1px solid #e7f2fa; */ - /* border: 1px solid #ffff99; */ - /* border: 1px solid #ccffcc; */ - /* border: 1px solid #f2f2f2; */ - /* border: 1px solid #e6f2ff; */ - /* border: 1px solid #fff3cd; */ - border: 1px solid #ccffff; - - /* background: #e7f2fa; */ - /* background: #e6ffff; */ - /* background: #ffff99; */ - /* background: #ccffcc; */ - /* background-color: #f2f2f2; */ - /* background: #e6f2ff; */ - /* background: #fff3cd; */ - background: #ccffff; - - /* font-size: 80%; */ + border: 1px solid #ffff99; + background: #ffff99; font-size: 100%; - /* font-size: 12px; */ - /* font-size: 14px; */ - /* font-size: 16px; */ - font-weight: 700; font-weight: normal; border-radius: 4px; - padding: 2.4px 6px; - padding: 4px 6px; padding: 2px 0px; margin: auto 2px; - vertical-align: middle; } @@ -273,13 +180,9 @@ div.rst-content { .wy-table-responsive table td { white-space: normal !important; } -/* .wy-table-responsive { - overflow: visible !important; -} */ .rst-content table.docutils td, .rst-content table.docutils th { - padding: 5px; padding: 5px 10px 5px 10px; } .rst-content table.docutils td p, @@ -294,11 +197,9 @@ div.rst-content { } .colwidths-given th { - /* border: solid 1px #e8e8e8 !important; */ border: solid 1px #d8d8d8 !important; } .colwidths-given td { - /* border: solid 1px #e8e8e8 !important; */ border: solid 1px #d8d8d8 !important; } @@ -308,7 +209,6 @@ div.rst-content { background-color: transparent; font-style: normal; font-family: "Courier New"; - font-size: 12px; font-size: 13px; padding: 3px 3px 3px 3px; } @@ -316,19 +216,13 @@ div.rst-content { .rst-content pre.literal-block, .rst-content div[class^="highlight"] pre, .rst-content .linenodiv pre { font-family: SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace; font-size: 13px; - /* line-height: 1.5; */ overflow: visible; white-space: pre-wrap; - /* color: #e74c3c; */ + color: #000000; } .rst-content pre.literal-block, .rst-content div[class^='highlight'] { - border: 1px solid #e1e4e5; - border: 0; - background-color: #f6f8fa; background-color: #f8f8f8; - /* background-color: #f2f2f2; */ - border: solid 1px #e5e5e5; border: solid 1px #e8e8e8; } @@ -338,7 +232,7 @@ code, .rst-content tt, .rst-content code { padding: 2px 3px 1px; border-radius: 3px; font-size: 13px; - background-color: #f8f8f8; + background-color: #ffffff; } /* use this added class for code blocks attached to bulleted list items */ @@ -347,16 +241,14 @@ code, .rst-content tt, .rst-content code { } /* change color of inline code block */ -/* span.pre { - color: #e74c3c; +span.pre { color: #e01e5a; -} */ +} .wy-body-for-nav blockquote { margin: 1em 0; padding-left: 1em; border-left: 4px solid #ddd; - color: #6a6a6a; color: #000000; } @@ -383,12 +275,15 @@ code, .rst-content tt, .rst-content code { /* remove extra space at bottom of multine list-table cell */ .rst-content .line-block { margin-left: 0px; - margin-bottom: 24px; margin-bottom: 0px; line-height: 24px; } -/* === */ +/* fix extra vertical spacing in page toctree */ +.rst-content .toctree-wrapper ul li ul, article ul li ul { + margin-top: 0; + margin-bottom: 0; +} /* this is used by the genindex added via layout.html (see source/_templates/) to sidebar toc */ .reference.internal.toc-index { @@ -402,9 +297,14 @@ code, .rst-content tt, .rst-content code { } .toc-index-div { - border-top: solid 1px #666666; + border-top: solid 1px #000000; margin-top: 10px; - padding-top: 10px; + padding-top: 5px; +} + +.indextable ul li { + font-size: 14px; + margin-bottom: 5px; } /* The next 2 fix the poor vertical spacing in genindex.html (the alphabetized index) */ @@ -413,5 +313,41 @@ code, .rst-content tt, .rst-content code { } div.genindex-jumpbox { - margin-bottom: 20px; + margin-bottom: 10px; +} + +/* rst image classes */ + +.clear-both { + clear: both; + } + +.float-left { + float: left; + margin-right: 20px; +} + +img { + border: solid 1px #e8e8e8; +} + +/* These are custom and need to be defined in conf.py to access in all pages, e.g., '.. role:: red' */ +.img-title { + color: #000000; + /* neither padding nor margin works for vertical spacing bc it's a span -- line-height does, sort of */ + line-height: 3.0; + font-style: italic; + font-weight: 600; +} + +.img-title-para { + color: #000000; + margin-top: 20px; + margin-bottom: 0px; + font-style: italic; + font-weight: 500; +} + +.red { + color: red; } diff --git a/docs/source/archive.rst b/docs/source/archive.rst new file mode 100644 index 00000000..ffc79217 --- /dev/null +++ b/docs/source/archive.rst @@ -0,0 +1,19 @@ +############## +Archived Pages +############## + +Archived aboutcode pages. + + +---- + +***************** +Table of Contents +***************** + +.. toctree:: + :maxdepth: 1 + + archive/gsoc-toc + archive/gsod-toc + archive/contributor_project_ideas diff --git a/docs/source/contributor_project_ideas.rst b/docs/source/archive/contributor_project_ideas.rst similarity index 100% rename from docs/source/contributor_project_ideas.rst rename to docs/source/archive/contributor_project_ideas.rst diff --git a/docs/source/gsoc-toc.rst b/docs/source/archive/gsoc-toc.rst similarity index 100% rename from docs/source/gsoc-toc.rst rename to docs/source/archive/gsoc-toc.rst diff --git a/docs/source/gsoc/gsoc19_final_report.rst b/docs/source/archive/gsoc/gsoc19_final_report.rst similarity index 100% rename from docs/source/gsoc/gsoc19_final_report.rst rename to docs/source/archive/gsoc/gsoc19_final_report.rst diff --git a/docs/source/gsoc/gsoc_2017.rst b/docs/source/archive/gsoc/gsoc_2017.rst similarity index 100% rename from docs/source/gsoc/gsoc_2017.rst rename to docs/source/archive/gsoc/gsoc_2017.rst diff --git a/docs/source/gsoc/gsoc_2018.rst b/docs/source/archive/gsoc/gsoc_2018.rst similarity index 100% rename from docs/source/gsoc/gsoc_2018.rst rename to docs/source/archive/gsoc/gsoc_2018.rst diff --git a/docs/source/gsoc/gsoc_2019.rst b/docs/source/archive/gsoc/gsoc_2019.rst similarity index 100% rename from docs/source/gsoc/gsoc_2019.rst rename to docs/source/archive/gsoc/gsoc_2019.rst diff --git a/docs/source/gsod-toc.rst b/docs/source/archive/gsod-toc.rst similarity index 100% rename from docs/source/gsod-toc.rst rename to docs/source/archive/gsod-toc.rst diff --git a/docs/source/gsod/gsod-2020.rst b/docs/source/archive/gsod/gsod-2020.rst similarity index 100% rename from docs/source/gsod/gsod-2020.rst rename to docs/source/archive/gsod/gsod-2020.rst diff --git a/docs/source/gsod/gsod-2021.rst b/docs/source/archive/gsod/gsod-2021.rst similarity index 100% rename from docs/source/gsod/gsod-2021.rst rename to docs/source/archive/gsod/gsod-2021.rst diff --git a/docs/source/gsod/gsod_2019.rst b/docs/source/archive/gsod/gsod_2019.rst similarity index 100% rename from docs/source/gsod/gsod_2019.rst rename to docs/source/archive/gsod/gsod_2019.rst diff --git a/docs/source/gsod/gsod_2019_report.rst b/docs/source/archive/gsod/gsod_2019_report.rst similarity index 100% rename from docs/source/gsod/gsod_2019_report.rst rename to docs/source/archive/gsod/gsod_2019_report.rst diff --git a/docs/source/conf.py b/docs/source/conf.py index 63130dfb..62bca04e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -2,7 +2,7 @@ # # This file only contains a selection of the most common options. For a full # list see the documentation: -# http://www.sphinx-doc.org/en/master/config +# https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- @@ -14,20 +14,12 @@ # import sys # sys.path.insert(0, os.path.abspath('.')) -# Adding Support for GIFs in Sphinx -from sphinx.builders.html import StandaloneHTMLBuilder -StandaloneHTMLBuilder.supported_image_types = [ - 'image/svg+xml', - 'image/gif', - 'image/png', - 'image/jpeg' -] # -- Project information ----------------------------------------------------- -project = 'AboutCode' -copyright = 'AboutCode Authors' -author = 'AboutCode Authors' +project = "nexb-skeleton" +copyright = "nexB Inc. and others." +author = "AboutCode.org authors and contributors" # -- General configuration --------------------------------------------------- @@ -36,17 +28,21 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ -'sphinx.ext.intersphinx' +'sphinx.ext.intersphinx', ] -# This points to scancode-toolkit.readthedocs.io +# This points to aboutcode.readthedocs.io # In case of "undefined label" ERRORS check docs on intersphinx to troubleshoot -# Link was created at commit - https://github.com/nexB/scancode-toolkit/commit/3a71e44a403e0da18217f327f2362f6031f53d4b -intersphinx_mapping = {'scancode-toolkit': ('https://scancode-toolkit.readthedocs.io/en/latest/', None), - 'scancode-workbench': ('https://scancode-workbench.readthedocs.io/en/develop/', None)} +# Link was created at commit - https://github.com/nexB/aboutcode/commit/faea9fcf3248f8f198844fe34d43833224ac4a83 + +intersphinx_mapping = { + 'aboutcode': ('https://aboutcode.readthedocs.io/en/latest/', None), + 'scancode-workbench': ('https://scancode-workbench.readthedocs.io/en/develop/', None), +} + # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -59,20 +55,45 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'sphinx_rtd_theme' +html_theme = "sphinx_rtd_theme" # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] -html_static_path = ['_static'] +master_doc = 'index' html_context = { - 'css_files': [ - '_static/theme_overrides.css', # override wide tables in RTD theme - ], - } + "display_github": True, + "github_user": "nexB", + "github_repo": "nexb-skeleton", + "github_version": "develop", # branch + "conf_py_path": "/docs/source/", # path in the checkout to the docs root +} -master_doc = 'index' +html_css_files = [ + '_static/theme_overrides.css' + ] + + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +html_show_sphinx = True + +# Define CSS and HTML abbreviations used in .rst files. These are examples. +# .. role:: is used to refer to styles defined in _static/theme_overrides.css and is used like this: :red:`text` +rst_prolog = """ +.. |psf| replace:: Python Software Foundation + +.. # define a hard line break for HTML +.. |br| raw:: html + +
+ +.. role:: red + +.. role:: img-title + +.. role:: img-title-para -linkcheck_ignore = [r'urn:dje:component:16fusb:1.0'] +""" diff --git a/docs/source/index.rst b/docs/source/index.rst index f810cee6..45e6fabe 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -2,9 +2,14 @@ AboutCode ######### -Welcome to the AboutCode documentation homepage. `AboutCode.org `_ is a community of open source developers who are trying to make open source easier to use by providing open source tools to discover, identify and track open source components (aka Software Composition Analysis – SCA). AboutCode is the collective name for these open source tools. +Welcome to the AboutCode documentation homepage. `AboutCode.org `_ is +a community of open source developers who are trying to make open source easier to use by providing +open source tools to discover, identify and track open source components +(aka Software Composition Analysis – SCA). AboutCode is the collective name for these +open source tools. -This home page provides a directory of our major projects and their documentation on ReadTheDocs plus information about how to contribute to AboutCode documentation +This home page provides a directory of our major projects and their documentation on ReadTheDocs +plus information about how to contribute to AboutCode documentation. All community contributions are welcome. @@ -22,4 +27,5 @@ Table of Contents aboutcode-data/abcd contributing doc_guidelines + archive license diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..cde79074 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,52 @@ +[build-system] +requires = ["setuptools >= 50", "wheel", "setuptools_scm[toml] >= 6"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +# this is used populated when creating a git archive +# and when there is .git dir and/or there is no git installed +fallback_version = "9999.$Format:%h-%cs$" + +[tool.pytest.ini_options] +norecursedirs = [ + ".git", + "bin", + "dist", + "build", + "_build", + "dist", + "etc", + "local", + "ci", + "docs", + "man", + "share", + "samples", + ".cache", + ".settings", + "Include", + "include", + "Lib", + "lib", + "lib64", + "Lib64", + "Scripts", + "thirdparty", + "tmp", + "venv", + "tests/data", + ".eggs", + "src/*/data", + "tests/*/data" +] + +python_files = "*.py" + +python_classes = "Test" +python_functions = "test" + +addopts = [ + "-rfExXw", + "--strict-markers", + "--doctest-modules" +] diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..03ee19a9 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,44 @@ +[metadata] +name = aboutcode +license = Apache-2.0 + +# description must be on ONE line https://github.com/pypa/setuptools/issues/1390 +description = aboutcode +long_description = file:README.rst +long_description_content_type = text/x-rst +url = https://github.com/nexB/aboutcode + +author = nexB. Inc. and others +author_email = info@aboutcode.org + +classifiers = + Development Status :: 5 - Production/Stable + Intended Audience :: Developers + Programming Language :: Python :: 3 + Programming Language :: Python :: 3 :: Only + Topic :: Software Development + Topic :: Utilities + +keywords = + docs + +license_files = + apache-2.0.LICENSE + NOTICE + +[options] +zip_safe = false + +setup_requires = setuptools_scm[toml] >= 4 + +python_requires = >=3.6.* + +install_requires = + + +[options.extras_require] + +docs = + Sphinx >= 3.3.1 + sphinx-rtd-theme >= 0.5.0 + doc8 >= 0.8.1 diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..bac24a43 --- /dev/null +++ b/setup.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python + +import setuptools + +if __name__ == "__main__": + setuptools.setup()