Skip to content

Commit e5c0c1c

Browse files
stsewdagjohnson
authored andcommitted
Add schema for configuration file with yamale (#4084)
* Add basic schema * Write basic test * Refactor tests * More tests: formats * Version 2 only * Simplified install options * Tests for all the schema * Add more configurations to the spec * And more tests * Use " instead of scape ' * Update spec * Rename * Refactor tests * Add path validator * Refactor tests pytest style * Docs * Reuse utils from readthedocs_build * Add sphinx and mkdocs to the spec * More tests * Better names for tests * Update gitignore * Add validations for unique keys * Linter * Isort * Rename * Extend build class * Just do unit test with yamale * Change values from spec * Isort
1 parent 07bcf4c commit e5c0c1c

File tree

4 files changed

+655
-0
lines changed

4 files changed

+655
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.db
2+
*.rdb
23
*.egg-info
34
*.log
45
*.pyc
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Read the Docs configuration file
2+
3+
# The version of the spec to be use
4+
version: enum('2')
5+
6+
# Formats of the documentation to be built
7+
# Default: []
8+
formats: any(list(enum('htmlzip', 'pdf', 'epub')), enum('all'), required=False)
9+
10+
# Configuration for Conda support
11+
conda: include('conda', required=False)
12+
13+
# Configuration for the documentation build process
14+
build: include('build', required=False)
15+
16+
# Configuration of the Python environment to be used
17+
python: include('python', required=False)
18+
19+
# Configuration for sphinx documentation
20+
sphinx: include('sphinx', required=False)
21+
22+
# Configuration for mkdocs documentation
23+
mkdocs: include('mkdocs', required=False)
24+
25+
# Submodules configuration
26+
submodules: include('submodules', required=False)
27+
28+
# Redirects for the current version to be built
29+
# Key/value list, represent redirects of type `type`
30+
# from url -> to url
31+
# Default: null
32+
redirects: map(enum('page'), map(str(), str()), required=False)
33+
34+
---
35+
36+
conda:
37+
# The path to the Conda environment file from the root of the project
38+
environment: path()
39+
40+
build:
41+
# The build docker image to be used
42+
# Default: 'latest'
43+
image: enum('stable', 'latest', required=False)
44+
45+
python:
46+
# The Python version (this depends on the build image)
47+
# Default: '3'
48+
version: enum('2', '2.7', '3', '3.3', '3.4', '3.5', '3.6', required=False)
49+
50+
# The path to the requirements file from the root of the project
51+
# Default: null
52+
requirements: path(required=False)
53+
54+
# Install the project using python setup.py install or pip
55+
# Default: null
56+
install: enum('pip', 'setup.py', required=False)
57+
58+
# Extra requirements sections to install in addition to the package dependencies
59+
# Default: []
60+
extra_requirements: list(str(), required=False)
61+
62+
# Give the virtual environment access to the global site-packages dir
63+
# Default: false
64+
system_packages: bool(required=False)
65+
66+
sphinx:
67+
# The path to the conf.py file
68+
# Default: rtd will try to find it
69+
configuration: path(required=False)
70+
71+
# Add the -W option to sphinx-build
72+
# Default: false
73+
fail_on_warning: bool(required=False)
74+
75+
mkdocs:
76+
# The path to the mkdocs.yml file
77+
# Default: rtd will try to find it
78+
configuration: path(required=False)
79+
80+
# Add the --strict optio to mkdocs build
81+
# Default: false
82+
fail_on_warning: bool(required=False)
83+
84+
85+
submodules:
86+
# List of submodules to be included
87+
# Default: []
88+
include: any(list(str()), enum('all'), required=False)
89+
90+
# List of submodules to be ignored
91+
# Default: []
92+
exclude: any(list(str()), enum('all'), required=False)
93+
94+
# Do a recursive clone?
95+
# Default: false
96+
recursive: bool(required=False)

0 commit comments

Comments
 (0)