Skip to content

Commit ea51a00

Browse files
authored
Merge pull request #508 from nexB/release-prep
Release prep
2 parents 27ef405 + 2be0e92 commit ea51a00

32 files changed

+1931
-3065
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.9]
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+

.github/workflows/pypi-release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release library as a PyPI wheel and sdist on GH release creation
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build-and-publish-to-pypi:
9+
name: Build and publish library to PyPI
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- uses: actions/checkout@master
13+
- name: Set up Python
14+
uses: actions/setup-python@v1
15+
with:
16+
python-version: 3.9
17+
- name: Install pypa/build
18+
run: python -m pip install build --user
19+
- name: Build a binary wheel and a source tarball
20+
run: python -m build --sdist --wheel --outdir dist/
21+
.
22+
- name: Publish distribution to PyPI
23+
if: startsWith(github.ref, 'refs/tags')
24+
uses: pypa/gh-action-pypi-publish@master
25+
with:
26+
password: ${{ secrets.PYPI_API_TOKEN }}
27+

CHANGELOG.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
==============================
2+
Changelog
3+
==============================
4+
5+
2022-03-21
6+
Release 7.0.2
7+
8+
* Relax dependency constraints
9+
* Use latest skeleton and settings
10+
11+
112
2022-03-21
213
Release 7.0.1
314

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ include *.rst
99
include setup.*
1010
include configure*
1111
include requirements*
12-
include .git*
12+
include .giti*
1313

1414
global-exclude *.py[co] __pycache__ *.*~
1515

README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
=================
12
AboutCode Toolkit
23
=================
34

azure-pipelines.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ jobs:
3131
test_suites:
3232
all: venv/bin/pytest -n 2 -vvs
3333

34-
- template: etc/ci/azure-win.yml
34+
- template: etc/ci/azure-posix.yml
3535
parameters:
36-
job_name: win2016_cpython
37-
image_name: vs2017-win2016
38-
python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10']
36+
job_name: macos11_cpython
37+
image_name: macos-11
38+
python_versions: ['3.7', '3.8', '3.9', '3.10']
3939
test_suites:
40-
all: venv\Scripts\pytest -n 2 -vvs
40+
all: venv/bin/pytest -n 2 -vvs
4141

4242
- template: etc/ci/azure-win.yml
4343
parameters:
@@ -47,3 +47,10 @@ jobs:
4747
test_suites:
4848
all: venv\Scripts\pytest -n 2 -vvs
4949

50+
- template: etc/ci/azure-win.yml
51+
parameters:
52+
job_name: win2022_cpython
53+
image_name: windows-2022
54+
python_versions: ['3.7', '3.8', '3.9', '3.10']
55+
test_suites:
56+
all: venv\Scripts\pytest -n 2 -vvs

configure

Lines changed: 62 additions & 63 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
################################
@@ -28,19 +30,13 @@ CLI_ARGS=$1
2830
# Requirement arguments passed to pip and used by default or with --dev.
2931
REQUIREMENTS="--editable . --constraint requirements.txt"
3032
DEV_REQUIREMENTS="--editable .[testing] --constraint requirements.txt --constraint requirements-dev.txt"
33+
DOCS_REQUIREMENTS="--editable .[docs] --constraint requirements.txt"
3134

3235
# where we create a virtualenv
3336
VIRTUALENV_DIR=venv
3437

35-
# Cleanable files and directories with the --clean option
36-
CLEANABLE="
37-
build
38-
tmp
39-
bin
40-
Lib
41-
Scripts
42-
include
43-
venv"
38+
# Cleanable files and directories to delete with the --clean option
39+
CLEANABLE="build venv"
4440

4541
# extra arguments passed to pip
4642
PIP_EXTRA_ARGS=" "
@@ -55,11 +51,13 @@ VIRTUALENV_PYZ_URL=https://bootstrap.pypa.io/virtualenv.pyz
5551
CFG_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5652
CFG_BIN_DIR=$CFG_ROOT_DIR/$VIRTUALENV_DIR/bin
5753

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

6462

6563
################################
@@ -70,56 +68,22 @@ fi
7068

7169

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

12285

86+
################################
12387
create_virtualenv() {
12488
# create a virtualenv for Python
12589
# Note: we do not use the bundled Python 3 "venv" because its behavior and
@@ -150,6 +114,7 @@ create_virtualenv() {
150114
}
151115

152116

117+
################################
153118
install_packages() {
154119
# install requirements in virtualenv
155120
# note: --no-build-isolation means that pip/wheel/setuptools will not
@@ -166,29 +131,63 @@ install_packages() {
166131
}
167132

168133

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+
169168
################################
170169
# Main command line entry point
171-
CFG_DEV_MODE=0
172170
CFG_REQUIREMENTS=$REQUIREMENTS
173-
NO_INDEX="--no-index"
174171

175172
# We are using getopts to parse option arguments that start with "-"
176173
while getopts :-: optchar; do
177174
case "${optchar}" in
178175
-)
179176
case "${OPTARG}" in
180177
help ) cli_help;;
181-
clean ) clean;;
182-
dev ) CFG_REQUIREMENTS="$DEV_REQUIREMENTS" && CFG_DEV_MODE=1;;
183-
init ) NO_INDEX="";;
178+
clean ) find_python && clean;;
179+
dev ) CFG_REQUIREMENTS="$DEV_REQUIREMENTS";;
180+
docs ) CFG_REQUIREMENTS="$DOCS_REQUIREMENTS";;
184181
esac;;
185182
esac
186183
done
187184

188-
PIP_EXTRA_ARGS="$PIP_EXTRA_ARGS $NO_INDEX"
185+
PIP_EXTRA_ARGS="$PIP_EXTRA_ARGS"
189186

187+
find_python
190188
create_virtualenv "$VIRTUALENV_DIR"
191189
install_packages "$CFG_REQUIREMENTS"
192190
. "$CFG_BIN_DIR/activate"
193191

192+
194193
set +e

0 commit comments

Comments
 (0)