Skip to content

Packages with wrong case can upset wajig new #25

@eddelbuettel

Description

@eddelbuettel

Setting up a new machine, I add an sources entry from a one-off PPA I keep for rstudio / posit produces (see here for its code but I sadly cannot host it on GH for size reasons). The Quarto package announces itself with a capital Q, and it turns out that wajig new then stumbles.

One can simulate that easy enough by hand-editing Quarto into a New file in wajig's state diretory:

$ wajig new
Traceback (most recent call last):
  File "/usr/bin/wajig", line 33, in <module>
    sys.exit(load_entry_point('wajig==4.1.3', 'console_scripts', 'wajig')())
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/wajig/__init__.py", line 1286, in main
    result.func(result)
    ~~~~~~~~~~~^^^^^^^^
  File "/usr/lib/python3/dist-packages/wajig/commands.py", line 814, in new
    util.newly_available(args.verbose)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/wajig/util.py", line 199, in newly_available
    do_describe([package.strip() for package in packages], die=False)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/wajig/util.py", line 414, in do_describe
    packageversion = package.installed
                     ^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'installed'
$ 

Switching to quarto works. So we need a 'tolower' there. If you want I get try to cook up a PR.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions