Skip to content

Support for absolute paths for --qleverfile #292

Description

@ludovicm67

Description

I tried to call qlever --qleverfile /some/absolute/path/Qleverfile index and I got the following error:

Command: index

An unexpected error occurred: Non-relative patterns are unsupported

Traceback (most recent call last):
  File "/opt/pipx/venvs/qlever/lib/python3.12/site-packages/qlever/qlever_main.py", line 38, in main
    command_successful = command_object.execute(args)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/pipx/venvs/qlever/lib/python3.12/site-packages/qlever/commands/index.py", line 253, in execute
    total_file_size = get_total_file_size(shlex.split(args.input_files))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/pipx/venvs/qlever/lib/python3.12/site-packages/qlever/util.py", line 37, in get_total_file_size
    for file in search_dir.glob(pattern):
  File "/usr/lib/python3.12/pathlib.py", line 1092, in glob
    raise NotImplementedError("Non-relative patterns are unsupported")
NotImplementedError: Non-relative patterns are unsupported

I also tried using ../path/Qlerverfile and got the same issue.

Why?

This could be useful if the Qleverfile is stored along other Qleverfiles outside the current working directory (or its children).

Something to consider

Some paths in the Qleverfile that might not be absolute (index.CAT_INPUT_FILES, index.INPUT_FILES, …).
It might be good to be able to be able to configure if they would need to be resolved based on the location of the Qleverfile or from the current working directory, through an option for example?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions