You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "jorisvandenbossche (via GitHub)" <gi...@apache.org> on 2023/06/15 18:48:40 UTC

[GitHub] [arrow] jorisvandenbossche commented on a diff in pull request #35907: GH-35906: [Docs] Enable building the documentation without having pyarrow installed

jorisvandenbossche commented on code in PR #35907:
URL: https://github.com/apache/arrow/pull/35907#discussion_r1231416154


##########
docs/source/conf.py:
##########
@@ -158,11 +206,18 @@
 # built documents.
 #
 # The short X.Y version.
-version = os.environ.get('ARROW_DOCS_VERSION',
-                         pyarrow.__version__)
+try:
+    version = os.environ.get('ARROW_DOCS_VERSION',
+                             pyarrow.__version__)

Review Comment:
   > So yeah, we could default to an empty string if `ARROW_DOCS_VERSION` is not specified.
   
   I think it would be nice to still use `pyarrow.__version__` _if_ it is installed, and the env variable is not set. It's nice to see a correct version number when building the docs locally for development (when you typically don't specify that env variable).
   
   You could for example use `pyarrow_version =  pyarrow.__version` and `pyarrow_version = ""` in the if/else branches above when trying to import pyarrow, and then use that variable here (`version = os.environ.get('ARROW_DOCS_VERSION', pyarrow_version)`)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org