Skip to content

Commit

Permalink
Merge pull request #32 from nexB/release-prep
Browse files Browse the repository at this point in the history
Release prep
  • Loading branch information
pombredanne authored Aug 24, 2022
2 parents 8ae2389 + 09b8ec4 commit 240e24a
Show file tree
Hide file tree
Showing 9 changed files with 202 additions and 75 deletions.
96 changes: 76 additions & 20 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,83 @@
name: Release library as a PyPI wheel and sdist on GH release creation
name: Create library release archives, create a GH release and publish PyPI wheel and sdist on tag in main branch


# This is executed automatically on a tag in the main branch

# Summary of the steps:
# - build wheels and sdist
# - upload wheels and sdist to PyPI
# - create gh-release and upload wheels and dists there
# TODO: smoke test wheels and sdist
# TODO: add changelog to release text body

# WARNING: this is designed only for packages building as pure Python wheels

on:
release:
types: [created]
workflow_dispatch:
push:
tags:
- "v*.*.*"

jobs:
build-and-publish-to-pypi:
build-pypi-distribs:
name: Build and publish library to PyPI
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.9

- name: Install pypa/build
run: python -m pip install build --user

- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/

- name: Upload built archives
uses: actions/upload-artifact@v3
with:
name: pypi_archives
path: dist/*


create-gh-release:
name: Create GH release
needs:
- build-pypi-distribs
runs-on: ubuntu-20.04

steps:
- name: Download built archives
uses: actions/download-artifact@v3
with:
name: pypi_archives
path: dist

- name: Create GH release
uses: softprops/action-gh-release@v1
with:
draft: true
files: dist/*


create-pypi-release:
name: Create PyPI release
needs:
- create-gh-release
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install pypa/build
run: python -m pip install build --user
- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/
.
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Download built archives
uses: actions/download-artifact@v3
with:
name: pypi_archives
path: dist

- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
6 changes: 5 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
Changelog
=========

v31.0.0b1 - 2022-05-25

v31.0.0 - 2022-08-24
------------------------

- Fix error when using ``get_license_detection_from_nameless_paragraph()`` on
Debian copyright files who named the license field as ``licence`` #25
- Use latest skeleton
- Bump dependencies
- Drop Python 3.6 support


v30.0.0 - 2021-09-07
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
=================================
debian_inspector
debian-inspector
=================================

Utilities to parse Debian package, copyright and control files
Expand Down
59 changes: 55 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,39 @@

jobs:

################################################################################
# These jobs are using VMs and Azure-provided Pythons 3.8
################################################################################

- template: etc/ci/azure-posix.yml
parameters:
job_name: ubuntu18_cpython
image_name: ubuntu-18.04
python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10']
python_versions: ['3.7', '3.8', '3.9', '3.10']
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: ubuntu20_cpython
image_name: ubuntu-20.04
python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10']
python_versions: ['3.7', '3.8', '3.9', '3.10']
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: ubuntu22_cpython
image_name: ubuntu-22.04
python_versions: ['3.7', '3.8', '3.9', '3.10']
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos1015_cpython
image_name: macos-10.15
python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10']
python_versions: ['3.7', '3.8', '3.9', '3.10']
test_suites:
all: venv/bin/pytest -n 2 -vvs

Expand All @@ -39,11 +51,19 @@ jobs:
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos12_cpython
image_name: macos-12
python_versions: ['3.7', '3.8', '3.9', '3.10']
test_suites:
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-win.yml
parameters:
job_name: win2019_cpython
image_name: windows-2019
python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10']
python_versions: ['3.7', '3.8', '3.9', '3.10']
test_suites:
all: venv\Scripts\pytest -n 2 -vvs

Expand All @@ -54,3 +74,34 @@ jobs:
python_versions: ['3.7', '3.8', '3.9', '3.10']
test_suites:
all: venv\Scripts\pytest -n 2 -vvs


################################################################################
# Tests using a plain pip install to get the latest of all wheels
################################################################################


- template: etc/ci/azure-posix.yml
parameters:
job_name: ubuntu20_cpython_latest_from_pip
image_name: ubuntu-20.04
python_versions: ['3.7', '3.8', '3.9', '3.10']
test_suites:
all: venv/bin/pip install --upgrade-strategy eager --force-reinstall --upgrade -e . && venv/bin/pytest -n 2 -vvs


- template: etc/ci/azure-win.yml
parameters:
job_name: win2019_cpython_latest_from_pip
image_name: windows-2019
python_versions: ['3.7', '3.8', '3.9', '3.10']
test_suites:
all: venv\Scripts\pip install --upgrade-strategy eager --force-reinstall --upgrade -e . && venv\Scripts\pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos11_cpython_latest_from_pip
image_name: macos-11
python_versions: ['3.7', '3.8', '3.9', '3.10']
test_suites:
all: venv/bin/pip install --upgrade-strategy eager --force-reinstall --upgrade -e . && venv/bin/pytest -n 2 -vvs
15 changes: 12 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,19 @@ CFG_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
CFG_BIN_DIR=$CFG_ROOT_DIR/$VIRTUALENV_DIR/bin


################################
# Install with or without and index. With "--no-index" this is using only local wheels
# This is an offline mode with no index and no network operations
# NO_INDEX="--no-index "
NO_INDEX=""


################################
# Thirdparty package locations and index handling
# Find packages from the local thirdparty directory
if [ -d "$CFG_ROOT_DIR/thirdparty" ]; then
PIP_EXTRA_ARGS="--find-links $CFG_ROOT_DIR/thirdparty"
# Find packages from the local thirdparty directory if present
THIRDPARDIR=$CFG_ROOT_DIR/thirdparty
if [[ "$(echo $THIRDPARDIR/*.whl)x" != "$THIRDPARDIR/*.whlx" ]]; then
PIP_EXTRA_ARGS="$NO_INDEX --find-links $THIRDPARDIR"
fi


Expand Down Expand Up @@ -182,6 +190,7 @@ while getopts :-: optchar; do
esac
done


PIP_EXTRA_ARGS="$PIP_EXTRA_ARGS"

find_python
Expand Down
1 change: 1 addition & 0 deletions etc/scripts/utils_thirdparty.py
Original file line number Diff line number Diff line change
Expand Up @@ -1678,6 +1678,7 @@ def get_package_version(self, name, version=None):
"""
if not version:
versions = list(self._get_package_versions_map(name).values())
# return the latest version
return versions and versions[-1]
else:
return self._get_package_versions_map(name).get(version)
Expand Down
33 changes: 20 additions & 13 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
aboutcode-toolkit==7.0.1
bleach==4.1.0
aboutcode-toolkit==7.0.2
black==22.6.0
bleach==5.0.1
build==0.7.0
commonmark==0.9.1
docutils==0.18.1
docutils==0.19
et-xmlfile==1.1.0
execnet==1.9.0
iniconfig==1.1.1
jeepney==0.7.1
keyring==23.4.1
openpyxl==3.0.9
isort==5.10.1
jeepney==0.8.0
keyring==23.7.0
mypy-extensions==0.4.3
openpyxl==3.0.10
pathspec==0.9.0
pep517==0.12.0
pkginfo==1.8.2
pkginfo==1.8.3
platformdirs==2.5.2
py==1.11.0
pytest==7.0.1
pytest==7.1.2
pytest-forked==1.4.0
pytest-xdist==2.5.0
readme-renderer==34.0
readme-renderer==35.0
requests-toolbelt==0.9.1
rfc3986==1.5.0
rich==12.3.0
rfc3986==2.0.0
rich==12.5.1
secretstorage==3.3.2
tomli==1.2.3
twine==3.8.0
tomli==2.0.1
tqdm==4.64.0
twine==4.0.1
typing_extensions==4.3.0
Loading

0 comments on commit 240e24a

Please sign in to comment.