Skip to content

Conversation

@mathdugre
Copy link

Closes #1239

@mathdugre
Copy link
Author

This is my initial attempt at adding the functionality to search by "most download".

Unfortunately, I could not run the dev environment to test, as I ran into this error:

invenio-cli check-requirements --development             (enh/enable-mostdl-search)zenodo-rdm

Checking pre-requirements...
Checking Python version...
Python version OK. Got 3.13.6.
Checking Pipenv is installed...
Traceback (most recent call last):
  File "/Users/mathdugre/.local/share/uv/tools/invenio-cli/lib/python3.13/site-packages/invenio_cli/commands/requirements.py", line 175, in check_pipenv_installed
    result = run_cmd(["pipenv", "--version"])
  File "/Users/mathdugre/.local/share/uv/tools/invenio-cli/lib/python3.13/site-packages/invenio_cli/helpers/process.py", line 35, in run_cmd
    p = popen(command, stdout=PIPE, stderr=PIPE)
  File "/Users/mathdugre/.local/share/uv/python/cpython-3.13.6-macos-aarch64-none/lib/python3.13/subprocess.py", line 1039, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                        pass_fds, cwd, env,
                        ^^^^^^^^^^^^^^^^^^^
    ...<5 lines>...
                        gid, gids, uid, umask,
                        ^^^^^^^^^^^^^^^^^^^^^^
                        start_new_session, process_group)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mathdugre/.local/share/uv/python/cpython-3.13.6-macos-aarch64-none/lib/python3.13/subprocess.py", line 1972, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'pipenv'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/mathdugre/.local/bin/invenio-cli", line 10, in <module>
    sys.exit(invenio_cli())
             ~~~~~~~~~~~^^
  File "/Users/mathdugre/.local/share/uv/tools/invenio-cli/lib/python3.13/site-packages/click/core.py", line 1485, in __call__
    return self.main(*args, **kwargs)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/Users/mathdugre/.local/share/uv/tools/invenio-cli/lib/python3.13/site-packages/click/core.py", line 1406, in main
    rv = self.invoke(ctx)
  File "/Users/mathdugre/.local/share/uv/tools/invenio-cli/lib/python3.13/site-packages/click/core.py", line 1873, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/Users/mathdugre/.local/share/uv/tools/invenio-cli/lib/python3.13/site-packages/click/core.py", line 1269, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mathdugre/.local/share/uv/tools/invenio-cli/lib/python3.13/site-packages/click/core.py", line 824, in invoke
    return callback(*args, **kwargs)
  File "/Users/mathdugre/.local/share/uv/tools/invenio-cli/lib/python3.13/site-packages/invenio_cli/cli/cli.py", line 72, in check_requirements
    run_steps(steps, on_fail, on_success)
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mathdugre/.local/share/uv/tools/invenio-cli/lib/python3.13/site-packages/invenio_cli/cli/utils.py", line 21, in run_steps
    response = step.execute()
  File "/Users/mathdugre/.local/share/uv/tools/invenio-cli/lib/python3.13/site-packages/invenio_cli/commands/steps.py", line 41, in execute
    response = self.func(**self.args)
  File "/Users/mathdugre/.local/share/uv/tools/invenio-cli/lib/python3.13/site-packages/invenio_cli/commands/requirements.py", line 191, in check_pipenv_installed
    error=f"Pipenv not found. Got {result.error}.", status_code=1
                                   ^^^^^^
UnboundLocalError: cannot access local variable 'result' where it is not associated with a value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add mostdownloaded as a sort option

1 participant