automake is really kind of terrible at python.
Filter the generated version.py out of the dist files so that builds from a dist tarball don't end up with a both a $srcdir and $builddir copy of version.py. Ignore a pylint error about importing version since version.py ends up in a different directory than the rest of the pyanaconda module. --- pyanaconda/Makefile.am | 6 +++++- pyanaconda/startup_utils.py | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/Makefile.am b/pyanaconda/Makefile.am index eeac1ae..2d48bd2 100644 --- a/pyanaconda/Makefile.am +++ b/pyanaconda/Makefile.am @@ -24,4 +24,8 @@ MAINTAINERCLEANFILES = Makefile.in # anaconda Python code pkgpyexecdir = $(pyexecdir)/py$(PACKAGE_NAME) anacondadir = $(pkgpyexecdir) -anaconda_PYTHON = $(sort $(wildcard $(srcdir)/*.py $(builddir)/version.py)) + +# Filter version.py out of the distributed python files since it will +# be generated by the configure script +anaconda_PYTHON = $(filter-out %/version.py,$(wildcard $(srcdir)/*.py)) +nodist_anaconda_PYTHON = $(builddir)/version.py diff --git a/pyanaconda/startup_utils.py b/pyanaconda/startup_utils.py index 1c04082..30d5974 100644 --- a/pyanaconda/startup_utils.py +++ b/pyanaconda/startup_utils.py @@ -70,7 +70,10 @@ def get_anaconda_version_string(): # non-necessary stuff; we also need to handle the possibility of the # import itself failing if module_exists("pyanaconda.version"): - from pyanaconda import version + # Ignore pylint not finding the version module, since thanks to automake + # there's a good chance that version.py is not in the same directory as + # the rest of pyanaconda. + from pyanaconda import version # pylint: disable=no-name-in-module return version.__version__ else: return "unknown"
automake is really kind of terrible at python.
Filter the generated version.py out of the dist files so that builds from a dist tarball don't end up with a both a $srcdir and $builddir copy of version.py. Ignore a pylint error about importing version since version.py ends up in a different directory than the rest of the pyanaconda module.
pyanaconda/Makefile.am | 6 +++++- pyanaconda/startup_utils.py | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-)
Fixes a problem I'm seeing in jenkins, so ACK.
- Chris
David Shea píše v Út 27. 05. 2014 v 11:31 -0400:
automake is really kind of terrible at python.
Filter the generated version.py out of the dist files so that builds from a dist tarball don't end up with a both a $srcdir and $builddir copy of version.py. Ignore a pylint error about importing version since version.py ends up in a different directory than the rest of the pyanaconda module.
pyanaconda/Makefile.am | 6 +++++- pyanaconda/startup_utils.py | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/Makefile.am b/pyanaconda/Makefile.am index eeac1ae..2d48bd2 100644 --- a/pyanaconda/Makefile.am +++ b/pyanaconda/Makefile.am @@ -24,4 +24,8 @@ MAINTAINERCLEANFILES = Makefile.in # anaconda Python code pkgpyexecdir = $(pyexecdir)/py$(PACKAGE_NAME) anacondadir = $(pkgpyexecdir) -anaconda_PYTHON = $(sort $(wildcard $(srcdir)/*.py $(builddir)/version.py))
+# Filter version.py out of the distributed python files since it will +# be generated by the configure script +anaconda_PYTHON = $(filter-out %/version.py,$(wildcard $(srcdir)/*.py)) +nodist_anaconda_PYTHON = $(builddir)/version.py diff --git a/pyanaconda/startup_utils.py b/pyanaconda/startup_utils.py index 1c04082..30d5974 100644 --- a/pyanaconda/startup_utils.py +++ b/pyanaconda/startup_utils.py @@ -70,7 +70,10 @@ def get_anaconda_version_string(): # non-necessary stuff; we also need to handle the possibility of the # import itself failing if module_exists("pyanaconda.version"):
from pyanaconda import version
# Ignore pylint not finding the version module, since thanks to automake# there's a good chance that version.py is not in the same directory as# the rest of pyanaconda. else: return "unknown"from pyanaconda import version # pylint: disable=no-name-in-module return version.__version__
Thanks for figuring out the automake magic! :)
anaconda-patches@lists.fedorahosted.org