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

The docs are not building due to griffe error #4334

Closed
frjo opened this issue Jan 10, 2025 · 10 comments · Fixed by #4335
Closed

The docs are not building due to griffe error #4334

frjo opened this issue Jan 10, 2025 · 10 comments · Fixed by #4335
Assignees
Labels
Type: Bug Bugs! Things that are broken :-/

Comments

@frjo
Copy link
Member

frjo commented Jan 10, 2025

See https://github.com/HyphaApp/hypha/actions/runs/12706791687/job/35420413236#step:4:654 for error.

@frjo frjo added the Type: Bug Bugs! Things that are broken :-/ label Jan 10, 2025
@frjo
Copy link
Member Author

frjo commented Jan 10, 2025

@theskumar Can you take a look at this when you have time?

Looks like griffe is complaining about this code:

from .definitions.double_stage import DoubleStageDefinition
from .definitions.single_stage import SingleStageDefinition
from .definitions.single_stage_community import SingleStageCommunityDefinition
from .definitions.single_stage_external import SingleStageExternalDefinition
from .definitions.single_stage_same import SingleStageSameDefinition
from .models.phase import Phase
from .models.workflow import Workflow
def phase_data(phases):
"""
Transforms a workflow definition into a dictionary of Phase objects.
Args:
phases: A list of dictionaries defining the workflow phases and their configurations.
Returns:
dict: A dictionary where keys are phase names and values are Phase objects, each initialized
with:
- phase name
- step number (order in workflow)
- additional configuration data from the phase definition
Example:
Input phases = [
{'draft': {'permissions': {...}}},
{'review': {'permissions': {...}}}
]
Returns = {
'draft': Phase('draft', step=0, permissions={...}),
'review': Phase('review', step=1, permissions={...})
}
"""

Can we just stop griffe from scanning the code? We are not using it to build docs in any case.

@frjo
Copy link
Member Author

frjo commented Jan 10, 2025

Found that we do have code to document the API and that is removed now.

@theskumar Can you remove all the code around mkdocstrings, I assume we do not need any of it anymore?

@theskumar
Copy link
Member

Can you remove all the code around mkdocstrings, I assume we do not need any of it anymore?

I believe wes added them to generate the reference docs.
Screenshot 2025-01-10 at 11  06 35@2x
https://docs.hypha.app/references/API/storage_backends/

@theskumar
Copy link
Member

I could be missing __init__.py I'll take a stab at fixing the code.

@theskumar
Copy link
Member

theskumar commented Jan 10, 2025

Found that we do have code to document the API and that is removed now.

@wes-otf would you like to keep the code docs generator.

@frjo
Copy link
Member Author

frjo commented Jan 10, 2025

I wrongly thought it was the literal /api/v1 docs but this is normal hypha code so it should stay in place.

@theskumar
Copy link
Member

@frjo fixed the code that was causing this issue.

@frjo frjo closed this as completed in f4a6015 Jan 10, 2025
@wes-otf
Copy link
Contributor

wes-otf commented Jan 10, 2025

@theskumar what was the issue? missing typing?

@wes-otf
Copy link
Contributor

wes-otf commented Jan 10, 2025

definitely glad we kept the code docs though, but I agree the API label could be misleading

@theskumar
Copy link
Member

@theskumar what was the issue? missing typing?
The issue was missing __init__.py.

If the __init__.py is not present the folders, they are not treated as module by griffee. I don't know the exact details but over time, python itself doesn't seem bother if __init__.py is missing, thats why rest of the code worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Bugs! Things that are broken :-/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants