Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Documentation for anemoi-training broken #161

Closed
anaprietonem opened this issue Nov 25, 2024 · 3 comments
Closed

Documentation for anemoi-training broken #161

anaprietonem opened this issue Nov 25, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@anaprietonem
Copy link
Contributor

What happened?

The CI action to automatically build the docs generates broken link for the preview of the docs

What are the steps to reproduce the bug?

Open a PR where there is an update to any file associated to the docs that will trigger the action [readtthedocs-pr-update.yml](https://github.com/ecmwf/anemoi-training/blob/develop/.github/workflows/readtthedocs-pr-update.yml) and generate a new documentation preview like:

📚 Documentation preview 📚: https://anemoi-training--158.org.readthedocs.build/en/158/

Action uses - https://github.com/readthedocs/actions but there are no recent changes or issues reported
Other anemoi packages seems to be okey.

Version

v0.3.0

Platform (OS and architecture)

ATOS

Relevant log output

No response

Accompanying data

No response

Organisation

No response

@anaprietonem anaprietonem added the bug Something isn't working label Nov 25, 2024
@anaprietonem anaprietonem changed the title Build the docs is broken for anemoi-training CI to Preview PR "Build the docs" is broken for anemoi-training Nov 25, 2024
@anaprietonem anaprietonem changed the title CI to Preview PR "Build the docs" is broken for anemoi-training CI action to Preview PR "Build the docs" is broken for anemoi-training Nov 25, 2024
@JesperDramsch
Copy link
Member

It's not the CI that is broken but the config for Readthedocs, which doesn't use the correct timezone signifier.

https://readthedocs.org/projects/anemoi-training/builds/26555195/

Running Sphinx v8.1.3

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/anemoi-training/envs/latest/lib/python3.11/site-packages/sphinx/config.py", line 529, in eval_config_file
    exec(code, namespace)  # NoQA: S102
    ^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/anemoi-training/checkouts/latest/docs/conf.py", line 45, in <module>
    year = datetime.datetime.now(tz="UTC").year
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: tzinfo argument must be None or of a tzinfo subclass, not type 'str'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/anemoi-training/envs/latest/lib/python3.11/site-packages/sphinx/cmd/build.py", line 496, in build_main
    app = Sphinx(
          ^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/anemoi-training/envs/latest/lib/python3.11/site-packages/sphinx/application.py", line 238, in __init__
    self.config = Config.read(self.confdir, confoverrides or {}, self.tags)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/anemoi-training/envs/latest/lib/python3.11/site-packages/sphinx/config.py", line 316, in read
    namespace = eval_config_file(filename, tags)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/anemoi-training/envs/latest/lib/python3.11/site-packages/sphinx/config.py", line 542, in eval_config_file
    raise ConfigError(msg % traceback.format_exc()) from exc
sphinx.errors.ConfigError: There is a programmable error in your configuration file:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/anemoi-training/envs/latest/lib/python3.11/site-packages/sphinx/config.py", line 529, in eval_config_file
    exec(code, namespace)  # NoQA: S102
    ^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/anemoi-training/checkouts/latest/docs/conf.py", line 45, in <module>
    year = datetime.datetime.now(tz="UTC").year
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: tzinfo argument must be None or of a tzinfo subclass, not type 'str'


Configuration error:
There is a programmable error in your configuration file:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/anemoi-training/envs/latest/lib/python3.11/site-packages/sphinx/config.py", line 529, in eval_config_file
    exec(code, namespace)  # NoQA: S102
    ^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/anemoi-training/checkouts/latest/docs/conf.py", line 45, in <module>
    year = datetime.datetime.now(tz="UTC").year
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: tzinfo argument must be None or of a tzinfo subclass, not type 'str'

@JesperDramsch JesperDramsch changed the title CI action to Preview PR "Build the docs" is broken for anemoi-training Documentation for anemoi-training broken Dec 11, 2024
@JesperDramsch
Copy link
Member

This should be fixed before #187 probably.

@JesperDramsch
Copy link
Member

We could add shields to our Readme:

Documentation Status

[![Documentation Status](https://readthedocs.org/projects/anemoi-training/badge/?version=latest)](https://anemoi-training.readthedocs.io/en/latest/?badge=latest)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants