mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-07 01:54:09 +00:00
run generate-scope-table.py in pre-commit
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -7,8 +7,6 @@ node_modules
|
|||||||
dist
|
dist
|
||||||
docs/_build
|
docs/_build
|
||||||
docs/build
|
docs/build
|
||||||
docs/source/_static/rest-api
|
|
||||||
docs/source/rbac/scope-table.md
|
|
||||||
docs/source/reference/metrics.md
|
docs/source/reference/metrics.md
|
||||||
|
|
||||||
.ipynb_checkpoints
|
.ipynb_checkpoints
|
||||||
|
@@ -33,7 +33,7 @@ repos:
|
|||||||
rev: v4.0.0-alpha.8
|
rev: v4.0.0-alpha.8
|
||||||
hooks:
|
hooks:
|
||||||
- id: prettier
|
- id: prettier
|
||||||
exclude: .*/templates/.*
|
exclude: .*/templates/.*|docs/source/_static/rest-api.yml|docs/source/rbac/scope-table.md
|
||||||
|
|
||||||
# autoformat HTML templates
|
# autoformat HTML templates
|
||||||
- repo: https://github.com/djlint/djLint
|
- repo: https://github.com/djlint/djLint
|
||||||
@@ -56,3 +56,16 @@ repos:
|
|||||||
- id: requirements-txt-fixer
|
- id: requirements-txt-fixer
|
||||||
- id: check-case-conflict
|
- id: check-case-conflict
|
||||||
- id: check-executables-have-shebangs
|
- id: check-executables-have-shebangs
|
||||||
|
|
||||||
|
# source docs: rest-api.yml and scope-table.md are autogenerated
|
||||||
|
- repo: local
|
||||||
|
hooks:
|
||||||
|
- id: update-api-and-scope-docs
|
||||||
|
name: Update rest-api.yml and scope-table.md based on scopes.py
|
||||||
|
language: python
|
||||||
|
additional_dependencies: ["pytablewriter", "ruamel.yaml"]
|
||||||
|
entry: python docs/source/rbac/generate-scope-table.py
|
||||||
|
args:
|
||||||
|
- --update
|
||||||
|
files: jupyterhub/scopes.py
|
||||||
|
pass_filenames: false
|
||||||
|
@@ -35,7 +35,7 @@ help:
|
|||||||
# - NOTE: If the pre-requisites for the html target is updated, also update the
|
# - NOTE: If the pre-requisites for the html target is updated, also update the
|
||||||
# Read The Docs section in docs/source/conf.py.
|
# Read The Docs section in docs/source/conf.py.
|
||||||
#
|
#
|
||||||
html: metrics scopes
|
html: metrics
|
||||||
$(SPHINXBUILD) -b html "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS)
|
$(SPHINXBUILD) -b html "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS)
|
||||||
@echo
|
@echo
|
||||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||||
@@ -44,10 +44,6 @@ metrics: source/reference/metrics.md
|
|||||||
source/reference/metrics.md:
|
source/reference/metrics.md:
|
||||||
python3 generate-metrics.py
|
python3 generate-metrics.py
|
||||||
|
|
||||||
scopes: source/rbac/scope-table.md
|
|
||||||
source/rbac/scope-table.md:
|
|
||||||
python3 source/rbac/generate-scope-table.py
|
|
||||||
|
|
||||||
|
|
||||||
# Manually added targets - related to development
|
# Manually added targets - related to development
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
@@ -56,7 +52,7 @@ source/rbac/scope-table.md:
|
|||||||
# - requires sphinx-autobuild, see
|
# - requires sphinx-autobuild, see
|
||||||
# https://sphinxcontrib-spelling.readthedocs.io/en/latest/
|
# https://sphinxcontrib-spelling.readthedocs.io/en/latest/
|
||||||
# - builds and rebuilds html on changes to source, but does not re-generate
|
# - builds and rebuilds html on changes to source, but does not re-generate
|
||||||
# metrics/scopes files
|
# metrics files
|
||||||
# - starts a livereload enabled webserver and opens up a browser
|
# - starts a livereload enabled webserver and opens up a browser
|
||||||
devenv: html
|
devenv: html
|
||||||
sphinx-autobuild -b html --open-browser "$(SOURCEDIR)" "$(BUILDDIR)/html"
|
sphinx-autobuild -b html --open-browser "$(SOURCEDIR)" "$(BUILDDIR)/html"
|
||||||
|
0
docs/source/rbac/scope-table.md
Normal file
0
docs/source/rbac/scope-table.md
Normal file
@@ -31,8 +31,11 @@ from tornado.log import app_log
|
|||||||
from . import orm, roles
|
from . import orm, roles
|
||||||
from ._memoize import DoNotCache, FrozenDict, lru_cache_key
|
from ._memoize import DoNotCache, FrozenDict, lru_cache_key
|
||||||
|
|
||||||
"""when modifying the scope definitions, make sure that `docs/source/rbac/generate-scope-table.py` is run
|
"""when modifying the scope definitions
|
||||||
so that changes are reflected in the documentation and REST API description."""
|
`docs/source/rbac/generate-scope-table.py` must be run
|
||||||
|
so that changes are reflected in the documentation and REST API description.
|
||||||
|
`pre-commit run -a` should automatically take care of this.
|
||||||
|
"""
|
||||||
scope_definitions = {
|
scope_definitions = {
|
||||||
'(no_scope)': {'description': 'Identify the owner of the requesting entity.'},
|
'(no_scope)': {'description': 'Identify the owner of the requesting entity.'},
|
||||||
'self': {
|
'self': {
|
||||||
|
Reference in New Issue
Block a user