Makefile: Reset environment for epydoc
authorMichael Hanselmann <hansmi@google.com>
Wed, 5 Dec 2012 16:41:54 +0000 (17:41 +0100)
committerMichael Hanselmann <hansmi@google.com>
Wed, 5 Dec 2012 17:05:52 +0000 (18:05 +0100)
epydoc allows overriding configuration values via environment variables.
While this might be useful in certain use cases, but as no prefix
whatsoever is used, conflicts are easily created. Some people have the
environment variable “NAME” set, effectively overriding the project name
set in epydoc.conf. A bug in epydoc causes an error if non-ASCII
characters, such as German umlauts, are used in NAME.

$ NAME=Täscht make py-apidoc
[…]
UNEXPECTED ERROR:
'ascii' codec can't decode byte 0xc3 in position 73: ordinal not in range(128)

$ parse=false make py-apidoc
[…]
epydoc: error: Invalid option combination: --parse-only and --introspect-only.

This patch changes the call in Makefile to reset the environment given
to epydoc save for PATH and PYTHONPATH.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

Makefile.am

index dfd8370..24f6f22 100644 (file)
@@ -1631,6 +1631,7 @@ endif
 
 .PHONY: py-apidoc
 py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(GENERATED_FILES)
+       env - PATH="$$PATH" PYTHONPATH="$$PYTHONPATH" \
        $(RUN_IN_TEMPDIR) epydoc -v \
          --conf $(CURDIR)/epydoc.conf \
          --output $(CURDIR)/$(APIDOC_PY_DIR)