Skip to content

Commit e99c874

Browse files
Merge remote-tracking branch 'skeleton/main'
Signed-off-by: Ayan Sinha Mahapatra <asmahapatra@aboutcode.org>
2 parents 4438a10 + c55ec7c commit e99c874

12 files changed

Lines changed: 162 additions & 41 deletions

File tree

.github/workflows/docs-ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: CI Documentation
22

33
on: [push, pull_request]
44

5+
permissions: {}
56
jobs:
67
build:
78
runs-on: ubuntu-24.04
@@ -13,10 +14,12 @@ jobs:
1314

1415
steps:
1516
- name: Checkout code
16-
uses: actions/checkout@v3
17+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
18+
with:
19+
persist-credentials: false
1720

1821
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v4
22+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
2023
with:
2124
python-version: ${{ matrix.python-version }}
2225

.github/workflows/zizmor.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: GitHub Actions Security Analysis with zizmor 🌈
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["**"]
8+
9+
permissions: {}
10+
11+
jobs:
12+
zizmor:
13+
name: Run zizmor 🌈
14+
runs-on: ubuntu-latest
15+
permissions:
16+
security-events: write # Required for upload-sarif (used by zizmor-action) to upload SARIF files.
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
20+
with:
21+
persist-credentials: false
22+
23+
- name: Run zizmor 🌈
24+
uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3

.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__ *.*~

configure

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ CLI_ARGS=$1
2929

3030
# Requirement arguments passed to pip and used by default or with --dev.
3131
REQUIREMENTS="--editable . "
32-
DOCS_REQUIREMENTS="--editable .[docs]"
32+
DOCS_REQUIREMENTS="--editable .[dev]"
3333

3434
# where we create a virtualenv
3535
VIRTUALENV_DIR=venv
3636

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

