Skip to content

Commit 628f852

Browse files
authored
Merge pull request #254 from adafruit/readthedocs-patch
Added readthedocs file patch
2 parents 805b0dd + 77359dd commit 628f852

File tree

2 files changed

+62
-13
lines changed

2 files changed

+62
-13
lines changed

adabot/lib/circuitpython_library_validators.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def get_result(self):
9393
" without reference to import errno. See issue "
9494
"https://github.com/adafruit/circuitpython/issues/1582"
9595
)
96-
ERROR_MISMATCHED_READTHEDOCS = "Mismatched readthedocs.yml"
96+
ERROR_MISMATCHED_READTHEDOCS = "Mismatched readthedocs.yaml"
9797
ERROR_MISSING_DESCRIPTION = "Missing repository description"
9898
ERROR_MISSING_EXAMPLE_FILES = "Missing .py files in examples folder"
9999
ERROR_MISSING_EXAMPLE_FOLDER = "Missing examples folder"
@@ -110,7 +110,7 @@ def get_result(self):
110110
ERROR_MISSING_LINT = "Missing lint config"
111111
ERROR_MISSING_CODE_OF_CONDUCT = "Missing CODE_OF_CONDUCT.md"
112112
ERROR_MISSING_README_RST = "Missing README.rst"
113-
ERROR_MISSING_READTHEDOCS = "Missing readthedocs.yml"
113+
ERROR_MISSING_READTHEDOCS = "Missing readthedocs.yaml"
114114
ERROR_MISSING_SETUP_PY = "For pypi compatibility, missing setup.py"
115115
ERROR_MISSING_REQUIREMENTS_TXT = "For pypi compatibility, missing requirements.txt"
116116
ERROR_MISSING_BLINKA = (
@@ -230,25 +230,25 @@ def __init__(
230230

231231
@property
232232
def rtd_yml_base(self):
233-
"""The parsed YAML from `.readthedocs.yml` in the cookiecutter-adafruit-circuitpython repo.
234-
Used to verify that a library's `.readthedocs.yml` matches this version.
233+
"""The parsed YAML from `.readthedocs.yaml` in the cookiecutter-adafruit-circuitpython repo.
234+
Used to verify that a library's `.readthedocs.yaml` matches this version.
235235
"""
236236
if self._rtd_yaml_base is None:
237237
rtd_yml_dl_url = (
238238
"https://raw.githubusercontent.com/adafruit/cookiecutter-adafruit-"
239239
"circuitpython/main/%7B%7B%20cookiecutter%20and%20'tmp_repo'%20%7D"
240240
"%7D/%7B%25%20if%20cookiecutter.sphinx_docs%20in%20%5B'y'%2C%20'yes'"
241-
"%5D%20%25%7D.readthedocs.yml%7B%25%20endif%20%25%7D"
241+
"%5D%20%25%7D.readthedocs.yaml%7B%25%20endif%20%25%7D"
242242
)
243243
rtd_yml = requests.get(rtd_yml_dl_url)
244244
if rtd_yml.ok:
245245
try:
246246
self._rtd_yaml_base = yaml.safe_load(rtd_yml.text)
247247
except yaml.YAMLError:
248-
print("Error parsing cookiecutter .readthedocs.yml.")
248+
print("Error parsing cookiecutter .readthedocs.yaml.")
249249
self._rtd_yaml_base = ""
250250
else:
251-
print("Error retrieving cookiecutter .readthedocs.yml")
251+
print("Error retrieving cookiecutter .readthedocs.yaml")
252252
self._rtd_yaml_base = ""
253253

254254
return self._rtd_yaml_base
@@ -645,7 +645,7 @@ def validate_contents(self, repo):
645645
files = [x["name"] for x in content_list]
646646

647647
# ignore new/in-work repos, which should have less than 8 files:
648-
# ___.py or folder, CoC, .github/, .readthedocs.yml, docs/,
648+
# ___.py or folder, CoC, .github/, .readthedocs.yaml, docs/,
649649
# examples/, README, LICENSE
650650
if len(files) < 8:
651651
BUNDLE_IGNORE_LIST.append(repo["name"])
@@ -701,11 +701,11 @@ def validate_contents(self, repo):
701701
else:
702702
errors.append(ERROR_UNABLE_PULL_REPO_CONTENTS)
703703

704-
if "readthedocs.yml" in files or ".readthedocs.yml" in files:
704+
if "readthedocs.yaml" in files or ".readthedocs.yaml" in files:
705705
if self.rtd_yml_base != "":
706-
filename = "readthedocs.yml"
707-
if ".readthedocs.yml" in files:
708-
filename = ".readthedocs.yml"
706+
filename = "readthedocs.yaml"
707+
if ".readthedocs.yaml" in files:
708+
filename = ".readthedocs.yaml"
709709
file_info = content_list[files.index(filename)]
710710
rtd_contents = requests.get(file_info["download_url"])
711711
if rtd_contents.ok:
@@ -715,7 +715,7 @@ def validate_contents(self, repo):
715715
errors.append(ERROR_MISMATCHED_READTHEDOCS)
716716
except yaml.YAMLError:
717717
self.output_file_data.append(
718-
"Error parsing {} .readthedocs.yml.".format(repo["name"])
718+
"Error parsing {} .readthedocs.yaml.".format(repo["name"])
719719
)
720720
errors.append(ERROR_OUTPUT_HANDLER)
721721
else:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
From df685288b18965c4089a8895b0eb3bf80c17423e Mon Sep 17 00:00:00 2001
2+
From: dherrada <[email protected]>
3+
Date: Tue, 9 Nov 2021 13:31:14 -0500
4+
Subject: [PATCH] Updated readthedocs file
5+
6+
---
7+
.readthedocs.yaml | 15 +++++++++++++++
8+
.readthedocs.yml | 7 -------
9+
2 files changed, 15 insertions(+), 7 deletions(-)
10+
create mode 100644 .readthedocs.yaml
11+
delete mode 100644 .readthedocs.yml
12+
13+
diff --git a/.readthedocs.yaml b/.readthedocs.yaml
14+
new file mode 100644
15+
index 0000000..95ec218
16+
--- /dev/null
17+
+++ b/.readthedocs.yaml
18+
@@ -0,0 +1,15 @@
19+
+# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
20+
+#
21+
+# SPDX-License-Identifier: Unlicense
22+
+
23+
+# Read the Docs configuration file
24+
+# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
25+
+
26+
+# Required
27+
+version: 2
28+
+
29+
+python:
30+
+ version: "3.6"
31+
+ install:
32+
+ - requirements: docs/requirements.txt
33+
+ - requirements: requirements.txt
34+
diff --git a/.readthedocs.yml b/.readthedocs.yml
35+
deleted file mode 100644
36+
index 49dcab3..0000000
37+
--- a/.readthedocs.yml
38+
+++ /dev/null
39+
@@ -1,7 +0,0 @@
40+
-# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
41+
-#
42+
-# SPDX-License-Identifier: Unlicense
43+
-
44+
-python:
45+
- version: 3
46+
-requirements_file: docs/requirements.txt
47+
--
48+
2.25.1
49+

0 commit comments

Comments
 (0)