diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 0000000000000..2e1fe3fbc251a --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,2 @@ +conda: + file: python/doc/environment.yml diff --git a/python/doc/conf.py b/python/doc/conf.py index 4c324a8086c39..e817bbdd42bd3 100644 --- a/python/doc/conf.py +++ b/python/doc/conf.py @@ -42,7 +42,12 @@ cmd_line = cmd_line_template.format(outputdir=output_dir, moduledir=module_dir) apidoc.main(cmd_line.split(" ")) -sys.path.insert(0, os.path.abspath('..')) +on_rtd = os.environ.get('READTHEDOCS') == 'True' + +if not on_rtd: + # Hack: On RTD we use the pyarrow package from conda-forge as we cannot + # build pyarrow there. + sys.path.insert(0, os.path.abspath('..')) # -- General configuration ------------------------------------------------ diff --git a/python/doc/environment.yml b/python/doc/environment.yml new file mode 100644 index 0000000000000..8d1fe9bfb5d11 --- /dev/null +++ b/python/doc/environment.yml @@ -0,0 +1,25 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +channels: +- defaults +- conda-forge +dependencies: +- arrow-cpp +- parquet-cpp +- pyarrow +- numpydoc