4040
# extra arguments passed to pip
4141
PIP_EXTRA_ARGS=" "
@@ -110,7 +110,7 @@ create_virtualenv() {
110110
fi
111111

112112
$PYTHON_EXECUTABLE "$VIRTUALENV_PYZ" \
113-
--wheel embed --pip embed --setuptools embed \
113+
--pip embed --setuptools embed \
114114
--seeder pip \
115115
--never-download \
116116
--no-periodic-update \
@@ -167,6 +167,7 @@ clean() {
167167
for cln in $CLEANABLE;
168168
do rm -rf "${CFG_ROOT_DIR:?}/${cln:?}";
169169
done
170+
find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete
170171
set +e
171172
exit
172173
}

configure.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
@rem # Requirement arguments passed to pip and used by default or with --dev.
2929
set "REQUIREMENTS=--editable . "
30-
set "DOCS_REQUIREMENTS=--editable .[docs]"
30+
set "DOCS_REQUIREMENTS=--editable .[dev]"
3131

3232
@rem # where we create a virtualenv
3333
set "VIRTUALENV_DIR=venv"
@@ -110,7 +110,7 @@ if not exist "%CFG_BIN_DIR%\python.exe" (
110110

111111
if exist "%CFG_ROOT_DIR%\etc\thirdparty\virtualenv.pyz" (
112112
%PYTHON_EXECUTABLE% "%CFG_ROOT_DIR%\etc\thirdparty\virtualenv.pyz" ^
113-
--wheel embed --pip embed --setuptools embed ^
113+
--pip embed --setuptools embed ^
114114
--seeder pip ^
115115
--never-download ^
116116
--no-periodic-update ^
@@ -126,7 +126,7 @@ if not exist "%CFG_BIN_DIR%\python.exe" (
126126
)
127127
)
128128
%PYTHON_EXECUTABLE% "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\virtualenv.pyz" ^
129-
--wheel embed --pip embed --setuptools embed ^
129+
--pip embed --setuptools embed ^
130130
--seeder pip ^
131131
--never-download ^
132132
--no-periodic-update ^

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SPHINXOPTS ?=
77
SPHINXBUILD ?= sphinx-build
88
SPHINXAUTOBUILD = sphinx-autobuild
99
SOURCEDIR = source
10-
BUILDDIR = build
10+
BUILDDIR = _build
1111

1212
# Put it first so that "make" without argument is like "make help".
1313
help:

docs/source/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
# -- Project information -----------------------------------------------------
1919

20-
project = "aboutcode"
21-
copyright = "nexB Inc. and others."
20+
project = "nexb-skeleton"
21+
copyright = "nexB Inc., AboutCode and others."
2222
author = "AboutCode.org authors and contributors"
2323

2424

@@ -94,7 +94,8 @@
9494
html_show_sphinx = True
9595

9696
# Define CSS and HTML abbreviations used in .rst files. These are examples.
97-
# .. role:: is used to refer to styles defined in _static/theme_overrides.css and is used like this: :red:`text`
97+
# .. role:: is used to refer to styles defined in _static/theme_overrides.css
98+
# and is used like this: :red:`text`
9899
rst_prolog = """
99100
.. |psf| replace:: Python Software Foundation
100101

docs/source/contributing/contrib_doc.rst

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ you can install the dependencies in a virtualenv::
4343

4444
.. note::
4545

46-
In case of windows, run ``configure --docs`` instead of this.
46+
In case of windows, run ``configure --dev``.
4747

48-
Now, this will install the following prerequisites:
48+
This will install and configure all requirements foer development including for docs development.
4949

5050
- Sphinx
5151
- sphinx_rtd_theme (the format theme used by ReadTheDocs)
@@ -57,21 +57,21 @@ These requirements are already present in setup.cfg and `./configure
5757
Now you can build the HTML documents locally::
5858

5959
source venv/bin/activate
60-
cd docs
61-
make html
60+
make docs
6261

6362
Assuming that your Sphinx installation was successful, Sphinx should build
6463
a local instance of the documentation .html files::
6564

66-
open build/html/index.html
65+
open docs/_build/index.html
6766

68-
.. note::
6967

7068
In case this command did not work, for example on Ubuntu 18.04 you may
7169
get a message like “Couldn’t get a file descriptor referring to the
7270
console”, try:
7371

74-
::
72+
source venv/bin/activate
73+
make doc8
74+
make docs-check
7575

7676
see build/html/index.html
7777

@@ -119,31 +119,26 @@ that common errors are avoided and documentation standards are enforced.
119119
Travis-CI presently checks for these 3 aspects of the documentation :
120120

121121
1. Successful Builds (By using ``sphinx-build``)
122-
2. No Broken Links (By Using ``link-check``)
123-
3. Linting Errors (By Using ``Doc8``)
124-
125-
So run these scripts at your local system before creating a Pull Request::
122+
2. No Broken Links (By Using ``linkcheck``)
123+
3. Linting Errors (By Using ``doc8``)
126124

127-
cd docs
128-
./scripts/sphinx_build_link_check.sh
129-
./scripts/doc8_style_check.sh
125+
You myst run these scripts locally before creating a pull request::
130126

131-
If you don't have permission to run the scripts, run::
127+
make doc8
128+
make check-docs
132129

133-
chmod u+x ./scripts/doc8_style_check.sh
134130

135131
.. _doc_style_docs8:
136132

137-
Style Checks Using ``Doc8``
133+
Style Checks Using ``doc8``
138134
---------------------------
139135

140136
How To Run Style Tests
141137
^^^^^^^^^^^^^^^^^^^^^^
142138

143139
In the project root, run the following commands::
144140

145-
$ cd docs
146-
$ ./scripts/doc8_style_check.sh
141+
make doc8
147142

148143
A sample output is::
149144

@@ -168,6 +163,7 @@ A sample output is::
168163
Now fix the errors and run again till there isn't any style error in the
169164
documentation.
170165

166+
171167
What is Checked?
172168
^^^^^^^^^^^^^^^^
173169

@@ -259,6 +255,7 @@ create a link to the local label.
259255
For more information, refer this tutorial named `Using Intersphinx
260256
<https://my-favorite-documentation-test.readthedocs.io/en/latest/using_intersphinx.html>`_.
261257

258+
262259
.. _doc_style_conv:
263260

264261
Style Conventions for the Documentaion
@@ -350,6 +347,7 @@ Style Conventions for the Documentaion
350347
and then included to eliminate redundancy, as these are frequently used
351348
in multiple files.
352349

350+
353351
Converting from Markdown
354352
------------------------
355353

0 commit comments

Comments
 (0)