Skip to content

Commit

Permalink
Change default version to "Latest"
Browse files Browse the repository at this point in the history
If a version was not set in the project table, and the project isn't a
Python package, then default to a string "Latest" for the Sphinx
version. "None" isn't a valid value for Sphinx.
  • Loading branch information
jonathansick committed Jan 30, 2024
1 parent 5b89e1e commit b006841
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/documenteer/conf/_toml.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,15 +381,15 @@ def version(self) -> Optional[str]:
1. project.version field in ``documenteer.toml``
2. From importlib if the project.python table is set
3. Default is None.
3. Default is "Latest".
"""
if self.conf.project.version is not None:
return self.conf.project.version
elif self.conf.project.python is not None:
# Via pydantic validation we know this works
return get_version(self.conf.project.python.package)
else:
return None
return "Latest"

@property
def rst_epilog_path(self) -> Optional[Path]:
Expand Down

0 comments on commit b006841

Please sign in to comment.