Skip to content

Commit 67316de

Browse files
authored
Merge pull request #18 from ziadhany/fix-ci
fix CI errors
2 parents 149eec4 + b42d294 commit 67316de

23 files changed

Lines changed: 1237 additions & 970 deletions

‎.flake8‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[flake8]
22
exclude = .git, .eggs, __pycache__, build, dist, docs, docker, migrations
3-
ignore = E129, E402, F841, W504 E128
3+
ignore = E129, E402, F841, W504 E128 , W503, E203
44
max-line-length = 130

‎.github/workflows/docs-ci.yml‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,17 @@ jobs:
2323
with:
2424
python-version: ${{ matrix.python-version }}
2525

26-
- name: Install Dependencies
27-
run: ./configure --dev
26+
- name: Install poetry
27+
run: |
28+
curl -sSL https://install.python-poetry.org | python3 -
29+
echo "PATH=$HOME/.poetry/bin:$PATH" >> $GITHUB_ENV
2830
31+
- name: Install Dependencies
32+
run: |
33+
./configure --dev
34+
. venv/bin/activate
35+
poetry install --with docs
36+
2937
- name: Check documentation and HTML for errors and dead links
3038
run: make docs-check
3139

‎Makefile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dev:
2424

2525
doc8:
2626
@echo "-> Run doc8 validation"
27-
@${ACTIVATE} doc8 --quiet docs/ *.rst
27+
@${ACTIVATE} doc8 --max-line-length 100 --ignore-path docs/_build/ --quiet docs/
2828

2929
valid:
3030
@echo "-> Run Ruff format"
@@ -51,7 +51,7 @@ test:
5151

5252
docs:
5353
rm -rf docs/_build/
54-
@${ACTIVATE} sphinx-build docs/source docs/_build/
54+
@${ACTIVATE} sphinx-build docs/source docs/_build/
5555

5656
docs-check:
5757
@${ACTIVATE} sphinx-build -E -W -b html docs/source docs/_build/

