Skip to content

Commit 0c20724

Browse files
Merge pull request #37 from nexB/update-skeleton
Update skeleton
2 parents 240e24a + e4dfe57 commit 0c20724

23 files changed

Lines changed: 253 additions & 423 deletions

.github/workflows/docs-ci.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,13 @@ jobs:
1313

1414
steps:
1515
- name: Checkout code
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v3
1717

1818
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v4
2020
with:
2121
python-version: ${{ matrix.python-version }}
2222

23-
- name: Give permission to run scripts
24-
run: chmod +x ./docs/scripts/doc8_style_check.sh
25-
2623
- name: Install Dependencies
2724
run: pip install -e .[docs]
2825

.github/workflows/pypi-release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ jobs:
2424
runs-on: ubuntu-20.04
2525

2626
steps:
27-
- uses: actions/checkout@master
27+
- uses: actions/checkout@v3
2828
- name: Set up Python
29-
uses: actions/setup-python@v1
29+
uses: actions/setup-python@v4
3030
with:
3131
python-version: 3.9
3232

@@ -78,6 +78,6 @@ jobs:
7878

7979
- name: Publish to PyPI
8080
if: startsWith(github.ref, 'refs/tags')
81-
uses: pypa/gh-action-pypi-publish@master
81+
uses: pypa/gh-action-pypi-publish@release/v1
8282
with:
8383
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
*.py[cod]
33

