Skip to content

Commit 8af0aa9

Browse files
tedmistonkaxil
authored andcommitted
[AIRFLOW-2857] Fix Read the Docs env (#3703)
The Read the Docs build process was broken due to #3660. This PR fixes this.
1 parent b74a712 commit 8af0aa9

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

.readthedocs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
# to you under the Apache License, Version 2.0 (the
77
# "License"); you may not use this file except in compliance
88
# with the License. You may obtain a copy of the License at
9-
#
9+
#
1010
# http://www.apache.org/licenses/LICENSE-2.0
11-
#
11+
#
1212
# Unless required by applicable law or agreed to in writing,
1313
# software distributed under the License is distributed on an
1414
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -22,4 +22,4 @@ python:
2222
- doc
2323
- docker
2424
- gcp_api
25-
- emr
25+
- emr

setup.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@
3737

3838
# See LEGAL-362
3939
def verify_gpl_dependency():
40+
# The Read the Docs build environment [1] does a pip install of Airflow which cannot
41+
# be overridden with custom environment variables, so we detect the READTHEDOCS env
42+
# var they provide to set the env var that avoids the GPL dependency on install when
43+
# building the docs site.
44+
# [1]: http://docs.readthedocs.io/en/latest/builds.html#build-environment
45+
if os.getenv("READTHEDOCS") == "True":
46+
os.environ["SLUGIFY_USES_TEXT_UNIDECODE"] = "yes"
47+
4048
if (not os.getenv("AIRFLOW_GPL_UNIDECODE")
4149
and not os.getenv("SLUGIFY_USES_TEXT_UNIDECODE") == "yes"):
4250
raise RuntimeError("By default one of Airflow's dependencies installs a GPL "
@@ -161,6 +169,7 @@ def write_version(filename=os.path.join(*['airflow',
161169
databricks = ['requests>=2.5.1, <3']
162170
datadog = ['datadog>=0.14.0']
163171
doc = [
172+
'mock',
164173
'sphinx>=1.2.3',
165174
'sphinx-argparse>=0.1.13',
166175
'sphinx-rtd-theme>=0.1.6',

0 commit comments

Comments
 (0)