Skip to content

Commit f279238

Browse files
authored
Merge pull request #39 from nexB/38-add-warnings-to-codebase-headers
Add warnings field to codebase headers
2 parents 653225d + 0cc88fe commit f279238

37 files changed

+2820
-2505
lines changed

.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.7]
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v2
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+

azure-pipelines.yml

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,59 +6,51 @@
66

77
jobs:
88

9-
- template: etc/ci/azure-posix.yml
10-
parameters:
11-
job_name: ubuntu16_cpython
12-
image_name: ubuntu-16.04
13-
python_versions: ['3.6', '3.7', '3.8', '3.9']
14-
test_suites:
15-
all: venv/bin/pytest -vvs
16-
179
- template: etc/ci/azure-posix.yml
1810
parameters:
1911
job_name: ubuntu18_cpython
2012
image_name: ubuntu-18.04
21-
python_versions: ['3.6', '3.7', '3.8', '3.9']
13+
python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10']
2214
test_suites:
2315
all: venv/bin/pytest -n 2 -vvs
2416

2517
- template: etc/ci/azure-posix.yml
2618
parameters:
2719
job_name: ubuntu20_cpython
2820
image_name: ubuntu-20.04
29-
python_versions: ['3.6', '3.7', '3.8', '3.9']
21+
python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10']
3022
test_suites:
3123
all: venv/bin/pytest -n 2 -vvs
3224

3325
- template: etc/ci/azure-posix.yml
3426
parameters:
35-
job_name: macos1014_cpython
36-
image_name: macos-10.14
37-
python_versions: ['3.6', '3.7', '3.8', '3.9']
27+
job_name: macos1015_cpython
28+
image_name: macos-10.15
29+
python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10']
3830
test_suites:
3931
all: venv/bin/pytest -n 2 -vvs
4032

4133
- template: etc/ci/azure-posix.yml
4234
parameters:
43-
job_name: macos1015_cpython
44-
image_name: macos-10.15
45-
python_versions: ['3.6', '3.7', '3.8', '3.9']
35+
job_name: macos11_cpython
36+
image_name: macos-11
37+
python_versions: ['3.7', '3.8', '3.9', '3.10']
4638
test_suites:
4739
all: venv/bin/pytest -n 2 -vvs
4840

4941
- template: etc/ci/azure-win.yml
5042
parameters:
51-
job_name: win2016_cpython
52-
image_name: vs2017-win2016
53-
python_versions: ['3.6', '3.7', '3.8', '3.9']
43+
job_name: win2019_cpython
44+
image_name: windows-2019
45+
python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10']
5446
test_suites:
5547
all: venv\Scripts\pytest -n 2 -vvs
5648

5749
- template: etc/ci/azure-win.yml
5850
parameters:
59-
job_name: win2019_cpython
60-
image_name: windows-2019
61-
python_versions: ['3.6', '3.7', '3.8', '3.9']
51+
job_name: win2022_cpython
52+
image_name: windows-2022
53+
python_versions: ['3.7', '3.8', '3.9', '3.10']
6254
test_suites:
6355
all: venv\Scripts\pytest -n 2 -vvs
6456

configure

Lines changed: 62 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ set -e
1616
# Source this script for initial configuration
1717
# Use configure --help for details
1818
#
19+
# NOTE: please keep in sync with Windows script configure.bat
20+
#
1921
# This script will search for a virtualenv.pyz app in etc/thirdparty/virtualenv.pyz
2022
# Otherwise it will download the latest from the VIRTUALENV_PYZ_URL default
2123
################################
@@ -32,10 +34,8 @@ DEV_REQUIREMENTS="--editable .[testing] --constraint requirements.txt --constrai
3234
# where we create a virtualenv
3335
VIRTUALENV_DIR=venv
3436

35-
# Cleanable files and directories with the --clean option
36-
CLEANABLE="
37-
build
38-
venv"
37+
# Cleanable files and directories to delete with the --clean option
38+
CLEANABLE="build venv"
3939

4040
# extra arguments passed to pip
4141
PIP_EXTRA_ARGS=" "
@@ -50,8 +50,14 @@ VIRTUALENV_PYZ_URL=https://bootstrap.pypa.io/virtualenv.pyz
5050
CFG_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5151
CFG_BIN_DIR=$CFG_ROOT_DIR/$VIRTUALENV_DIR/bin
5252

53+
54+
################################
55+
# Thirdparty package locations and index handling
5356
# Find packages from the local thirdparty directory or from thirdparty.aboutcode.org
54-
PIP_EXTRA_ARGS="--find-links $CFG_ROOT_DIR/thirdparty --find-links https://thirdparty.aboutcode.org/pypi"
57+
if [ -f "$CFG_ROOT_DIR/thirdparty" ]; then
58+
PIP_EXTRA_ARGS="--find-links $CFG_ROOT_DIR/thirdparty"
59+
fi
60+
PIP_EXTRA_ARGS="$PIP_EXTRA_ARGS --find-links https://thirdparty.aboutcode.org/pypi/simple/links.html"
5561

5662

5763
################################
@@ -62,56 +68,22 @@ fi
6268

6369

6470
################################
65-
# find a proper Python to run
71+
# Find a proper Python to run
6672
# Use environment variables or a file if available.
6773
# Otherwise the latest Python by default.
68-
if [[ "$PYTHON_EXECUTABLE" == "" ]]; then
69-
# check for a file named PYTHON_EXECUTABLE
70-
if [ -f "$CFG_ROOT_DIR/PYTHON_EXECUTABLE" ]; then
71-
PYTHON_EXECUTABLE=$(cat "$CFG_ROOT_DIR/PYTHON_EXECUTABLE")
72-
else
73-
PYTHON_EXECUTABLE=python3
74+
find_python() {
75+
if [[ "$PYTHON_EXECUTABLE" == "" ]]; then
76+
# check for a file named PYTHON_EXECUTABLE
77+
if [ -f "$CFG_ROOT_DIR/PYTHON_EXECUTABLE" ]; then
78+
PYTHON_EXECUTABLE=$(cat "$CFG_ROOT_DIR/PYTHON_EXECUTABLE")
79+
else
80+
PYTHON_EXECUTABLE=python3
81+
fi
7482
fi
75-
fi
76-
77-
78-
################################
79-
cli_help() {
80-
echo An initial configuration script
81-
echo " usage: ./configure [options]"
82-
echo
83-
echo The default is to configure for regular use. Use --dev for development.
84-
echo Use the --init option if starting a new project and the project
85-
echo dependencies are not available on thirdparty.aboutcode.org/pypi/
86-
echo and requirements.txt and/or requirements-dev.txt has not been generated.
87-
echo
88-
echo The options are:
89-
echo " --clean: clean built and installed files and exit."
90-
echo " --dev: configure the environment for development."
91-
echo " --init: pull dependencies from PyPI. Used when first setting up a project."
92-
echo " --help: display this help message and exit."
93-
echo
94-
echo By default, the python interpreter version found in the path is used.
95-
echo Alternatively, the PYTHON_EXECUTABLE environment variable can be set to
96-
echo configure another Python executable interpreter to use. If this is not
97-
echo set, a file named PYTHON_EXECUTABLE containing a single line with the
98-
echo path of the Python executable to use will be checked last.
99-
set +e
100-
exit
101-
}
102-
103-
104-
clean() {
105-
# Remove cleanable file and directories and files from the root dir.
106-
echo "* Cleaning ..."
107-
for cln in $CLEANABLE;
108-
do rm -rf "${CFG_ROOT_DIR:?}/${cln:?}";
109-
done
110-
set +e
111-
exit
11283
}
11384

11485

86+
################################
11587
create_virtualenv() {
11688
# create a virtualenv for Python
11789
# Note: we do not use the bundled Python 3 "venv" because its behavior and
@@ -127,7 +99,7 @@ create_virtualenv() {
12799
VIRTUALENV_PYZ="$CFG_ROOT_DIR/etc/thirdparty/virtualenv.pyz"
128100
else
129101
VIRTUALENV_PYZ="$CFG_ROOT_DIR/$VENV_DIR/virtualenv.pyz"
130-
wget -O "$VIRTUALENV_PYZ" "$VIRTUALENV_PYZ_URL"
102+
wget -O "$VIRTUALENV_PYZ" "$VIRTUALENV_PYZ_URL" 2>/dev/null || curl -o "$VIRTUALENV_PYZ" "$VIRTUALENV_PYZ_URL"
131103
fi
132104

133105
$PYTHON_EXECUTABLE "$VIRTUALENV_PYZ" \
@@ -142,6 +114,7 @@ create_virtualenv() {
142114
}
143115

144116

117+
################################
145118
install_packages() {
146119
# install requirements in virtualenv
147120
# note: --no-build-isolation means that pip/wheel/setuptools will not
@@ -158,29 +131,62 @@ install_packages() {
158131
}
159132

160133

134+
################################
135+
cli_help() {
136+
echo An initial configuration script
137+
echo " usage: ./configure [options]"
138+
echo
139+
echo The default is to configure for regular use. Use --dev for development.
140+
echo
141+
echo The options are:
142+
echo " --clean: clean built and installed files and exit."
143+
echo " --dev: configure the environment for development."
144+
echo " --help: display this help message and exit."
145+
echo
146+
echo By default, the python interpreter version found in the path is used.
147+
echo Alternatively, the PYTHON_EXECUTABLE environment variable can be set to
148+
echo configure another Python executable interpreter to use. If this is not
149+
echo set, a file named PYTHON_EXECUTABLE containing a single line with the
150+
echo path of the Python executable to use will be checked last.
151+
set +e
152+
exit
153+
}
154+
155+
156+
################################
157+
clean() {
158+
# Remove cleanable file and directories and files from the root dir.
159+
echo "* Cleaning ..."
160+
for cln in $CLEANABLE;
161+
do rm -rf "${CFG_ROOT_DIR:?}/${cln:?}";
162+
done
163+
set +e
164+
exit
165+
}
166+
167+
161168
################################
162169
# Main command line entry point
163-
CFG_DEV_MODE=0
164170
CFG_REQUIREMENTS=$REQUIREMENTS
165-
NO_INDEX="--no-index"
166171

167172
# We are using getopts to parse option arguments that start with "-"
168173
while getopts :-: optchar; do
169174
case "${optchar}" in
170175
-)
171176
case "${OPTARG}" in
172177
help ) cli_help;;
173-
clean ) clean;;
174-
dev ) CFG_REQUIREMENTS="$DEV_REQUIREMENTS" && CFG_DEV_MODE=1;;
175-
init ) NO_INDEX="";;
178+
clean ) find_python && clean;;
179+
dev ) CFG_REQUIREMENTS="$DEV_REQUIREMENTS";;
176180
esac;;
177181
esac
178182
done
179183

180-
PIP_EXTRA_ARGS="$PIP_EXTRA_ARGS $NO_INDEX"
184+
PIP_EXTRA_ARGS="$PIP_EXTRA_ARGS"
181185

186+
find_python
182187
create_virtualenv "$VIRTUALENV_DIR"
183188
install_packages "$CFG_REQUIREMENTS"
184189
. "$CFG_BIN_DIR/activate"
185190

191+
186192
set +e

0 commit comments

Comments
 (0)