Skip to content

Commit 0b297fd

Browse files
committed
Merge remote-tracking branch 'skeleton/main' into update-skeleton
2 parents 205da7e + 8b1757b commit 0b297fd

24 files changed

Lines changed: 1516 additions & 716 deletions

.github/workflows/docs-ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI Documentation
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-20.04
8+
9+
strategy:
10+
max-parallel: 4
11+
matrix:
12+
python-version: [3.9]
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
23+
- name: Give permission to run scripts
24+
run: chmod +x ./docs/scripts/doc8_style_check.sh
25+
26+
- name: Install Dependencies
27+
run: pip install -e .[docs]
28+
29+
- name: Check Sphinx Documentation build minimally
30+
working-directory: ./docs
31+
run: sphinx-build -E -W source build
32+
33+
- name: Check for documentation style errors
34+
working-directory: ./docs
35+
run: ./scripts/doc8_style_check.sh
36+
37+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
*.py[cod]
33

44
# virtualenv and other misc bits
5+
/src/*.egg-info
56
*.egg-info
67
/dist
78
/build

.readthedocs.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@
55
# Required
66
version: 2
77

8+
# Build in latest ubuntu/python
9+
build:
10+
os: ubuntu-22.04
11+
tools:
12+
python: "3.11"
13+
14+
# Build PDF & ePub
15+
formats:
16+
- epub
17+
- pdf
18+
819
# Where the Sphinx conf.py file is located
920
sphinx:
1021
configuration: docs/source/conf.py

CODE_OF_CONDUCT.rst

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
Contributor Covenant Code of Conduct
2+
====================================
3+
4+
Our Pledge
5+
----------
6+
7+
In the interest of fostering an open and welcoming environment, we as
8+
contributors and maintainers pledge to making participation in our
9+
project and our community a harassment-free experience for everyone,
10+
regardless of age, body size, disability, ethnicity, gender identity and
11+
expression, level of experience, education, socio-economic status,
12+
nationality, personal appearance, race, religion, or sexual identity and
13+
orientation.
14+
15+
Our Standards
16+
-------------
17+
18+
Examples of behavior that contributes to creating a positive environment
19+
include:
20+
21+
- Using welcoming and inclusive language
22+
- Being respectful of differing viewpoints and experiences
23+
- Gracefully accepting constructive criticism
24+
- Focusing on what is best for the community
25+
- Showing empathy towards other community members
26+
27+
Examples of unacceptable behavior by participants include:
28+
29+
- The use of sexualized language or imagery and unwelcome sexual
30+
attention or advances
31+
- Trolling, insulting/derogatory comments, and personal or political
32+
attacks
33+
- Public or private harassment
34+
- Publishing others’ private information, such as a physical or
35+
electronic address, without explicit permission
36+
- Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
Our Responsibilities
40+
--------------------
41+
42+
Project maintainers are responsible for clarifying the standards of
43+
acceptable behavior and are expected to take appropriate and fair
44+
corrective action in response to any instances of unacceptable behavior.
45+
46+
Project maintainers have the right and responsibility to remove, edit,
47+
or reject comments, commits, code, wiki edits, issues, and other
48+
contributions that are not aligned to this Code of Conduct, or to ban
49+
temporarily or permanently any contributor for other behaviors that they
50+
deem inappropriate, threatening, offensive, or harmful.
51+
52+
Scope
53+
-----
54+
55+
This Code of Conduct applies both within project spaces and in public
56+
spaces when an individual is representing the project or its community.
57+
Examples of representing a project or community include using an
58+
official project e-mail address, posting via an official social media
59+
account, or acting as an appointed representative at an online or
60+
offline event. Representation of a project may be further defined and
61+
clarified by project maintainers.
62+
63+
Enforcement
64+
-----------
65+
66+
Instances of abusive, harassing, or otherwise unacceptable behavior may
67+
be reported by contacting the project team at pombredanne@gmail.com
68+
or on the Gitter chat channel at https://gitter.im/aboutcode-org/discuss .
69+
All complaints will be reviewed and investigated and will result in a
70+
response that is deemed necessary and appropriate to the circumstances.
71+
The project team is obligated to maintain confidentiality with regard to
72+
the reporter of an incident. Further details of specific enforcement
73+
policies may be posted separately.
74+
75+
Project maintainers who do not follow or enforce the Code of Conduct in
76+
good faith may face temporary or permanent repercussions as determined
77+
by other members of the project’s leadership.
78+
79+
Attribution
80+
-----------
81+
82+
This Code of Conduct is adapted from the `Contributor Covenant`_ ,
83+
version 1.4, available at
84+
https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
85+
86+
.. _Contributor Covenant: https://www.contributor-covenant.org

Makefile

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
#
3+
# Copyright (c) nexB Inc. and others. All rights reserved.
4+
# ScanCode is a trademark of nexB Inc.
5+
# SPDX-License-Identifier: Apache-2.0
6+
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
7+
# See https://github.com/nexB/skeleton for support or download.
8+
# See https://aboutcode.org for more information about nexB OSS projects.
9+
#
10+
11+
# Python version can be specified with `$ PYTHON_EXE=python3.x make conf`
12+
PYTHON_EXE?=python3
13+
VENV=venv
14+
ACTIVATE?=. ${VENV}/bin/activate;
15+
16+
dev:
17+
@echo "-> Configure the development envt."
18+
./configure --dev
19+
20+
isort:
21+
@echo "-> Apply isort changes to ensure proper imports ordering"
22+
${VENV}/bin/isort --sl -l 100 src tests setup.py
23+
24+
black:
25+
@echo "-> Apply black code formatter"
26+
${VENV}/bin/black -l 100 src tests setup.py
27+
28+
doc8:
29+
@echo "-> Run doc8 validation"
30+
@${ACTIVATE} doc8 --max-line-length 100 --ignore-path docs/_build/ --quiet docs/
31+
32+
valid: isort black
33+
34+
check:
35+
@echo "-> Run pycodestyle (PEP8) validation"
36+
@${ACTIVATE} pycodestyle --max-line-length=100 --exclude=.eggs,venv,lib,thirdparty,docs,migrations,settings.py,.cache .
37+
@echo "-> Run isort imports ordering validation"
38+
@${ACTIVATE} isort --sl --check-only -l 100 setup.py src tests .
39+
@echo "-> Run black validation"
40+
@${ACTIVATE} black --check --check -l 100 src tests setup.py
41+
42+
clean:
43+
@echo "-> Clean the Python env"
44+
./configure --clean
45+
46+
test:
47+
@echo "-> Run the test suite"
48+
${VENV}/bin/pytest -vvs
49+
50+
docs:
51+
rm -rf docs/_build/
52+
@${ACTIVATE} sphinx-build docs/ docs/_build/
53+
54+
.PHONY: conf dev check valid black isort clean test docs

azure-pipelines.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ jobs:
99

1010
- template: etc/ci/azure-posix.yml
1111
parameters:
12-
job_name: ubuntu18_cpython
13-
image_name: ubuntu-18.04
12+
job_name: ubuntu20_cpython
13+
image_name: ubuntu-20.04
1414
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
1515
test_suites:
1616
all: |
@@ -19,8 +19,8 @@ jobs:
1919
2020
- template: etc/ci/azure-posix.yml
2121
parameters:
22-
job_name: ubuntu20_cpython
23-
image_name: ubuntu-20.04
22+
job_name: ubuntu22_cpython
23+
image_name: ubuntu-22.04
2424
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
2525
test_suites:
2626
all: |
@@ -29,8 +29,8 @@ jobs:
2929
3030
- template: etc/ci/azure-posix.yml
3131
parameters:
32-
job_name: macos1015_cpython
33-
image_name: macos-10.15
32+
job_name: macos11_cpython
33+
image_name: macOS-11
3434
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
3535
test_suites:
3636
all: |
@@ -39,8 +39,18 @@ jobs:
3939
4040
- template: etc/ci/azure-posix.yml
4141
parameters:
42-
job_name: macos11_cpython
43-
image_name: macos-11
42+
job_name: macos12_cpython
43+
image_name: macOS-12
44+
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
45+
test_suites:
46+
all: |
47+
source venv/bin/activate
48+
pytest -n 2 -vvs
49+
50+
- template: etc/ci/azure-posix.yml
51+
parameters:
52+
job_name: macos13_cpython
53+
image_name: macOS-13
4454
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
4555
test_suites:
4656
all: |

configure

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ CLI_ARGS=$1
3030
# Requirement arguments passed to pip and used by default or with --dev.
3131
REQUIREMENTS="--editable . --constraint requirements.txt"
3232
DEV_REQUIREMENTS="--editable .[testing] --constraint requirements.txt --constraint requirements-dev.txt"
33+
DOCS_REQUIREMENTS="--editable .[docs] --constraint requirements.txt"
3334

3435
# where we create a virtualenv
3536
VIRTUALENV_DIR=venv
3637

3738
# Cleanable files and directories to delete with the --clean option
38-
CLEANABLE="build venv"
39+
CLEANABLE="build dist venv .cache .eggs"
3940

4041
# extra arguments passed to pip
4142
PIP_EXTRA_ARGS=" "
@@ -51,13 +52,20 @@ CFG_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5152
CFG_BIN_DIR=$CFG_ROOT_DIR/$VIRTUALENV_DIR/bin
5253

5354

55+
################################
56+
# Install with or without and index. With "--no-index" this is using only local wheels
57+
# This is an offline mode with no index and no network operations
58+
# NO_INDEX="--no-index "
59+
NO_INDEX=""
60+
61+
5462
################################
5563
# Thirdparty package locations and index handling
56-
# Find packages from the local thirdparty directory or from thirdparty.aboutcode.org
57-
if [ -f "$CFG_ROOT_DIR/thirdparty" ]; then
58-
PIP_EXTRA_ARGS="--find-links $CFG_ROOT_DIR/thirdparty"
64+
# Find packages from the local thirdparty directory if present
65+
THIRDPARDIR=$CFG_ROOT_DIR/thirdparty
66+
if [[ "$(echo $THIRDPARDIR/*.whl)x" != "$THIRDPARDIR/*.whlx" ]]; then
67+
PIP_EXTRA_ARGS="$NO_INDEX --find-links $THIRDPARDIR"
5968
fi
60-
PIP_EXTRA_ARGS="$PIP_EXTRA_ARGS --find-links https://thirdparty.aboutcode.org/pypi/simple/links.html"
6169

6270

6371
################################
@@ -177,10 +185,12 @@ while getopts :-: optchar; do
177185
help ) cli_help;;
178186
clean ) find_python && clean;;
179187
dev ) CFG_REQUIREMENTS="$DEV_REQUIREMENTS";;
188+
docs ) CFG_REQUIREMENTS="$DOCS_REQUIREMENTS";;
180189
esac;;
181190
esac
182191
done
183192

193+
184194
PIP_EXTRA_ARGS="$PIP_EXTRA_ARGS"
185195

186196
find_python

configure.bat

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@
2828
@rem # Requirement arguments passed to pip and used by default or with --dev.
2929
set "REQUIREMENTS=--editable . --constraint requirements.txt"
3030
set "DEV_REQUIREMENTS=--editable .[testing] --constraint requirements.txt --constraint requirements-dev.txt"
31+
set "DOCS_REQUIREMENTS=--editable .[docs] --constraint requirements.txt"
3132

3233
@rem # where we create a virtualenv
3334
set "VIRTUALENV_DIR=venv"
3435

3536
@rem # Cleanable files and directories to delete with the --clean option
36-
set "CLEANABLE=build venv"
37+
set "CLEANABLE=build dist venv .cache .eggs"
3738

3839
@rem # extra arguments passed to pip
3940
set "PIP_EXTRA_ARGS= "
@@ -51,11 +52,10 @@ set "CFG_BIN_DIR=%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\Scripts"
5152

5253
@rem ################################
5354
@rem # Thirdparty package locations and index handling
54-
@rem # Find packages from the local thirdparty directory or from thirdparty.aboutcode.org
55+
@rem # Find packages from the local thirdparty directory
5556
if exist "%CFG_ROOT_DIR%\thirdparty" (
5657
set PIP_EXTRA_ARGS=--find-links "%CFG_ROOT_DIR%\thirdparty"
5758
)
58-
set "PIP_EXTRA_ARGS=%PIP_EXTRA_ARGS% --find-links https://thirdparty.aboutcode.org/pypi/simple/links.html"
5959

6060

6161
@rem ################################
@@ -68,7 +68,6 @@ if not defined CFG_QUIET (
6868
@rem ################################
6969
@rem # Main command line entry point
7070
set "CFG_REQUIREMENTS=%REQUIREMENTS%"
71-
set "NO_INDEX=--no-index"
7271

7372
:again
7473
if not "%1" == "" (
@@ -77,6 +76,9 @@ if not "%1" == "" (
7776
if "%1" EQU "--dev" (
7877
set "CFG_REQUIREMENTS=%DEV_REQUIREMENTS%"
7978
)
79+
if "%1" EQU "--docs" (
80+
set "CFG_REQUIREMENTS=%DOCS_REQUIREMENTS%"
81+
)
8082
shift
8183
goto again
8284
)

0 commit comments

Comments
 (0)