Skip to content

Commit d505dc0

Browse files
JonoYangAyanSinhaMahapatrakeshav-spacechinyeunglipombredanne
authored
Update skeleton (#22)
* Create script to update repo skeleton #80 Signed-off-by: Jono Yang <jyang@nexb.com> * Update CI runners and python version Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com> * Replace deprecated macos CI runners Replace macos-11 runners with macos-14 runners. Reference: https://github.com/actions/runner-images?tab=readme-ov-file#available-images Reference: aboutcode-org/skeleton#89 Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com> * Update minimum required python version to 3.8 Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com> * Update link references of ownership from nexB to aboutcode-org Signed-off-by: Chin Yeung Li <tli@nexb.com> * Drop deprecated macos-12 runner * Update CI/Actions runners Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com> * Replace black and isort with ruff * Use ruff config and Make commands from scancode.io Signed-off-by: Jono Yang <jyang@nexb.com> * Use org standard 100 line length Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Lint all common code directories Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Remove unused targets Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Improve import sorting Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Apply small code updates Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Format code Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Apply cosmetic refactorings Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Reformat test code Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Format code Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Refine ruff configuration Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Format doc Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Run doc8 on all rst files Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Enable doc style checks Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Add support for new OS versions Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Update scripts aboutcode references Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Do not format more test data Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Do not treat rst as Python Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Combine testing and docs extra for simplicity Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Refine checking of docs with doc8 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Refine doc handling * remove CI scripts and use Makefile targets instead * ensure doc8 runs quiet * add new docs-check make target to run documentation and links checks * update oudated doc for docs contribution Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Add twine check to release publication Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Refine doc contribution docs Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Replace black and isort with ruff * Use ruff config and Make commands from scancode.io Signed-off-by: Jono Yang <jyang@nexb.com> * Use org standard 100 line length Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Lint all common code directories Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Remove unused targets Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Improve import sorting Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Apply small code updates Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Format code Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Apply cosmetic refactorings Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Reformat test code Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Format code Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Refine ruff configuration Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Format doc Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Run doc8 on all rst files Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Enable doc style checks Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Do not format more test data Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Do not treat rst as Python Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Combine testing and docs extra for simplicity Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Refine checking of docs with doc8 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Refine doc handling * remove CI scripts and use Makefile targets instead * ensure doc8 runs quiet * add new docs-check make target to run documentation and links checks * update oudated doc for docs contribution Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Add twine check to release publication Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Refine doc contribution docs Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Update codestyle command * Remove trailing whitespace Signed-off-by: Jono Yang <jyang@nexb.com> * Update README.rst Signed-off-by: Jono Yang <jyang@nexb.com> * Update BUILDDIR envvar in docs/Makefile Signed-off-by: Jono Yang <jyang@nexb.com> * Fix doc line length Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Format code Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Correct supported runner on Azure See for details: https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml macOS ARM images do not seem to be supported there Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Add code checks to CI Remove running "make check" as a test Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Revert support for Python 3.13 This is not yet supported everywhere Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Ignore local .env file Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Add correct extras for documentation Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Improve MANIFEST Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Improve cleaning on POSIX Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Rename dev extra to "dev" Instead of testing ... and update references accordingly Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Add more excludes from tests Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Do not lint django migrations Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Add README.rst to list of "license files" Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Use Python 3.9 as lowest suupported version Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Drop pycodestyle Not used anymore Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Bump pytest minimal version Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Update CI runners and scripts Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com> * Add missing wheel builds on release CI Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com> * Add scancode-toolkit to dev environment Signed-off-by: Jono Yang <jyang@nexb.com> * Update test expectations and GoReSym binary Signed-off-by: Jono Yang <jyang@nexb.com> * Run make valid Signed-off-by: Jono Yang <jyang@nexb.com> --------- Signed-off-by: Jono Yang <jyang@nexb.com> Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com> Signed-off-by: Chin Yeung Li <tli@nexb.com> Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> Co-authored-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com> Co-authored-by: Keshav Priyadarshi <git@keshav.space> Co-authored-by: Chin Yeung Li <tli@nexb.com> Co-authored-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent 442bc5b commit d505dc0

36 files changed

Lines changed: 425 additions & 318 deletions

.github/workflows/docs-ci.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,29 @@ on: [push, pull_request]
44

55
jobs:
66
build:
7-
runs-on: ubuntu-20.04
7+
runs-on: ubuntu-24.04
88

99
strategy:
1010
max-parallel: 4
1111
matrix:
12-
python-version: [3.9]
12+
python-version: [3.13]
1313

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

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

2323
- name: Install Dependencies
24-
run: pip install -e .[docs]
24+
run: ./configure --dev
2525

26-
- name: Check Sphinx Documentation build minimally
27-
working-directory: ./docs
28-
run: sphinx-build -E -W source build
26+
- name: Check documentation and HTML for errors and dead links
27+
run: make docs-check
2928

30-
- name: Check for documentation style errors
31-
working-directory: ./docs
32-
run: ./scripts/doc8_style_check.sh
29+
- name: Check documentation for style errors
30+
run: make doc8
3331

3432

.github/workflows/pypi-release.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,26 @@ on:
2121
jobs:
2222
build-pypi-distribs:
2323
name: Build and publish library to PyPI
24-
runs-on: ubuntu-20.04
24+
runs-on: ubuntu-24.04
2525

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

33-
- name: Install pypa/build
34-
run: python -m pip install build --user
33+
- name: Install pypa/build and twine
34+
run: python -m pip install --user --upgrade build twine pkginfo
3535

3636
- name: Build a binary wheel and a source tarball
37-
run: python -m build --sdist --wheel --outdir dist/
37+
run: python -m build --wheel --sdist --outdir dist/
38+
39+
- name: Validate wheel and sdis for Pypi
40+
run: python -m twine check dist/*
3841

3942
- name: Upload built archives
40-
uses: actions/upload-artifact@v3
43+
uses: actions/upload-artifact@v4
4144
with:
4245
name: pypi_archives
4346
path: dist/*
@@ -47,17 +50,17 @@ jobs:
4750
name: Create GH release
4851
needs:
4952
- build-pypi-distribs
50-
runs-on: ubuntu-20.04
53+
runs-on: ubuntu-24.04
5154

5255
steps:
5356
- name: Download built archives
54-
uses: actions/download-artifact@v3
57+
uses: actions/download-artifact@v4
5558
with:
5659
name: pypi_archives
5760
path: dist
5861

5962
- name: Create GH release
60-
uses: softprops/action-gh-release@v1
63+
uses: softprops/action-gh-release@v2
6164
with:
6265
draft: true
6366
files: dist/*
@@ -67,11 +70,11 @@ jobs:
6770
name: Create PyPI release
6871
needs:
6972
- create-gh-release
70-
runs-on: ubuntu-20.04
73+
runs-on: ubuntu-24.04
7174

7275
steps:
7376
- name: Download built archives
74-
uses: actions/download-artifact@v3
77+
uses: actions/download-artifact@v4
7578
with:
7679
name: pypi_archives
7780
path: dist

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,5 @@ tcl
7272

7373
# Ignore Jupyter Notebook related temp files
7474
.ipynb_checkpoints/
75+
/.ruff_cache/
76+
.env

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ python:
2626
- method: pip
2727
path: .
2828
extra_requirements:
29-
- docs
29+
- dev

MANIFEST.in

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
graft src
2+
graft docs
3+
graft etc
24

35
include *.LICENSE
46
include NOTICE
57
include *.ABOUT
68
include *.toml
79
include *.yml
810
include *.rst
11+
include *.png
912
include setup.*
1013
include configure*
1114
include requirements*
12-
include .git*
15+
include .dockerignore
16+
include .gitignore
17+
include .readthedocs.yml
18+
include manage.py
19+
include Dockerfile*
20+
include Makefile
21+
include MANIFEST.in
1322

14-
global-exclude *.py[co] __pycache__ *.*~
23+
include .VERSION
1524

25+
global-exclude *.py[co] __pycache__ *.*~

Makefile

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# ScanCode is a trademark of nexB Inc.
55
# SPDX-License-Identifier: Apache-2.0
66
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
7-
# See https://github.com/nexB/skeleton for support or download.
7+
# See https://github.com/aboutcode-org/skeleton for support or download.
88
# See https://aboutcode.org for more information about nexB OSS projects.
99
#
1010

@@ -22,31 +22,32 @@ else
2222
GOARCH := "amd64"
2323
endif
2424

25+
conf:
26+
@echo "-> Install dependencies"
27+
./configure
28+
2529
dev:
26-
@echo "-> Configure the development envt."
30+
@echo "-> Configure and install development dependencies"
2731
./configure --dev
2832

29-
isort:
30-
@echo "-> Apply isort changes to ensure proper imports ordering"
31-
${VENV}/bin/isort --sl -l 100 src tests setup.py
32-
33-
black:
34-
@echo "-> Apply black code formatter"
35-
${VENV}/bin/black -l 100 src tests setup.py
36-
3733
doc8:
3834
@echo "-> Run doc8 validation"
39-
@${ACTIVATE} doc8 --max-line-length 100 --ignore-path docs/_build/ --quiet docs/
35+
@${ACTIVATE} doc8 --quiet docs/ *.rst
4036

41-
valid: isort black
37+
valid:
38+
@echo "-> Run Ruff format"
39+
@${ACTIVATE} ruff format
40+
@echo "-> Run Ruff linter"
41+
@${ACTIVATE} ruff check --fix
4242

4343
check:
44-
@echo "-> Run pycodestyle (PEP8) validation"
45-
@${ACTIVATE} pycodestyle --max-line-length=100 --exclude=.eggs,venv,lib,thirdparty,docs,migrations,settings.py,.cache .
46-
@echo "-> Run isort imports ordering validation"
47-
@${ACTIVATE} isort --sl --check-only -l 100 setup.py src tests .
48-
@echo "-> Run black validation"
49-
@${ACTIVATE} black --check --check -l 100 src tests setup.py
44+
@echo "-> Run Ruff linter validation (pycodestyle, bandit, isort, and more)"
45+
@${ACTIVATE} ruff check
46+
@echo "-> Run Ruff format validation"
47+
@${ACTIVATE} ruff format --check
48+
@$(MAKE) doc8
49+
@echo "-> Run ABOUT files validation"
50+
@${ACTIVATE} about check etc/
5051

5152
clean:
5253
@echo "-> Clean the Python env"
@@ -58,11 +59,15 @@ test:
5859

5960
docs:
6061
rm -rf docs/_build/
61-
@${ACTIVATE} sphinx-build docs/ docs/_build/
62+
@${ACTIVATE} sphinx-build docs/source docs/_build/
63+
64+
docs-check:
65+
@${ACTIVATE} sphinx-build -E -W -b html docs/source docs/_build/
66+
@${ACTIVATE} sphinx-build -E -W -b linkcheck docs/source docs/_build/
6267

6368
build:
6469
rm -f src/go_inspector/bin/GoReSym_lin
6570
python setup.py clean --all sdist
6671
GOOS=linux GOARCH=$(GOARCH) python setup.py clean --all bdist_wheel --python-tag py3 --plat-name $(PLAT_NAME)
6772

68-
.PHONY: conf dev check valid black isort clean test docs
73+
.PHONY: conf dev check valid clean test docs docs-check build

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (c) nexB Inc. and others.
33
# SPDX-License-Identifier: Apache-2.0 AND MIT AND BSD-3-Clause WITH LicenRef-scancode-google-patent-license-golang
44
#
5-
# Visit https://aboutcode.org and https://github.com/nexB/ for support and download.
5+
# Visit https://aboutcode.org and https://github.com/aboutcode-org/ for support and download.
66
# ScanCode is a trademark of nexB Inc.
77
#
88
# Licensed under the Apache License, Version 2.0 (the "License");

azure-pipelines.yml

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ jobs:
99

1010
- template: etc/ci/azure-posix.yml
1111
parameters:
12-
job_name: ubuntu20_cpython
13-
image_name: ubuntu-20.04
14-
python_versions: ['3.9', '3.10', '3.11', '3.12', '3.13']
12+
job_name: run_code_checks
13+
image_name: ubuntu-24.04
14+
python_versions: ['3.13']
1515
test_suites:
16-
all: venv/bin/pytest -n 2 -vvs
16+
all: make check
1717

1818
- template: etc/ci/azure-posix.yml
1919
parameters:
@@ -23,42 +23,50 @@ jobs:
2323
test_suites:
2424
all: venv/bin/pytest -n 2 -vvs
2525

26+
- template: etc/ci/azure-posix.yml
27+
parameters:
28+
job_name: ubuntu24_cpython
29+
image_name: ubuntu-24.04
30+
python_versions: ['3.9', '3.10', '3.11', '3.12', '3.13']
31+
test_suites:
32+
all: venv/bin/pytest -n 2 -vvs
33+
2634
# - template: etc/ci/azure-posix.yml
2735
# parameters:
28-
# job_name: macos11_cpython
29-
# image_name: macOS-11
30-
# python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
36+
# job_name: macos13_cpython
37+
# image_name: macOS-13
38+
# python_versions: ['3.9', '3.10', '3.11', '3.12', '3.13']
3139
# test_suites:
3240
# all: venv/bin/pytest -n 2 -vvs
3341

3442
# - template: etc/ci/azure-posix.yml
3543
# parameters:
36-
# job_name: macos12_cpython
37-
# image_name: macOS-12
38-
# python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
44+
# job_name: macos14_cpython
45+
# image_name: macOS-14
46+
# python_versions: ['3.9', '3.10', '3.11', '3.12', '3.13']
3947
# test_suites:
4048
# all: venv/bin/pytest -n 2 -vvs
4149

4250
# - template: etc/ci/azure-posix.yml
4351
# parameters:
44-
# job_name: macos13_cpython
45-
# image_name: macOS-13
46-
# python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
52+
# job_name: macos15_cpython
53+
# image_name: macOS-15
54+
# python_versions: ['3.9', '3.10', '3.11', '3.12', '3.13']
4755
# test_suites:
4856
# all: venv/bin/pytest -n 2 -vvs
4957

5058
# - template: etc/ci/azure-win.yml
5159
# parameters:
52-
# job_name: win2019_cpython
53-
# image_name: windows-2019
54-
# python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
60+
# job_name: win2022_cpython
61+
# image_name: windows-2022
62+
# python_versions: ['3.9', '3.10', '3.11', '3.12', '3.13']
5563
# test_suites:
5664
# all: venv\Scripts\pytest -n 2 -vvs
5765

5866
# - template: etc/ci/azure-win.yml
5967
# parameters:
60-
# job_name: win2022_cpython
61-
# image_name: windows-2022
62-
# python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
68+
# job_name: win2025_cpython
69+
# image_name: windows-2025
70+
# python_versions: ['3.9', '3.10', '3.11', '3.12', '3.13']
6371
# test_suites:
6472
# all: venv\Scripts\pytest -n 2 -vvs

configure

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright (c) nexB Inc. and others. All rights reserved.
44
# SPDX-License-Identifier: Apache-2.0
55
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
6-
# See https://github.com/nexB/ for support or download.
6+
# See https://github.com/aboutcode-org/ for support or download.
77
# See https://aboutcode.org for more information about nexB OSS projects.
88
#
99

@@ -29,14 +29,13 @@ CLI_ARGS=$1
2929

3030
# Requirement arguments passed to pip and used by default or with --dev.
3131
REQUIREMENTS="--editable . --constraint requirements.txt scancode-toolkit"
32-
DEV_REQUIREMENTS="--editable .[testing] --constraint requirements.txt --constraint requirements-dev.txt scancode-toolkit"
33-
DOCS_REQUIREMENTS="--editable .[docs] --constraint requirements.txt"
32+
DEV_REQUIREMENTS="--editable .[dev] --constraint requirements.txt --constraint requirements-dev.txt scancode-toolkit"
3433

3534
# where we create a virtualenv
3635
VIRTUALENV_DIR=venv
3736

3837
# Cleanable files and directories to delete with the --clean option
39-
CLEANABLE="build dist venv .cache .eggs"
38+
CLEANABLE="build dist venv .cache .eggs *.egg-info docs/_build/ pip-selfcheck.json"
4039

4140
# extra arguments passed to pip
4241
PIP_EXTRA_ARGS=" "
@@ -111,7 +110,7 @@ create_virtualenv() {
111110
fi
112111

113112
$PYTHON_EXECUTABLE "$VIRTUALENV_PYZ" \
114-
--wheel embed --pip embed --setuptools embed \
113+
--pip embed --setuptools embed \
115114
--seeder pip \
116115
--never-download \
117116
--no-periodic-update \
@@ -168,6 +167,7 @@ clean() {
168167
for cln in $CLEANABLE;
169168
do rm -rf "${CFG_ROOT_DIR:?}/${cln:?}";
170169
done
170+
find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete
171171
set +e
172172
exit
173173
}
@@ -185,7 +185,6 @@ while getopts :-: optchar; do
185185
help ) cli_help;;
186186
clean ) find_python && clean;;
187187
dev ) CFG_REQUIREMENTS="$DEV_REQUIREMENTS";;
188-
docs ) CFG_REQUIREMENTS="$DOCS_REQUIREMENTS";;
189188
esac;;
190189
esac
191190
done

0 commit comments

Comments
 (0)