Skip to content

Add readthedocs #188

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add readthedocs #188

wants to merge 2 commits into from

Conversation

So-Fras
Copy link
Member

@So-Fras So-Fras commented Mar 28, 2025

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • A PR or issue has been opened in all impacted repositories (if any)

What kind of change does this PR introduce?
Add readthedocs configuration files

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

So-Fras added 2 commits March 28, 2025 09:27
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
@So-Fras So-Fras changed the title [WIP] Add readthedocs Add readthedocs Mar 28, 2025
@So-Fras So-Fras marked this pull request as ready for review March 28, 2025 15:57
Comment on lines +42 to +62
# We have a single source of truth for our version number: the project's pom.xml file.
# This next bit of code reads from it.
file_with_version = os.path.join(source_path, "pom.xml")
with open(file_with_version) as f:
next_line_contains_version = False
for line in f:
if next_line_contains_version == False:
m = re.match(r'^ {4}\<artifactId\>' + module_name + r'\<\/artifactId\>', line)
if m:
next_line_contains_version = True
else:
m = re.match(r'^ {4}\<version\>(.*)\<\/version\>', line)
if m:
__version__ = m.group(1)
# The short X.Y version.
version = ".".join(__version__.split(".")[:2])
# The full version, including alpha/beta/rc tags.
release = __version__
break
else: # AKA no-break
version = release = "dev"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have a pom.xml but a package.json in Node project.

Comment on lines +162 to +176
# Replace the default version in the URL with the version from the pom.xml
def replace_versions(intersphinx_mapping, file):
with open(file) as f:
for line in f:
m = re.match(r'^ {8}\<(.*)\.version\>(.*)\<\/(.*)\.version\>', line)
if m and m.group(1) == m.group(3):
dependency = m.group(1)
version = m.group(2)
if "SNAPSHOT" not in version and dependency in intersphinx_mapping:
url_start = extract_base_url(intersphinx_mapping[dependency][0])
if url_start:
intersphinx_mapping[dependency] = (url_start + version + "/", None)
if "</properties>" in line:
break
return intersphinx_mapping
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Comment on lines +4 to +6
os: ubuntu-20.04
tools:
python: "3.9"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the example

Suggested change
os: ubuntu-20.04
tools:
python: "3.9"
os: ubuntu-22.04
tools:
python: "3.10"

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

Successfully merging this pull request may close these issues.

2 participants