Skip to content

Commit 5f4febb

Browse files
authored
Merge pull request #72 from nexB/release-prep
Release prep Signed-off-by: Philippe Ombredanne <[email protected]>
2 parents 44cb4f6 + 74b9158 commit 5f4febb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+5873
-198
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+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
/Lib
1313
/pip-selfcheck.json
1414
/tmp
15+
/venv
1516
.Python
1617
/include
1718
/Include

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ python:
1919
install: ./configure --dev
2020

2121
# Scripts to run at script stage
22-
script: tmp/bin/pytest
22+
script: venv/bin/pytest

CHANGELOG.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
Changelog
22
=========
33

4+
5+
6+
30.0.0 - 2022-05-10
7+
----------------------
8+
9+
This is a minor release with API changes
10+
11+
- Use latest skeleton (and updated configure script)
12+
- Drop using calver
13+
- Improve error checking when combining licenses
14+
15+
16+
417
v21.6.14 - 2021-06-14
518
----------------------
619

apache-2.0.LICENSE

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,6 @@
174174
of your accepting any such warranty or additional liability.
175175

176176
END OF TERMS AND CONDITIONS
177-
<<<<<<< HEAD
178-
=======
179177

180178
APPENDIX: How to apply the Apache License to your work.
181179

@@ -201,4 +199,3 @@
201199
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202200
See the License for the specific language governing permissions and
203201
limitations under the License.
204-
>>>>>>> refs/remotes/skeleton/main

azure-pipelines.yml

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,58 +7,50 @@
77

88
jobs:
99

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

2618
- template: etc/ci/azure-posix.yml
2719
parameters:
2820
job_name: ubuntu20_cpython
2921
image_name: ubuntu-20.04
30-
python_versions: ['3.6', '3.7', '3.8', '3.9']
22+
python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10']
3123
test_suites:
32-
all: tmp/bin/pytest -n 2 -vvs
24+
all: venv/bin/pytest -n 2 -vvs
3325

3426
- template: etc/ci/azure-posix.yml
3527
parameters:
36-
job_name: macos1014_cpython
37-
image_name: macos-10.14
38-
python_versions: ['3.6', '3.7', '3.8', '3.9']
28+
job_name: macos1015_cpython
29+
image_name: macos-10.15
30+
python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10']
3931
test_suites:
40-
all: tmp/bin/pytest -n 2 -vvs
32+
all: venv/bin/pytest -n 2 -vvs
4133

4234
- template: etc/ci/azure-posix.yml
4335
parameters:
44-
job_name: macos1015_cpython
45-
image_name: macos-10.15
46-
python_versions: ['3.6', '3.7', '3.8', '3.9']
36+
job_name: macos11_cpython
37+
image_name: macos-11
38+
python_versions: ['3.7', '3.8', '3.9', '3.10']
4739
test_suites:
48-
all: tmp/bin/pytest -n 2 -vvs
40+
all: venv/bin/pytest -n 2 -vvs
4941

5042
- template: etc/ci/azure-win.yml
5143
parameters:
52-
job_name: win2016_cpython
53-
image_name: vs2017-win2016
54-
python_versions: ['3.6', '3.7', '3.8', '3.9']
44+
job_name: win2019_cpython
45+
image_name: windows-2019
46+
python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10']
5547
test_suites:
56-
all: tmp\Scripts\pytest -n 2 -vvs
48+
all: venv\Scripts\pytest -n 2 -vvs
5749

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

configure

Lines changed: 81 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ set -e
1111
#set -x
1212

1313
################################
14-
# A configuration script to set things up:
14+
# A configuration script to set things up:
1515
# create a virtualenv and install or update thirdparty packages.
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
################################
@@ -26,16 +28,15 @@ CLI_ARGS=$1
2628
################################
2729

2830
# Requirement arguments passed to pip and used by default or with --dev.
29-
REQUIREMENTS="--editable ."
30-
DEV_REQUIREMENTS="--editable .[testing]"
31+
REQUIREMENTS="--editable . --constraint requirements.txt"
32+
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
33-
VIRTUALENV_DIR=tmp
36+
VIRTUALENV_DIR=venv
3437

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

4041
# extra arguments passed to pip
4142
PIP_EXTRA_ARGS=" "
@@ -52,59 +53,37 @@ CFG_BIN_DIR=$CFG_ROOT_DIR/$VIRTUALENV_DIR/bin
5253

