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

Does not work with python3.10 #43

Open
spagh-eddie opened this issue Apr 21, 2022 · 4 comments
Open

Does not work with python3.10 #43

spagh-eddie opened this issue Apr 21, 2022 · 4 comments

Comments

@spagh-eddie
Copy link

spagh-eddie commented Apr 21, 2022

This syntax is causing the action to fail. The syntax is for python3.10.

# file.py

with (
    open(...) as f,  # this is line 119
    open(...) as g,
):
    do_cool_stuff()

error message:

[AutoAPI] Reading files... [ 26%] /github/workspace/.../file.py

Extension error (autoapi.extension):
Handler <function run_autoapi at 0x7f0ef2a43af0> for event 'builder-inited' threw an exception (exception: Parsing Python code failed:
invalid syntax (<unknown>, line 119))
make: *** [Makefile:20: html] Error 2
[sphinx-action] Starting sphinx-action build.
Running: 
====================================
Building docs in docs/
====================================
[sphinx-action] Running: ['make', 'html', '-e']
[sphinx-action] Build failed with 0 warnings
Traceback (most recent call last):
  File "/entrypoint.py", line 22, in <module>
    action.build_all_docs(github_env, [os.environ.get("INPUT_DOCS-FOLDER")])
  File "/sphinx_action/action.py", line 167, in build_all_docs
    raise RuntimeError("Build failed")
RuntimeError: Build failed

our action file:

name: Sphinx build

on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Build HTML
      uses: ammaraskar/[email protected]  # uses the /docs/requirements.txt file
@hwayne
Copy link

hwayne commented Jun 22, 2022

I think it's because the dockerfile uses the Sphinx 2.4.4 container, which is out of date.

@flywire
Copy link

flywire commented Aug 17, 2022

Does that mean there is no Deploying a Sphinx project online?

flywire referenced this issue in sphinx-doc/sphinx Aug 17, 2022
Version 0.4 of sphinx-action contains a problem investigated and documented here: ammaraskar/sphinx-action#5. The action throws an error claiming it can't write the log file. The problem is fixed in master and since this is a tutorial, it is more or less expected that it should work off the bat, so I thinking pinning the master version for now and the next release when it comes out, might be the best way to help newbies.
@hwayne
Copy link

hwayne commented Aug 17, 2022

@flywire I ended up just building my own project manually:

      - name: directly build sphinx
        run: |
          pip install -r requirements.txt
          sphinx-build -D todo_include_todos=0 docs ./docs/_build/html/

Way easier than figuring out how to config this action overall.

@SunC0der
Copy link

SunC0der commented Jan 12, 2023

Found an alternative solution: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-static-site-generators-with-python

He codes the html generation also manually and deploys the created webpage with his github action

skim0119 added a commit to GazzolaLab/PyElastica that referenced this issue Mar 9, 2023
ammaraskar/sphinx-action#43
ammaraskar/sphinx-action#49

Build is working okay, it is the github-action not compatible with poetry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants