mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-09 19:13:03 +00:00
set version as long as we are rewriting the file
This commit is contained in:
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -29,7 +29,7 @@ jobs:
|
||||
with:
|
||||
python-version: "3.9"
|
||||
- run: |
|
||||
pip install -r docs/requirements.txt pytest
|
||||
pip install -r docs/requirements.txt pytest -e .
|
||||
- run: |
|
||||
pytest docs/
|
||||
|
||||
|
@@ -5,6 +5,7 @@ from pathlib import Path
|
||||
from pytablewriter import MarkdownTableWriter
|
||||
from ruamel.yaml import YAML
|
||||
|
||||
import jupyterhub
|
||||
from jupyterhub.scopes import scope_definitions
|
||||
|
||||
HERE = os.path.abspath(os.path.dirname(__file__))
|
||||
@@ -102,9 +103,10 @@ class ScopeTableGenerator:
|
||||
yaml = YAML(typ='rt')
|
||||
yaml.preserve_quotes = True
|
||||
scope_dict = {}
|
||||
with open(filename, 'r+') as f:
|
||||
with open(filename) as f:
|
||||
content = yaml.load(f.read())
|
||||
f.seek(0)
|
||||
|
||||
content["info"]["version"] = jupyterhub.__version__
|
||||
for scope in self.scopes:
|
||||
description = self.scopes[scope]['description']
|
||||
doc_description = self.scopes[scope].get('doc_description', '')
|
||||
@@ -112,8 +114,9 @@ class ScopeTableGenerator:
|
||||
description = doc_description
|
||||
scope_dict[scope] = description
|
||||
content['securityDefinitions']['oauth2']['scopes'] = scope_dict
|
||||
|
||||
with open(filename, 'w') as f:
|
||||
yaml.dump(content, f)
|
||||
f.truncate()
|
||||
|
||||
|
||||
def main():
|
||||
|
Reference in New Issue
Block a user