Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade documentation for migration to aiida-core 2.6 #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion aiida_restapi/graphql/orm_factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@

def get_pydantic_type_name(annotation: Any) -> Any:
"""
In pydantic v1, one could do field.type_,
In pydantic v1, one could do `field.type_`,
but in v2, one has to go though field.annotation
"""

args = typing.get_args(annotation)
if args:
return args[0]
Expand Down
4 changes: 2 additions & 2 deletions aiida_restapi/graphql/sphinx_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# pylint: disable=import-outside-toplevel
from typing import TYPE_CHECKING, List

from graphql.utils.schema_printer import print_schema
from graphql.utilities import print_schema

from .main import SCHEMA

Expand All @@ -21,7 +21,7 @@ class SchemaDirective(SphinxDirective):

def run(self) -> List[Element]:
"""Run the directive."""
text = print_schema(SCHEMA)
text = print_schema(SCHEMA.graphql_schema)
# TODO for lexing tried: https://gitlab.com/marcogiusti/pygments-graphql/-/blob/master/src/pygments_graphql.py
# but it failed
code_node = literal_block(text, text) # , language="graphql")
Expand Down
8 changes: 0 additions & 8 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,8 @@
import sys
import time

from aiida.manage.configuration import load_documentation_profile

import aiida_restapi

# -- AiiDA-related setup --------------------------------------------------

# Load the dummy profile even if we are running locally, this way the documentation will succeed even if the current
# default profile of the AiiDA installation does not use a Django backend.
load_documentation_profile()

extensions = [
'myst_parser',
'sphinx_external_toc',
Expand Down
Loading