- name: Prepare import environment
run: |
mv Nominatim/test/testdb/apidb-test-data.pbf test.pbf
- mv Nominatim/settings/flex-base.lua flex-base.lua
- mv Nominatim/settings/import-extratags.lua import-extratags.lua
- mv Nominatim/settings/taginfo.lua taginfo.lua
rm -rf Nominatim
mkdir data-env-reverse
working-directory: /home/nominatim
working-directory: /home/nominatim/nominatim-project
- name: Print taginfo
- run: lua taginfo.lua
+ run: lua ./nominatim-venv/lib/*/site-packages/nominatim_db/resources/lib-lua/taginfo.lua
working-directory: /home/nominatim
- name: Collect host OS information
function osm2pgsql.define_table(...) end
-- provide path to flex-style lua file
-flex = require('import-extratags')
+package.path = arg[0]:match("(.*/)") .. "?.lua;" .. package.path
+local flex = require('import-extratags')
local json = require ('dkjson')
DATA_DIR = None
SQLLIB_DIR = None
+LUALIB_DIR = None
CONFIG_DIR = (Path(__file__) / '..' / 'resources' / 'settings').resolve()
DATA_DIR = (Path(__file__) / '..' / 'resources').resolve()
SQLLIB_DIR = (DATA_DIR / 'lib-sql')
+LUALIB_DIR = (DATA_DIR / 'lib-lua')
CONFIG_DIR = (DATA_DIR / 'settings')
--- /dev/null
+../../lib-lua
\ No newline at end of file
"src/nominatim_db",
"scripts",
"lib-sql/**/*.sql",
+ "lib-lua/**/*.lua",
"settings",
"data/words.sql",
"extra_src/nominatim_db/paths.py"
[tool.hatch.build.targets.wheel.force-include]
"lib-sql" = "nominatim_db/resources/lib-sql"
+"lib-lua" = "nominatim_db/resources/lib-lua"
"settings" = "nominatim_db/resources/settings"
"data/country_osm_grid.sql.gz" = "nominatim_db/resources/country_osm_grid.sql.gz"
"data/words.sql" = "nominatim_db/resources/words.sql"
return dict(osm2pgsql=self.config.OSM2PGSQL_BINARY or self.config.lib_dir.osm2pgsql,
osm2pgsql_cache=self.osm2pgsql_cache or default_cache,
osm2pgsql_style=self.config.get_import_style_file(),
- osm2pgsql_style_path=self.config.config_dir,
+ osm2pgsql_style_path=self.config.lib_dir.lua,
threads=self.threads or default_threads,
dsn=self.config.get_libpq_dsn(),
flatnode_file=str(self.config.get_path('FLATNODE_FILE') or ''),
class _LibDirs:
osm2pgsql: Path
sql = paths.SQLLIB_DIR
+ lua = paths.LUALIB_DIR
data = paths.DATA_DIR
self.lib_dir = _LibDirs()
style = getattr(self, 'IMPORT_STYLE')
if style in ('admin', 'street', 'address', 'full', 'extratags'):
- return self.config_dir / f'import-{style}.lua'
+ return self.lib_dir.lua / f'import-{style}.lua'
return self.find_config_file('', 'IMPORT_STYLE')
from pathlib import Path
SQLLIB_DIR = (Path(__file__) / '..' / '..' / '..' / 'lib-sql').resolve()
+LUALIB_DIR = (Path(__file__) / '..' / '..' / '..' / 'lib-lua').resolve()
DATA_DIR = (Path(__file__) / '..' / '..' / '..' / 'data').resolve()
CONFIG_DIR = (Path(__file__) / '..' / '..' / '..' / 'settings').resolve()
osm2pgsql='osm2pgsql',
osm2pgsql_cache=50,
osm2pgsql_style=str(nominatim_env.get_test_config().get_import_style_file()),
- osm2pgsql_style_path=nominatim_env.get_test_config().config_dir,
+ osm2pgsql_style_path=nominatim_env.get_test_config().lib_dir.lua,
threads=1,
dsn=nominatim_env.get_libpq_dsn(),
flatnode_file='',
monkeypatch.setenv('NOMINATIM_IMPORT_STYLE', 'street')
- expected = src_dir / 'settings' / 'import-street.lua'
+ expected = src_dir / 'lib-lua' / 'import-street.lua'
assert config.get_import_style_file() == expected