Skip to content

Commit 97391a3

Browse files
authored
Merge pull request #129 from pedro-psb/merge-rewrite
[PULP-531] Merge rewrite-as-mkdocs feature branch
2 parents d03ebb6 + 8a4ae28 commit 97391a3

File tree

320 files changed

+993
-1774
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

320 files changed

+993
-1774
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: "Build"
23

34
on:
@@ -11,7 +12,7 @@ jobs:
1112
- name: "Set up Python"
1213
uses: "actions/setup-python@v5"
1314
with:
14-
python-version: "3.11"
15+
python-version: "3.12"
1516
- name: "Install python dependencies"
1617
run: |
1718
pip install build setuptools wheel
@@ -25,3 +26,4 @@ jobs:
2526
path: |
2627
dist/
2728
if-no-files-found: "error"
29+
...

.github/workflows/docs-ci.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
name: "Docs CI"
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
pulpdocs_ref:
8+
description: "Git reference of this workflow file. Must match the one used for the workflow call"
9+
type: string
10+
required: true
11+
12+
jobs:
13+
build:
14+
runs-on: "ubuntu-latest"
15+
steps:
16+
- name: "Checkout pulp-docs repository"
17+
if: "${{ github.event.repository.name != 'pulp-docs' }}"
18+
uses: "actions/checkout@v4"
19+
with:
20+
repository: "pulp/pulp-docs"
21+
path: "pulp-docs"
22+
ref: "${{ inputs.pulpdocs_ref }}"
23+
fetch-depth: 0
24+
25+
- name: "Checkout component repository"
26+
uses: "actions/checkout@v4"
27+
with:
28+
path: "${{ github.event.repository.name }}"
29+
fetch-depth: 0
30+
31+
- name: "Instructions to run locally"
32+
run: |
33+
cat <<EOL
34+
Ensure you have "pulp-docs" and "${{ github.event.repository.name }}" in your CWD with correct revisions:
35+
36+
git -C pulp-docs checkout "${{ inputs.pulpdocs_ref }}"
37+
git -C ${{ github.event.repository.name }} checkout "${{ github.head_ref }}"
38+
39+
Then run:
40+
41+
cd pulp-docs
42+
pulp-docs fetch --dest /tmp/pulp-docs-tmp
43+
pulp-docs build --path pulp-docs@..:${{ github.event.repository.name }}@..:/tmp/pulp-docs-tmp
44+
EOL
45+
46+
- uses: "actions/setup-python@v5"
47+
with:
48+
python-version: "3.12"
49+
50+
- name: "Install pulp-docs"
51+
working-directory: "pulp-docs"
52+
run: |
53+
pip install --upgrade pip
54+
pip install -r doc_requirements.txt
55+
56+
- name: "Build Docs"
57+
working-directory: "pulp-docs"
58+
env:
59+
DOCS_PATH: "pulp-docs@..:${{ github.event.repository.name }}@.."
60+
DOCS_TMPDIR: "/tmp/pulp-docs-tmp"
61+
run: |
62+
pulp-docs fetch --path-exclude "$DOCS_PATH" --dest "$DOCS_TMPDIR"
63+
pulp-docs build --path "$DOCS_PATH:$DOCS_TMPDIR"
64+
65+
- name: "Sanity Check"
66+
working-directory: "pulp-docs"
67+
run: |
68+
echo "Checking that the namespace for the component under CI exists in the built docs."
69+
ls "site/${{ github.event.repository.name }}"
70+
...

.github/workflows/docs.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/pr.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: "pulp-docs CI"
23

34
on:
@@ -8,16 +9,12 @@ concurrency:
89
cancel-in-progress: true
910

1011
jobs:
11-
build:
12-
uses: "./.github/workflows/build.yml"
13-
1412
docs:
15-
needs:
16-
- "build"
17-
uses: "./.github/workflows/docs.yml"
13+
uses: "./.github/workflows/docs-ci.yml"
14+
with:
15+
pulpdocs_ref: "${{ github.head_ref }}"
1816

1917
tests:
20-
needs: "build"
2118
uses: "./.github/workflows/tests.yml"
2219

2320
ready-to-ship:
@@ -33,3 +30,4 @@ jobs:
3330
echo '${{toJson(needs)}}' | jq -r 'to_entries[]|select(.value.result!="success")|.key + ": " + .value.result'
3431
echo '${{toJson(needs)}}' | jq -e 'to_entries|map(select(.value.result!="success"))|length == 0'
3532
echo "CI says: Looks good!"
33+
...

.github/workflows/tests.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: "Tests"
23

34
on:
@@ -11,7 +12,7 @@ jobs:
1112
- name: "Set up Python"
1213
uses: "actions/setup-python@v5"
1314
with:
14-
python-version: "3.11"
15+
python-version: "3.12"
1516

1617
- name: "Install Test Dependencies"
1718
run: |
@@ -20,3 +21,4 @@ jobs:
2021
- name: "Run test suite"
2122
run: |
2223
pytest -sv
24+
...

.github/workflows/update-data.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: "Update Data Branch"
23

