marshmallow-code / marshmallow-code/flask-marshmallow

Building docs fails with Sphinx 7.2 and SOURCE_DATE_EPOCH environment variable

Open
#275 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
887
Forks
65
Avg merge
7h 25m
Merged PRs (30d)
3

Description

Hi,
Currently your package fails to build from source in Debian with Sphinx 7.2:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1042586
The failure is caused by SOURCE_DATE_EPOCH environment variable added during build in Debian.
Please see [here](https://github.com/sphinx-doc/sphinx/pull/2503) and [here](https://github.com/sphinx-doc/sphinx/issues/11627) for reference.

Step to reproduce:
```
$ export SOURCE_DATE_EPOCH=1699611891; sphinx-build -b html python-flask-marshmallow-0.15.0/docs/ .

Running Sphinx v7.2.6
WARNING: html_static_path entry '_static' is placed inside outdir

Extension error (sphinx.config):
Handler for event 'config-inited' threw an exception (exception: string index out of range)
```
Offending lines:
https://github.com/marshmallow-code/flask-marshmallow/blob/c6392231851f624ca1e2ba2d864a67e4b7b106de/docs/conf.py#L37-L39

This change solves the issue:
```
copyright = "2014-{:%Y}, something".format(
dt.datetime.utcfromtimestamp(os.path.getmtime("../CHANGELOG.rst"))
)
```

Kind Regards

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with docs/conf.py at the reported lines 37-39 and reproduce the failure using Sphinx 7.2 with SOURCE_DATE_EPOCH set. Verify the correction against the Debian-linked behavior, then run the documented sphinx-build command; done means the HTML documentation builds without the config-inited exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.