-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from nexB/update-skeleton-files
Update skeleton files
- Loading branch information
Showing
20 changed files
with
322 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
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@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
*.py[cod] | ||
|
||
# virtualenv and other misc bits | ||
/src/*.egg-info | ||
*.egg-info | ||
/dist | ||
/build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Copyright (c) nexB Inc. and others. All rights reserved. | ||
# ScanCode is a trademark of nexB Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text. | ||
# See https://github.com/nexB/skeleton for support or download. | ||
# See https://aboutcode.org for more information about nexB OSS projects. | ||
# | ||
|
||
# Python version can be specified with `$ PYTHON_EXE=python3.x make conf` | ||
PYTHON_EXE?=python3 | ||
VENV=venv | ||
ACTIVATE?=. ${VENV}/bin/activate; | ||
|
||
dev: | ||
@echo "-> Configure the development envt." | ||
./configure --dev | ||
|
||
isort: | ||
@echo "-> Apply isort changes to ensure proper imports ordering" | ||
${VENV}/bin/isort --sl -l 100 src tests setup.py | ||
|
||
black: | ||
@echo "-> Apply black code formatter" | ||
${VENV}/bin/black -l 100 src tests setup.py | ||
|
||
doc8: | ||
@echo "-> Run doc8 validation" | ||
@${ACTIVATE} doc8 --max-line-length 100 --ignore-path docs/_build/ --quiet docs/ | ||
|
||
valid: isort black | ||
|
||
check: | ||
@echo "-> Run pycodestyle (PEP8) validation" | ||
@${ACTIVATE} pycodestyle --max-line-length=100 --exclude=.eggs,venv,lib,thirdparty,docs,migrations,settings.py,.cache . | ||
@echo "-> Run isort imports ordering validation" | ||
@${ACTIVATE} isort --sl --check-only -l 100 setup.py src tests . | ||
@echo "-> Run black validation" | ||
@${ACTIVATE} black --check --check -l 100 src tests setup.py | ||
|
||
clean: | ||
@echo "-> Clean the Python env" | ||
./configure --clean | ||
|
||
test: | ||
@echo "-> Run the test suite" | ||
${VENV}/bin/pytest -vvs | ||
|
||
docs: | ||
rm -rf docs/_build/ | ||
@${ACTIVATE} sphinx-build docs/ docs/_build/ | ||
|
||
.PHONY: conf dev check valid black isort clean test docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.