‎configure‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ install_packages() {
131131

132132
"$CFG_BIN_DIR/pip" install \
133133
--upgrade \
134-
--no-build-isolation \
135134
$CFG_QUIET \
136135
$PIP_EXTRA_ARGS \
137136
$1

‎docs/Makefile‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ help:
1515

1616
.PHONY: help Makefile
1717

18+
docs-check:
19+
@${ACTIVATE} sphinx-build -E -W -b html docs/source docs/_build/
20+
1821
# Run the development server using sphinx-autobuild
1922
docs:
2023
@echo

‎docs/source/contribute/contrib_doc.rst‎

Lines changed: 71 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ To get started, check out and configure the repository for development::
2121

2222
In case of windows, run ``configure --dev``.
2323

24-
This will install and configure all requirements foer development including for docs development.
24+
This will install and configure all requirements
25+
for development including for docs development.
2526

2627
Now you can build the HTML documentation locally::
2728

@@ -45,8 +46,10 @@ To validate the documentation style and content, use::
4546
Continuous Integration
4647
----------------------
4748

48-
The documentations are checked on every new commit, so that common errors are avoided and
49-
documentation standards are enforced. We checks for these aspects of the documentation:
49+
The documentations are checked on every new commit,
50+
so that common errors are avoided and
51+
documentation standards are enforced.
52+
We checks for these aspects of the documentation:
5053

5154
1. Successful Builds (By using ``sphinx-build``)
5255
2. No Broken Links (By Using ``linkcheck``)
@@ -90,7 +93,8 @@ A sample output is::
9093
- CheckTrailingWhitespace = 47
9194
- CheckValidity = 1
9295

93-
Now fix the errors and run again till there isn't any style error in the documentation.
96+
Now fix the errors and run again till there isn't
97+
any style error in the documentation.
9498

9599

96100
What is Checked?
@@ -123,7 +127,8 @@ Interspinx
123127

124128
AboutCode documentation uses
125129
`Intersphinx <https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html>`_
126-
to link to other Sphinx Documentations, to maintain links to other Aboutcode Projects.
130+
to link to other Sphinx Documentations,
131+
to maintain links to other Aboutcode Projects.
127132

128133
To link sections in the same documentation, standart reST labels are used. Refer
129134
`Cross-Referencing <https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html>`_
@@ -140,10 +145,13 @@ For example::
140145

141146
It refers to the section itself, see :ref:`my-reference-label`.
142147

143-
Now, using Intersphinx, you can create these labels in one Sphinx Documentation and then referance
144-
these labels from another Sphinx Documentation, hosted in different locations.
148+
Now, using Intersphinx, you can create these labels in
149+
one Sphinx Documentation and then referance
150+
these labels from another Sphinx Documentation,
151+
hosted in different locations.
145152

146-
You just have to add the following in the ``conf.py`` file for your Sphinx Documentation, where you
153+
You just have to add the following in the ``conf.py`` file
154+
for your Sphinx Documentation, where you
147155
want to add the links::
148156

149157
extensions = [
@@ -161,18 +169,24 @@ To show all Intersphinx links and their targets of an Intersphinx mapping file,
161169
``python -msphinx.ext.intersphinx https://aboutcode.readthedocs.io/objects.inv`` will give
162170
error.
163171

164-
This enables you to create links to the ``aboutcode`` Documentation in your own Documentation,
165-
where you modified the configuration file. Links can be added like this::
172+
This enables you to create links to the ``aboutcode``
173+
Documentation in your own Documentation,
174+
where you modified the configuration file.
175+
Links can be added like this::
166176

167177
For more details refer :ref:`aboutcode:doc_style_guide`.
168178

169-
You can also not use the ``aboutcode`` label assigned to all links from aboutcode.readthedocs.io,
170-
if you don't have a label having the same name in your Sphinx Documentation. Example::
179+
You can also not use the ``aboutcode`` label assigned
180+
to all links from aboutcode.readthedocs.io,
181+
if you don't have a label having the same name in your
182+
Sphinx Documentation. Example::
171183

172184
For more details refer :ref:`doc_style_guide`.
173185

174-
If you have a label in your documentation which is also present in the documentation linked by
175-
Intersphinx, and you link to that label, it will create a link to the local label.
186+
If you have a label in your documentation
187+
which is also present in the documentation linked by
188+
Intersphinx, and you link to that label,
189+
it will create a link to the local label.
176190

177191
For more information, refer this tutorial named
178192
`Using Intersphinx <https://my-favorite-documentation-test.readthedocs.io/en/latest/using_intersphinx.html>`_.
@@ -186,8 +200,10 @@ Style Conventions for the Documentaion
186200
1. Headings
187201

188202
(`Refer <https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#sections>`_)
189-
Normally, there are no heading levels assigned to certain characters as the structure is
190-
determined from the succession of headings. However, this convention is used in Python’s Style
203+
Normally, there are no heading levels assigned to
204+
certain characters as the structure is
205+
determined from the succession of headings.
206+
However, this convention is used in Python’s Style
191207
Guide for documenting which you may follow:
192208

193209
# with overline, for parts
@@ -204,7 +220,8 @@ Style Conventions for the Documentaion
204220

205221
2. Heading Underlines
206222

207-
Do not use underlines that are longer/shorter than the title headline itself. As in:
223+
Do not use underlines that are longer/shorter than
224+
the title headline itself. As in:
208225

209226
::
210227

@@ -220,42 +237,57 @@ Style Conventions for the Documentaion
220237

221238
.. note::
222239

223-
Underlines shorter than the Title text generates Errors on sphinx-build.
240+
Underlines shorter than the Title text generates Errors
241+
on sphinx-build.
224242

225243

226244
3. Internal Links
227245

228-
Using ``:ref:`` is advised over standard reStructuredText links to sections (like
229-
```Section title`_``) because it works across files, when section headings are changed, will
230-
raise warnings if incorrect, and works for all builders that support cross-references.
231-
However, external links are created by using the standard ```Section title`_`` method.
246+
Using ``:ref:`` is advised over standard reStructuredText
247+
links to sections (like ```Section title`_``) because it works
248+
across files, when section headings are changed, will raise
249+
warnings if incorrect, and works for all builders that support
250+
cross-references. However, external links are created by
251+
using the standard ```Section title`_`` method.
232252

233253
4. Eliminate Redundancy
234254

235-
If a section/file has to be repeated somewhere else, do not write the exact same section/file
236-
twice. Use ``.. include: ../README.rst`` instead. Here, ``../`` refers to the documentation
237-
root, so file location can be used accordingly. This enables us to link documents from other
255+
If a section/file has to be repeated somewhere else,
256+
do not write the exact same section/file twice.
257+
Use ``.. include: ../README.rst`` instead. Here, ``../``
258+
refers to the documentation root, so file location can
259+
be used accordingly. This enables us to link documents from other
238260
upstream folders.
239261

240262
5. Using ``:ref:`` only when necessary
241263

242-
Use ``:ref:`` to create internal links only when needed, i.e. it is referenced somewhere.
243-
Do not create references for all the sections and then only reference some of them, because
244-
this created unnecessary references. This also generates ERROR in ``restructuredtext-lint``.
264+
Use ``:ref:`` to create internal links only when needed,
265+
i.e. it is referenced somewhere.
266+
Do not create references for all the
267+
sections and then only reference some of them, because
268+
this created unnecessary references.
269+
This also generates ERROR in ``restructuredtext-lint``.
245270

246271
6. Spelling
247272

248-
You should check for spelling errors before you push changes. `Aspell <http://aspell.net/>`_
249-
is a GNU project Command Line tool you can use for this purpose. Download and install Aspell,
250-
then execute ``aspell check <file-name>`` for all the files changed. Be careful about not
251-
changing commands or other stuff as Aspell gives prompts for a lot of them. Also delete the
252-
temporary ``.bak`` files generated. Refer the `manual <http://aspell.net/man-html/>`_ for more
273+
You should check for spelling errors before
274+
you push changes. `Aspell <http://aspell.net/>`_
275+
is a GNU project Command Line tool you can use
276+
for this purpose. Download and install Aspell,
277+
then execute ``aspell check <file-name>`` for all
278+
the files changed. Be careful about not
279+
changing commands or other stuff as Aspell
280+
gives prompts for a lot of them. Also delete the
281+
temporary ``.bak`` files generated. Refer the
282+
`manual <http://aspell.net/man-html/>`_ for more
253283
information on how to use.
254284

255285
7. Notes and Warning Snippets
256286

257-
Every ``Note`` and ``Warning`` sections are to be kept in ``rst_snippets/note_snippets/`` and
258-
``rst_snippets/warning_snippets/`` and then included to eliminate redundancy, as these are
287+
Every ``Note`` and ``Warning`` sections are
288+
to be kept in ``rst_snippets/note_snippets/`` and
289+
``rst_snippets/warning_snippets/`` and then
290+
included to eliminate redundancy, as these are
259291
frequently used in multiple files.
260292

261293

@@ -264,8 +296,9 @@ Converting from Markdown
264296

265297
If you want to convert a ``.md`` file to a ``.rst`` file, this
266298
`tool <https://github.com/chrissimpkins/md2rst>`_ does it pretty well.
267-
You will still have to clean up and check for errors as this contains a lot of bugs. But this is
299+
You will still have to clean up and check for errors
300+
as this contains a lot of bugs. But this is
268301
definitely better than converting everything by yourself.
269-
270-
This will be helpful in converting GitHub wiki's (Markdown Files) to reStructuredtext files for
302+
This will be helpful in converting GitHub wiki's
303+
(Markdown Files) to reStructuredtext files for
271304
Sphinx/ReadTheDocs hosting.

‎docs/source/skeleton-usage.rst‎

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ A brand new project
1111
# Create the new repo on GitHub, then update your remote
1212
git remote set-url origin git@github.com:nexB/your-new-repo.git
1313
14-
From here, you can make the appropriate changes to the files for your specific project.
14+
From here, you can make the appropriate changes to
15+
the files for your specific project.
1516

1617
Update an existing project
1718
---------------------------
@@ -22,7 +23,8 @@ Update an existing project
2223
git fetch skeleton
2324
git merge skeleton/main --allow-unrelated-histories
2425
25-
This is also the workflow to use when updating the skeleton files in any given repository.
26+
This is also the workflow to use when updating
27+
the skeleton files in any given repository.
2628

2729
Customizing
2830
-----------
@@ -58,8 +60,8 @@ dependencies from PyPI and add them to the virtual environment.
5860
Generating requirements.txt and requirements-dev.txt
5961
----------------------------------------------------
6062

61-
After the project has been initialized, we can generate the requirements.txt and
62-
requirements-dev.txt files.
63+
After the project has been initialized, we can generate
64+
the requirements.txt and requirements-dev.txt files.
6365

6466
Ensure the virtual environment is enabled.
6567

@@ -71,38 +73,46 @@ To generate requirements.txt:
7173

7274
.. code-block:: bash
7375
74-
python etc/scripts/gen_requirements.py -s venv/lib/python<version>/site-packages/
76+
python etc/scripts/gen_requirements.py
77+
-s venv/lib/python<version>/site-packages/
7578
76-
Replace \<version\> with the version number of the Python being used, for example:
79+
Replace \<version\> with the version number of
80+
the Python being used, for example:
7781
``venv/lib/python3.6/site-packages/``
7882

7983
To generate requirements-dev.txt after requirements.txt has been generated:
8084

8185
.. code-block:: bash
8286
8387
./configure --dev
84-
python etc/scripts/gen_requirements_dev.py -s venv/lib/python<version>/site-packages/
88+
python etc/scripts/gen_requirements_dev.py
89+
-s venv/lib/python<version>/site-packages/
8590
86-
Note: on Windows, the ``site-packages`` directory is located at ``venv\Lib\site-packages\``
91+
Note: on Windows, the ``site-packages``
92+
directory is located at ``venv\Lib\site-packages\``
8793

8894
.. code-block:: bash
8995
90-
python .\\etc\\scripts\\gen_requirements.py -s .\\venv\\Lib\\site-packages\\
96+
python .\\etc\\scripts\\gen_requirements.py
97+
-s .\\venv\\Lib\\site-packages\\
9198
.\configure --dev
92-
python .\\etc\\scripts\\gen_requirements_dev.py -s .\\venv\\Lib\\site-packages\\
99+
python .\\etc\\scripts\\gen_requirements_dev.py
100+
-s .\\venv\\Lib\\site-packages\\
93101
94102
95103
Collecting and generating ABOUT files for dependencies
96104
------------------------------------------------------
97105

98-
Ensure that the dependencies used by ``etc/scripts/fetch_thirdparty.py`` are installed:
106+
Ensure that the dependencies
107+
used by ``etc/scripts/fetch_thirdparty.py`` are installed:
99108

100109
.. code-block:: bash
101110
102111
pip install -r etc/scripts/requirements.txt
103112
104-
Once we have requirements.txt and requirements-dev.txt, we can fetch the project
105-
dependencies as wheels and generate ABOUT files for them:
113+
Once we have requirements.txt and requirements-dev.txt,
114+
we can fetch the project dependencies as wheels
115+
and generate ABOUT files for them:
106116

107117
.. code-block:: bash
108118
@@ -126,17 +136,20 @@ Usage after project initialization
126136

127137
Once the ``requirements.txt`` and ``requirements-dev.txt`` have been generated
128138
and the project dependencies and their ABOUT files have been uploaded to
129-
thirdparty.aboutcode.org/pypi, you can configure the project as needed, typically
139+
thirdparty.aboutcode.org/pypi, you can configure
140+
the project as needed, typically
130141
when you update dependencies or use a new checkout.
131142

132-
If the virtual env for the project becomes polluted, or you would like to remove
143+
If the virtual env for the project becomes polluted,
144+
or you would like to remove
133145
it, use the ``--clean`` option:
134146

135147
.. code-block:: bash
136148
137149
./configure --clean
138150
139-
Then you can run ``./configure`` again to set up the project virtual environment.
151+
Then you can run ``./configure`` again to set up the project
152+
virtual environment.
140153

141154
To set up the project for development use:
142155

@@ -154,7 +167,9 @@ update the dependencies in ``setup.cfg``, then run:
154167
python etc/scripts/gen_requirements.py -s venv/lib/python<version>/site-packages/ # Regenerate requirements.txt
155168
python etc/scripts/gen_requirements_dev.py -s venv/lib/python<version>/site-packages/ # Regenerate requirements-dev.txt
156169
pip install -r etc/scripts/requirements.txt # Install dependencies needed by etc/scripts/bootstrap.py
157-
python etc/scripts/fetch_thirdparty.py -r requirements.txt -r requirements-dev.txt # Collect dependency wheels and their ABOUT files
170+
python etc/scripts/fetch_thirdparty.py
171+
-r requirements.txt -r requirements-dev.txt # Collect dependency wheels and their ABOUT files
158172
159-
Ensure that the generated ABOUT files are valid, then take the dependency wheels
173+
Ensure that the generated ABOUT files are valid,
174+
then take the dependency wheels
160175
and ABOUT files and upload them to thirdparty.aboutcode.org/pypi.

0 commit comments

Comments
 (0)