34
on:
@@ -9,17 +10,17 @@ jobs:
910
update-data:
1011
runs-on: "ubuntu-latest"
1112
permissions:
12-
contents: write
13+
contents: "write"
1314
steps:
1415
- name: "Checkout docs-data branch"
1516
uses: "actions/checkout@v4"
1617
with:
17-
ref: docs-data
18+
ref: "docs-data"
1819

1920
- name: "Set up Python"
2021
uses: "actions/setup-python@v5"
2122
with:
22-
python-version: "3.11"
23+
python-version: "3.12"
2324

2425
- name: "List requirements"
2526
run: |
@@ -40,3 +41,4 @@ jobs:
4041
git config user.name github-actions
4142
git config user.email [email protected]
4243
./update-data.sh
44+
...

.gitignore

Lines changed: 1 addition & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -1,161 +1,15 @@
1-
tmp_dir/
21
# Byte-compiled / optimized / DLL files
32
__pycache__/
4-
*.py[cod]
5-
*$py.class
6-
7-
# C extensions
8-
*.so
93

104
# Distribution / packaging
11-
.Python
12-
build/
13-
develop-eggs/
145
dist/
15-
downloads/
16-
eggs/
17-
.eggs/
18-
lib/
19-
lib64/
20-
parts/
21-
sdist/
22-
var/
23-
wheels/
24-
share/python-wheels/
256
*.egg-info/
26-
.installed.cfg
27-
*.egg
28-
MANIFEST
29-
30-
# PyInstaller
31-
# Usually these files are written by a python script from a template
32-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33-
*.manifest
34-
*.spec
357

36-
# Installer logs
37-
pip-log.txt
38-
pip-delete-this-directory.txt
39-
40-
# Unit test / coverage reports
41-
htmlcov/
42-
.tox/
43-
.nox/
44-
.coverage
45-
.coverage.*
46-
.cache
47-
nosetests.xml
48-
coverage.xml
49-
*.cover
50-
*.py,cover
51-
.hypothesis/
8+
# Unit test
529
.pytest_cache/
53-
cover/
54-
55-
# Translations
56-
*.mo
57-
*.pot
58-
59-
# Django stuff:
60-
*.log
61-
local_settings.py
62-
db.sqlite3
63-
db.sqlite3-journal
64-
65-
# Flask stuff:
66-
instance/
67-
.webassets-cache
68-
69-
# Scrapy stuff:
70-
.scrapy
71-
72-
# Sphinx documentation
73-
docs/_build/
74-
75-
# PyBuilder
76-
.pybuilder/
77-
target/
78-
79-
# Jupyter Notebook
80-
.ipynb_checkpoints
81-
82-
# IPython
83-
profile_default/
84-
ipython_config.py
85-
86-
# pyenv
87-
# For a library or package, you might want to ignore these files since the code is
88-
# intended to run in multiple environments; otherwise, check them in:
89-
# .python-version
90-
91-
# pipenv
92-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
94-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
95-
# install all needed dependencies.
96-
#Pipfile.lock
97-
98-
# poetry
99-
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
100-
# This is especially recommended for binary packages to ensure reproducibility, and is more
101-
# commonly ignored for libraries.
102-
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
103-
#poetry.lock
104-
105-
# pdm
106-
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
107-
#pdm.lock
108-
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
109-
# in version control.
110-
# https://pdm.fming.dev/#use-with-ide
111-
.pdm.toml
112-
113-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
114-
__pypackages__/
115-
116-
# Celery stuff
117-
celerybeat-schedule
118-
celerybeat.pid
119-
120-
# SageMath parsed files
121-
*.sage.py
122-
123-
# Environments
124-
.env
125-
.venv
126-
env/
127-
venv/
128-
ENV/
129-
env.bak/
130-
venv.bak/
131-
132-
# Spyder project settings
133-
.spyderproject
134-
.spyproject
135-
136-
# Rope project settings
137-
.ropeproject
13810

13911
# mkdocs documentation
14012
/site
14113

14214
# mypy
14315
.mypy_cache/
144-
.dmypy.json
145-
dmypy.json
146-
147-
# Pyre type checker
148-
.pyre/
149-
150-
# pytype static type analyzer
151-
.pytype/
152-
153-
# Cython debug symbols
154-
cython_debug/
155-
156-
# PyCharm
157-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
158-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
159-
# and can be added to the global gitignore or merged into this file. For a more nuclear
160-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
161-
#.idea/

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ build:
22
python -m build
33

44
docs:
5-
pulp-docs build
5+
mkdocs build
66

7-
.PHONY: build docs
7+
.PHONY: docs build

custom/rest_api.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{% extends "base.html" %}
2+
3+
{% block styles %}
4+
{{ super() }}
5+
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">
6+
<style>
7+
article.md-content__inner {margin: 0; padding: 0;}
8+
article.md-content__inner::before {height: 0;}
9+
div.md-main__inner {margin: 0;}
10+
div.md-grid {max-width: none;}
11+
</style>
12+
{% endblock %}
13+
14+
{% block site_nav %}
15+
{% endblock %}
16+
17+
{% block content %}
18+
<redoc spec-url="../api.json"></redoc>
19+
{% endblock %}
20+
21+
{% block scripts %}
22+
{{ super() }}
23+
<script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"></script>
24+
{% endblock %}
25+
26+
{% block footer %}
27+
{% endblock %}

0 commit comments

Comments
 (0)