Taxel / PlexTraktSync

A python script that syncs the movies, shows and ratings between trakt and Plex (without needing a PlexPass or Trakt VIP subscription)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No such command 'self-update'

downey-lv opened this issue · comments

Confirmation

  • I have read the README.md on the project homepage
  • I have checked if identical issue already exists
  • I have tried downgrading to find version that can be used as a workaround

The problem

self-update missing from the package since 0.22.3. Doesn't show up in --help either

When downgraded to 0.22.3 the command exists but throws a permission error for me, pipx upgrade PlexTraktSync works fine. Might be just an issue for me or I'm assuming that's the reason why the command was removed. Probably just an update to README.md to just contain pipx upgrade needed then?

Error trace / logs

C:\Users\user>plextraktsync self-update
Usage: plextraktsync [OPTIONS] COMMAND [ARGS]...
Try 'plextraktsync --help' for help.

Error: No such command 'self-update'.

Expected behavior

Runs the pipx upgrade command

Steps to reproduce the behavior

plextraktsync self-update

Inspect of problematic items

No response

Workarounds

plextraktsync 0.22.3 was the latest that the command existed

Install method

pipx

Config file contents

No response

Version

0.25.16

Python Version

3.9.7

Operating System and Version

Windows 11

the command is enabled if detects it's pipx installed:

  • if factory.enable_self_update:
    cli.add_command(self_update)

  • @cached_property
    def enable_self_update(self):
    from plextraktsync.util.packaging import pipx_installed, program_name
    package = pipx_installed(program_name())
    return package is not None

  • def program_name():
    """
    Return current program name:
    - pipx: plextraktsync
    - pipx for pr 1000: plextraktsync@1000
    """
    import sys
    from os.path import basename
    return basename(sys.argv[0])

  • def pipx_installed(package: str):
    try:
    output = execx("pipx list --json")
    except FileNotFoundError:
    return None
    if not output:
    return None
    try:
    install_data = json.loads(output)
    except JSONDecodeError:
    return None
    if install_data is None:
    return None
    try:
    package = install_data["venvs"][package]["metadata"]["main_package"]
    except KeyError:
    return None
    return package

could be that program_name is incorrect or your pipx output changed, what is your pipx version?

start with pipx list output:

➜ pipx list --json | jq '.venvs|keys'  
[
  "cdhist",
  "plextraktsync",
  "plextraktsync@1404",
  "wssh"
]

I was on pipx 1.0 tried 1.2, but no changes

pipx list --json shows the package just fine
image

I tried running pipx_installed in Python console and it seems to run just fine
image

Also tried reinstalling pipx and PlexTraktSync, but also no changes

so, it's program_name probably incorrect, the only thing you didn't check

@downey-lv can you debug what's program_name in your system?

reporter dis-appeared. closing