-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: main
Are you sure you want to change the base?
Add readthedocs #188
Conversation
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
|
# 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" |
There was a problem hiding this comment.
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.
# 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
os: ubuntu-20.04 | ||
tools: | ||
python: "3.9" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the example
os: ubuntu-20.04 | |
tools: | |
python: "3.9" | |
os: ubuntu-22.04 | |
tools: | |
python: "3.10" |
Please check if the PR fulfills these requirements
What kind of change does this PR introduce?
Add readthedocs configuration files
Does this PR introduce a breaking change or deprecate an API?