]> git.ipfire.org Git - location/libloc.git/commitdiff
Make sources around that we can run tests without location installed
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 14 Apr 2022 18:31:56 +0000 (18:31 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 14 Apr 2022 18:35:03 +0000 (18:35 +0000)
In order to run the test suite, we need to make the Python module
loadable from the build directory so that we first of all test the right
code and that it just works without running "make install" first.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
12 files changed:
.gitignore
Makefile.am
po/POTFILES.in
src/python/location/__init__.py [moved from src/python/__init__.py.in with 98% similarity]
src/python/location/database.py [moved from src/python/database.py with 100% similarity]
src/python/location/downloader.py [moved from src/python/downloader.py with 100% similarity]
src/python/location/export.py [moved from src/python/export.py with 100% similarity]
src/python/location/i18n.py [moved from src/python/i18n.py with 100% similarity]
src/python/location/importer.py [moved from src/python/importer.py with 100% similarity]
src/python/location/logger.py [moved from src/python/logger.py with 100% similarity]
src/scripts/location-importer.in [moved from src/python/location-importer.in with 100% similarity]
src/scripts/location.in [moved from src/python/location.in with 100% similarity]

index f04b70ebc548c037bcc8820dafdbc9cb87f26cdd..20bc895a3751ee25bbf72c8cd6f6a6c48cd1b3cb 100644 (file)
@@ -15,9 +15,8 @@ Makefile.in
 /*.db.xz
 /libtool
 /stamp-h1
-/src/python/location
-/src/python/location-importer
-/src/python/__init__.py
+/src/scripts/location
+/src/scripts/location-importer
 /src/systemd/location-update.service
 /src/systemd/location-update.timer
 /test.db
index 983cb4a59ddea26dd17dd69d185568e8af9cdd3e..38ce961a0964fdd25c0ca311ddf567f87dc97ea1 100644 (file)
@@ -175,21 +175,13 @@ CLEANFILES += \
        src/libloc.pc
 
 dist_pkgpython_PYTHON = \
-       src/python/database.py \
-       src/python/downloader.py \
-       src/python/export.py \
-       src/python/i18n.py \
-       src/python/importer.py \
-       src/python/logger.py
-
-pkgpython_PYTHON = \
-       src/python/__init__.py
-
-EXTRA_DIST += \
-       src/python/__init__.py.in
-
-CLEANFILES += \
-       src/python/__init__.py
+       src/python/location/__init__.py \
+       src/python/location/database.py \
+       src/python/location/downloader.py \
+       src/python/location/export.py \
+       src/python/location/i18n.py \
+       src/python/location/importer.py \
+       src/python/location/logger.py
 
 pyexec_LTLIBRARIES = \
        src/python/_location.la
@@ -275,16 +267,16 @@ uninstall-perl:
                $(DESTDIR)/$(prefix)/man/man3/Location.3pm
 
 bin_SCRIPTS = \
-       src/python/location \
-       src/python/location-importer
+       src/scripts/location \
+       src/scripts/location-importer
 
 EXTRA_DIST += \
-       src/python/location.in \
-       src/python/location-importer.in
+       src/scripts/location.in \
+       src/scripts/location-importer.in
 
 CLEANFILES += \
-       src/python/location \
-       src/python/location-importer
+       src/scripts/location \
+       src/scripts/location-importer
 
 # ------------------------------------------------------------------------------
 
@@ -321,6 +313,7 @@ TESTS_LDADD = \
        src/libloc-internal.la
 
 TESTS_ENVIRONMENT = \
+       PYTHONPATH=$(abs_srcdir)/src/python:$(abs_builddir)/src/python/.libs \
        TEST_DATA_DIR="$(abs_top_srcdir)/tests/data"
 
 TESTS = \
@@ -334,7 +327,7 @@ CLEANFILES += \
        testdata.db
 
 testdata.db: examples/python/create-database.py
-       PYTHONPATH=$(abs_builddir)/src/python/.libs \
+       PYTHONPATH=$(abs_srcdir)/src/python:$(abs_builddir)/src/python/.libs \
        ABS_SRCDIR="$(abs_srcdir)" \
                $(PYTHON) $< $@
 
index 5d2cc46cb74d6df89279de9d4852223d70c136e6..5f5afa8c7fa00748249f82551b517d392bb05a77 100644 (file)
@@ -1,12 +1,12 @@
 src/libloc.pc.in
-src/python/__init__.py.in
-src/python/database.py
-src/python/downloader.py
-src/python/export.py
-src/python/i18n.py
-src/python/importer.py
-src/python/location-importer.in
-src/python/location.in
-src/python/logger.py
+src/python/location/__init__.py
+src/python/location/database.py
+src/python/location/downloader.py
+src/python/location/export.py
+src/python/location/i18n.py
+src/python/location/importer.py
+src/python/location/logger.py
+src/scripts/location-importer.in
+src/scripts/location.in
 src/systemd/location-update.service.in
 src/systemd/location-update.timer.in
similarity index 98%
rename from src/python/__init__.py.in
rename to src/python/location/__init__.py
index bd94d3555b51fbf4e0645572cada7bafa859c438..9b570c797c552ecf151e451de2b560980a4b27d3 100644 (file)
@@ -17,8 +17,6 @@
 #                                                                             #
 ###############################################################################
 
-__version__ = "@VERSION@"
-
 # Import everything from the C module
 from _location import *