lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Install python modules from build directory (issue 575960043 by addr


From: jonas . hahnfeld
Subject: Re: Install python modules from build directory (issue 575960043 by address@hidden)
Date: Sun, 05 Apr 2020 14:54:39 -0700

Reviewers: hanwenn,


https://codereview.appspot.com/575960043/diff/557650043/make/lilypond-vars.make
File make/lilypond-vars.make (right):

https://codereview.appspot.com/575960043/diff/557650043/make/lilypond-vars.make#newcode20
make/lilypond-vars.make:20: export
PYTHONPATH:=$(top-build-dir)/python/$(outconfbase):$(PYTHONPATH)
On 2020/04/05 21:48:46, hanwenn wrote:
> This will potentially make the out-www build fail. It's much better to
load the
> source files directly, because they're always there and they're always
up to
> date. 

I don't see why this should break: It's now back to the state it was
before you changed it. But I can change it to out/ if you prefer.

https://codereview.appspot.com/575960043/diff/557650043/python/GNUmakefile
File python/GNUmakefile (right):

https://codereview.appspot.com/575960043/diff/557650043/python/GNUmakefile#newcode27
python/GNUmakefile:27: local-test: default
On 2020/04/05 21:48:46, hanwenn wrote:
> if you do it like this, this should depend on
$(outdir)/book_base_test.py and
> the rule should use $< . Otherwise, editing the test file doesn't redo
the copy.

No, default depends on $(OUT_PY_MODULES). And we really need all modules
because book_base_test.py includes other files.

Description:
Install python modules from build directory

This solves issues when installing from a separate directory which was
broken after ab7a344f68 ("Cleanup python/ build rules."). Also avoid
__pycache__ in source directory from the test.

Please review this at https://codereview.appspot.com/575960043/

Affected files (+4, -5 lines):
  M make/lilypond-vars.make
  M python/GNUmakefile


Index: make/lilypond-vars.make
diff --git a/make/lilypond-vars.make b/make/lilypond-vars.make
index 
3f1e9926267c9c102e1607f57425548dfbddc39c..08a11483fa832b455955a8db2c781ade0595b712
 100644
--- a/make/lilypond-vars.make
+++ b/make/lilypond-vars.make
@@ -17,7 +17,7 @@ endif
 
 LANGS=$(shell $(PYTHON) $(top-src-dir)/python/langdefs.py)
 
-export PYTHONPATH:=$(top-src-dir)/python:$(PYTHONPATH)
+export PYTHONPATH:=$(top-build-dir)/python/$(outconfbase):$(PYTHONPATH)
 
 the-script-dir=$(wildcard $(script-dir))
 
Index: python/GNUmakefile
diff --git a/python/GNUmakefile b/python/GNUmakefile
index 
b541206df39ca35b1596867a104536727f0c79dd..7473d7ab9af7a41093d93216666f918f203045fb
 100644
--- a/python/GNUmakefile
+++ b/python/GNUmakefile
@@ -13,17 +13,16 @@ $(outdir)/%.py: %.py
        $(call ly_progress,Making,$@,(py compile))
        cp $< $@
        PYTHONOPTIMIZE= $(PYTHON) -c 'import py_compile; py_compile.compile 
("$@", doraise=True)'
-       chmod 755 $@
 
 default: $(OUT_PY_MODULES)
 
 INSTALLATION_OUT_SUFFIXES = 1 2
 
 INSTALLATION_OUT_DIR1=$(local_lilypond_datadir)/python
-INSTALLATION_OUT_FILES1=$(PY_MODULES_IN)
+INSTALLATION_OUT_FILES1=$(OUT_PY_MODULES)
 
 INSTALLATION_OUT_DIR2 = $(local_lilypond_datadir)/python/__pycache__
 INSTALLATION_OUT_FILES2 = $(wildcard $(outdir)/__pycache__/*.pyc)
 
-local-test: book_base_test.py
-       $(PYTHON) $<
+local-test: default
+       $(PYTHON) $(outdir)/book_base_test.py





reply via email to

[Prev in Thread] Current Thread [Next in Thread]