44
# virtualenv and other misc bits
5+
/src/*.egg-info
56
*.egg-info
67
/dist
78
/build

.readthedocs.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@
55
# Required
66
version: 2
77

8+
# Build in latest ubuntu/python
9+
build:
10+
os: ubuntu-22.04
11+
tools:
12+
python: "3.11"
13+
14+
# Build PDF & ePub
15+
formats:
16+
- epub
17+
- pdf
18+
819
# Where the Sphinx conf.py file is located
920
sphinx:
1021
configuration: docs/source/conf.py

Makefile

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
#
3+
# Copyright (c) nexB Inc. and others. All rights reserved.
4+
# ScanCode is a trademark of nexB Inc.
5+
# SPDX-License-Identifier: Apache-2.0
6+
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
7+
# See https://github.com/nexB/skeleton for support or download.
8+
# See https://aboutcode.org for more information about nexB OSS projects.
9+
#
10+
11+
# Python version can be specified with `$ PYTHON_EXE=python3.x make conf`
12+
PYTHON_EXE?=python3
13+
VENV=venv
14+
ACTIVATE?=. ${VENV}/bin/activate;
15+
16+
dev:
17+
@echo "-> Configure the development envt."
18+
./configure --dev
19+
20+
isort:
21+
@echo "-> Apply isort changes to ensure proper imports ordering"
22+
${VENV}/bin/isort --sl -l 100 src tests setup.py
23+
24+
black:
25+
@echo "-> Apply black code formatter"
26+
${VENV}/bin/black -l 100 src tests setup.py
27+
28+
doc8:
29+
@echo "-> Run doc8 validation"
30+
@${ACTIVATE} doc8 --max-line-length 100 --ignore-path docs/_build/ --quiet docs/
31+
32+
valid: isort black
33+
34+
check:
35+
@echo "-> Run pycodestyle (PEP8) validation"
36+
@${ACTIVATE} pycodestyle --max-line-length=100 --exclude=.eggs,venv,lib,thirdparty,docs,migrations,settings.py,.cache .
37+
@echo "-> Run isort imports ordering validation"
38+
@${ACTIVATE} isort --sl --check-only -l 100 setup.py src tests .
39+
@echo "-> Run black validation"
40+
@${ACTIVATE} black --check --check -l 100 src tests setup.py
41+
42+
clean:
43+
@echo "-> Clean the Python env"
44+
./configure --clean
45+
46+
test:
47+
@echo "-> Run the test suite"
48+
${VENV}/bin/pytest -vvs
49+
50+
docs:
51+
rm -rf docs/_build/
52+
@${ACTIVATE} sphinx-build docs/ docs/_build/
53+
54+
.PHONY: conf dev check valid black isort clean test docs

azure-pipelines.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,41 +13,41 @@ jobs:
1313

1414
- template: etc/ci/azure-posix.yml
1515
parameters:
16-
job_name: ubuntu18_cpython
17-
image_name: ubuntu-18.04
18-
python_versions: ['3.7', '3.8', '3.9', '3.10']
16+
job_name: ubuntu20_cpython
17+
image_name: ubuntu-20.04
18+
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
1919
test_suites:
2020
all: venv/bin/pytest -n 2 -vvs
2121

2222
- template: etc/ci/azure-posix.yml
2323
parameters:
24-
job_name: ubuntu20_cpython
25-
image_name: ubuntu-20.04
26-
python_versions: ['3.7', '3.8', '3.9', '3.10']
24+
job_name: ubuntu22_cpython
25+
image_name: ubuntu-22.04
26+
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
2727
test_suites:
2828
all: venv/bin/pytest -n 2 -vvs
2929

3030
- template: etc/ci/azure-posix.yml
3131
parameters:
32-
job_name: ubuntu22_cpython
33-
image_name: ubuntu-22.04
34-
python_versions: ['3.7', '3.8', '3.9', '3.10']
32+
job_name: macos11_cpython
33+
image_name: macOS-11
34+
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
3535
test_suites:
3636
all: venv/bin/pytest -n 2 -vvs
3737

3838
- template: etc/ci/azure-posix.yml
3939
parameters:
40-
job_name: macos1015_cpython
41-
image_name: macos-10.15
42-
python_versions: ['3.7', '3.8', '3.9', '3.10']
40+
job_name: macos12_cpython
41+
image_name: macOS-12
42+
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
4343
test_suites:
4444
all: venv/bin/pytest -n 2 -vvs
4545

4646
- template: etc/ci/azure-posix.yml
4747
parameters:
48-
job_name: macos11_cpython
49-
image_name: macos-11
50-
python_versions: ['3.7', '3.8', '3.9', '3.10']
48+
job_name: macos13_cpython
49+
image_name: macOS-13
50+
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
5151
test_suites:
5252
all: venv/bin/pytest -n 2 -vvs
5353

@@ -63,15 +63,15 @@ jobs:
6363
parameters:
6464
job_name: win2019_cpython
6565
image_name: windows-2019
66-
python_versions: ['3.7', '3.8', '3.9', '3.10']
66+
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
6767
test_suites:
6868
all: venv\Scripts\pytest -n 2 -vvs
6969

7070
- template: etc/ci/azure-win.yml
7171
parameters:
7272
job_name: win2022_cpython
7373
image_name: windows-2022
74-
python_versions: ['3.7', '3.8', '3.9', '3.10']
74+
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
7575
test_suites:
7676
all: venv\Scripts\pytest -n 2 -vvs
7777

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ DOCS_REQUIREMENTS="--editable .[docs] --constraint requirements.txt"
3636
VIRTUALENV_DIR=venv
3737

3838
# Cleanable files and directories to delete with the --clean option
39-
CLEANABLE="build venv"
39+
CLEANABLE="build dist venv .cache .eggs"
4040

4141
# extra arguments passed to pip
4242
PIP_EXTRA_ARGS=" "

configure.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ set "DOCS_REQUIREMENTS=--editable .[docs] --constraint requirements.txt"
3434
set "VIRTUALENV_DIR=venv"
3535

3636
@rem # Cleanable files and directories to delete with the --clean option
37-
set "CLEANABLE=build venv"
37+
set "CLEANABLE=build dist venv .cache .eggs"
3838

3939
@rem # extra arguments passed to pip
4040
set "PIP_EXTRA_ARGS= "

docs/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# from the environment for the first two.
66
SPHINXOPTS ?=
77
SPHINXBUILD ?= sphinx-build
8+
SPHINXAUTOBUILD = sphinx-autobuild
89
SOURCEDIR = source
910
BUILDDIR = build
1011

@@ -14,6 +15,13 @@ help:
1415

1516
.PHONY: help Makefile
1617

18+
# Run the development server using sphinx-autobuild
19+
docs:
20+
@echo
21+
@echo "Starting up the docs server..."
22+
@echo
23+
$(SPHINXAUTOBUILD) --port 8000 --watch ${SOURCEDIR} $(SOURCEDIR) "$(BUILDDIR)/html" $(SPHINXOPTS) $(O)
24+
1725
# Catch-all target: route all unknown targets to Sphinx using the new
1826
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1927
%: Makefile

docs/make.bat

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ REM Command file for Sphinx documentation
77
if "%SPHINXBUILD%" == "" (
88
set SPHINXBUILD=sphinx-build
99
)
10+
if "%SPHINXAUTOBUILD%" == "" (
11+
set SPHINXAUTOBUILD=sphinx-autobuild
12+
)
1013
set SOURCEDIR=source
1114
set BUILDDIR=build
1215

1316
if "%1" == "" goto help
1417

18+
if "%1" == "docs" goto docs
19+
1520
%SPHINXBUILD% >NUL 2>NUL
1621
if errorlevel 9009 (
1722
echo.
@@ -28,6 +33,13 @@ if errorlevel 9009 (
2833
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
2934
goto end
3035

36+
:docs
37+
@echo
38+
@echo Starting up the docs server...
39+
@echo
40+
%SPHINXAUTOBUILD% --port 8000 --watch %SOURCEDIR% %SOURCEDIR% %BUILDDIR%\html %SPHINXOPTS% %O%
41+
goto end
42+
3143
:help
3244
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
3345

0 commit comments

Comments
 (0)