5354

5455
################################
55-
# Set the quiet flag to empty if not defined
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"
60+
fi
61+
62+
63+
################################
64+
# Set the quiet flag to empty if not defined
5665
if [[ "$CFG_QUIET" == "" ]]; then
5766
CFG_QUIET=" "
5867
fi
5968

6069

6170
################################
62-
# find a proper Python to run
71+
# Find a proper Python to run
6372
# Use environment variables or a file if available.
6473
# Otherwise the latest Python by default.
65-
if [[ "$PYTHON_EXECUTABLE" == "" ]]; then
66-
# check for a file named PYTHON_EXECUTABLE
67-
if [ -f "$CFG_ROOT_DIR/PYTHON_EXECUTABLE" ]; then
68-
PYTHON_EXECUTABLE=$(cat "$CFG_ROOT_DIR/PYTHON_EXECUTABLE")
69-
else
70-
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
7182
fi
72-
fi
73-
74-
75-
################################
76-
cli_help() {
77-
echo An initial configuration script
78-
echo " usage: ./configure [options]"
79-
echo
80-
echo The default is to configure for regular use. Use --dev for development.
81-
echo
82-
echo The options are:
83-
echo " --clean: clean built and installed files and exit."
84-
echo " --dev: configure the environment for development."
85-
echo " --help: display this help message and exit."
86-
echo
87-
echo By default, the python interpreter version found in the path is used.
88-
echo Alternatively, the PYTHON_EXECUTABLE environment variable can be set to
89-
echo configure another Python executable interpreter to use. If this is not
90-
echo set, a file named PYTHON_EXECUTABLE containing a single line with the
91-
echo path of the Python executable to use will be checked last.
92-
set +e
93-
exit
94-
}
95-
96-
97-
clean() {
98-
# Remove cleanable file and directories and files from the root dir.
99-
echo "* Cleaning ..."
100-
for cln in $CLEANABLE;
101-
do rm -rf "${CFG_ROOT_DIR:?}/${cln:?}";
102-
done
103-
set +e
104-
exit
10583
}
10684

10785

86+
################################
10887
create_virtualenv() {
10988
# create a virtualenv for Python
11089
# Note: we do not use the bundled Python 3 "venv" because its behavior and
@@ -120,7 +99,7 @@ create_virtualenv() {
12099
VIRTUALENV_PYZ="$CFG_ROOT_DIR/etc/thirdparty/virtualenv.pyz"
121100
else
122101
VIRTUALENV_PYZ="$CFG_ROOT_DIR/$VENV_DIR/virtualenv.pyz"
123-
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"
124103
fi
125104

126105
$PYTHON_EXECUTABLE "$VIRTUALENV_PYZ" \
@@ -135,6 +114,7 @@ create_virtualenv() {
135114
}
136115

137116

117+
################################
138118
install_packages() {
139119
# install requirements in virtualenv
140120
# note: --no-build-isolation means that pip/wheel/setuptools will not
@@ -151,19 +131,63 @@ install_packages() {
151131
}
152132

153133

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+
154168
################################
155169
# Main command line entry point
156-
CFG_DEV_MODE=0
157170
CFG_REQUIREMENTS=$REQUIREMENTS
158171

159-
case "$CLI_ARGS" in
160-
--help) cli_help;;
161-
--clean) clean;;
162-
--dev) CFG_REQUIREMENTS="$DEV_REQUIREMENTS" && CFG_DEV_MODE=1;;
163-
esac
164-
172+
# We are using getopts to parse option arguments that start with "-"
173+
while getopts :-: optchar; do
174+
case "${optchar}" in
175+
-)
176+
case "${OPTARG}" in
177+
help ) cli_help;;
178+
clean ) find_python && clean;;
179+
dev ) CFG_REQUIREMENTS="$DEV_REQUIREMENTS";;
180+
docs ) CFG_REQUIREMENTS="$DOCS_REQUIREMENTS";;
181+
esac;;
182+
esac
183+
done
184+
185+
PIP_EXTRA_ARGS="$PIP_EXTRA_ARGS"
186+
187+
find_python
165188
create_virtualenv "$VIRTUALENV_DIR"
166189
install_packages "$CFG_REQUIREMENTS"
167190
. "$CFG_BIN_DIR/activate"
168191

192+
169193
set +e

0 commit comments

Comments
 (0)