Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests and fixes #8124

Merged
merged 22 commits into from
Sep 5, 2022
Merged

Tests and fixes #8124

merged 22 commits into from
Sep 5, 2022

Conversation

miigotu
Copy link
Contributor

@miigotu miigotu commented Aug 30, 2022

This should fix #8104 @kyuuk could you please test?

@miigotu
Copy link
Contributor Author

miigotu commented Aug 30, 2022

@miigotu miigotu force-pushed the tests branch 5 times, most recently from bb6a4fb to dd7953c Compare August 30, 2022 03:20
@lgtm-com
Copy link
Contributor

lgtm-com bot commented Aug 30, 2022

This pull request fixes 1 alert when merging 65f510d into bf7ca8b - view on LGTM.com

fixed alerts:

  • 1 for Testing equality to None

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Aug 31, 2022

This pull request fixes 1 alert when merging 933169a into b2b09e3 - view on LGTM.com

fixed alerts:

  • 1 for Testing equality to None

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Aug 31, 2022

This pull request fixes 2 alerts when merging 371a186 into 0c8d40a - view on LGTM.com

fixed alerts:

  • 1 for Testing equality to None
  • 1 for Except block handles 'BaseException'

@miigotu
Copy link
Contributor Author

miigotu commented Aug 31, 2022

This fixes #7978 for sure @Linden-Ryuujin (as long as you have one piece set as anime) but there are some other things in here we need to test, like that I got irritated with not being able to debug correctly and removed the poetry_install stuff lol

2022-08-31 02:57:17 DEBUG :: POSTPROCESSOR :: Starting new thread: POSTPROCESSOR
2022-08-31 02:57:17 INFO :: POSTPROCESSOR :: Auto post processing task for /home/miigotu/Projects/SickChill/op was added to the queue
2022-08-31 02:57:20 INFO :: POSTPROCESSOR-AUTO :: Beginning auto post processing task: /home/miigotu/Projects/SickChill/op
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Processing in folder /home/miigotu/Projects/SickChill/op
2022-08-31 02:57:20 INFO :: POSTPROCESSOR-AUTO :: Processing /home/miigotu/Projects/SickChill/op
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Processing folder /home/miigotu/Projects/SickChill/op
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Trying a new way to verify if we can parse this file
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Found episode by absolute number 1030 which is S21E139
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Converted parsed result [Judas] One Piece - 1030 into One Piece - S21E139 [ABS: [1030]] [ANIME VER: 1] [GROUP: Judas] [ABD: False] [ANIME: True] [whichReg: ['anime_bare']] Score: -13
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Parsed [Judas] One Piece - 1030.mkv into One Piece - S21E139 [ABS: [1030]] [ANIME VER: 1] [GROUP: Judas] [ABD: False] [ANIME: True] [whichReg: ['anime_bare']] Score: -13
2022-08-31 02:57:20 INFO :: POSTPROCESSOR-AUTO :: Processing /home/miigotu/Projects/SickChill/op/[Judas] One Piece - 1030.mkv (None)
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Analyzing name [Judas] One Piece - 1030.mkv
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Trying a new way to verify if we can parse this file
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Found episode by absolute number 1030 which is S21E139
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Converted parsed result [Judas] One Piece - 1030 into One Piece - S21E139 [ABS: [1030]] [ANIME VER: 1] [GROUP: Judas] [ABD: False] [ANIME: True] [whichReg: ['anime_bare']] Score: -13
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Parsed [Judas] One Piece - 1030 into One Piece - S21E139 [ABS: [1030]] [ANIME VER: 1] [GROUP: Judas] [ABD: False] [ANIME: True] [whichReg: ['anime_bare']] Score: -13
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Retrieving episode object for S21E139
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Looking up quality for name [Judas] One Piece - 1030, got Unknown
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Looking up quality for name op, got Unknown
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Looking up quality for name [Judas] One Piece - 1030.mkv, got Unknown
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Guessing quality for name [Judas] One Piece - 1030.mkv, got Unknown
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Quality of the episode we're processing: Unknown
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Is ep a priority download: False
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: There is no existing file so there's no worries about replacing it
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Trying to determine free space on the destination drive
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Setter sets location to 
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Found release name [Judas] One Piece - 1030
2022-08-31 02:57:20 INFO :: POSTPROCESSOR-AUTO :: Using release for release name.
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Parsed [Judas] One Piece - 1030 into One Piece - [ABS: [1030]] [ANIME VER: 1] [GROUP: Judas] [ABD: False] [ANIME: True] [whichReg: ['anime_bare']] Score: -13
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Episode has no release group, replacing it with 'Judas'
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: formatting pattern: %SN - S%0SE%0E - %EN -> One Piece - S21E139 - A Pledge for the New Genesis! Luffy and Uta!
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Parsed [Judas] One Piece - 1030 into One Piece - [ABS: [1030]] [ANIME VER: 1] [GROUP: Judas] [ABD: False] [ANIME: True] [whichReg: ['anime_bare']] Score: -13
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: formatting pattern: Season %0S -> Season 21
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Destination folder for this episode: /home/miigotu/Videos/Shows/One Piece/Season 21
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Checking if the path /home/miigotu/Videos/Shows/One Piece/Season 21 already exists
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Folder /home/miigotu/Videos/Shows/One Piece/Season 21/ didn't exist, creating it
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Copying file from /home/miigotu/Projects/SickChill/op/[Judas] One Piece - 1030.mkv to /home/miigotu/Videos/Shows/One Piece/Season 21/One Piece - S21E139 - A Pledge for the New Genesis! Luffy and Uta!.mkv
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Setter sets location to /home/miigotu/Videos/Shows/One Piece/Season 21/One Piece - S21E139 - A Pledge for the New Genesis! Luffy and Uta!.mkv
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Parsed /home/miigotu/Videos/Shows/One Piece/Season 21/One Piece - S21E139 - A Pledge for the New Genesis! Luffy and Uta! into Season - S21E139 [ABS: [0]] [ANIME VER: 1] [ABD: False] [ANIME: True] [whichReg: ['anime_and_normal', 'anime_bare']] Score: -17
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Parsed [Judas] One Piece - 1030 into One Piece - [ABS: [1030]] [ANIME VER: 1] [GROUP: Judas] [ABD: False] [ANIME: True] [whichReg: ['anime_bare']] Score: -13
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: formatting pattern: %SN - %Sx%0E - %EN - %QN -> One Piece - 21x139 - A Pledge for the New Genesis! Luffy and Uta! - Unknown
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Notification for NMJ scan update not enabled, skipping this notification
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Parsed /home/miigotu/Videos/Shows/One Piece/Season 21/One Piece - S21E139 - A Pledge for the New Genesis! Luffy and Uta! into Season - S21E139 [ABS: [0]] [ANIME VER: 1] [ABD: False] [ANIME: True] [whichReg: ['anime_and_normal', 'anime_bare']] Score: -17
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: Parsed [Judas] One Piece - 1030 into One Piece - [ABS: [1030]] [ANIME VER: 1] [GROUP: Judas] [ABD: False] [ANIME: True] [whichReg: ['anime_bare']] Score: -13
2022-08-31 02:57:20 DEBUG :: POSTPROCESSOR-AUTO :: formatting pattern: %SN - %Sx%0E - %EN - %QN -> One Piece - 21x139 - A Pledge for the New Genesis! Luffy and Uta! - Unknown
2022-08-31 02:57:20 INFO :: POSTPROCESSOR-AUTO :: Processing succeeded for /home/miigotu/Projects/SickChill/op/[Judas] One Piece - 1030.mkv
2022-08-31 02:57:20 INFO :: POSTPROCESSOR-AUTO :: Successfully processed
2022-08-31 02:57:20 INFO :: POSTPROCESSOR-AUTO :: Auto post processing task for /home/miigotu/Projects/SickChill/op completed

@@ -438,23 +439,20 @@ def already_processed(process_path, video_file, force, result):

# Needed if we have downloaded the same episode @ different quality
# But we need to make sure we check the history of the episode we're going to PP, and not others
try: # if it fails to find any info (because we're doing an unparsable folder (like the TV root dir) it will throw an exception, which we want to ignore
parse_result = NameParser(process_path, tryIndexers=True).parse(process_path)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BKSteve, no more spam to indexers =P

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Aug 31, 2022

This pull request fixes 2 alerts when merging f3e6d7c into 0c8d40a - view on LGTM.com

fixed alerts:

  • 1 for Testing equality to None
  • 1 for Except block handles 'BaseException'

@kyuuk
Copy link
Contributor

kyuuk commented Sep 1, 2022

This should fix #8104 @kyuuk could you please test?

yup, this got rid of the drv_libxml2 error, everything working fine

EDIT:

i was a little to quick on that
i got the error again on the develop image :/

2022-09-01 23:47:38 DEBUG :: SEARCHQUEUE-MANUAL-412374 :: [Nyaa] :: Data returned from provider does not contain any torrents
2022-09-01 23:47:38 DEBUG :: SEARCHQUEUE-MANUAL-412374 :: [Nyaa] :: RSS error: module 'drv_libxml2' has no attribute 'create_parser'
2022-09-01 23:47:38 DEBUG :: SEARCHQUEUE-MANUAL-412374 :: [Nyaa] :: GET URL: https://nyaa.si/?page=rss&c=1_0&s=id&o=desc&f=0&q=Yofukashi+no+Uta+009 [Status: 200]
2022-09-01 23:47:37 DEBUG :: SEARCHQUEUE-MANUAL-412374 :: [Nyaa] :: Search String: Yofukashi no Uta 009
2022-09-01 23:47:37 DEBUG :: SEARCHQUEUE-MANUAL-412374 :: [Nyaa] :: Data returned from provider does not contain any torrents
2022-09-01 23:47:37 DEBUG :: SEARCHQUEUE-MANUAL-412374 :: [Nyaa] :: RSS error: module 'drv_libxml2' has no attribute 'create_parser'
2022-09-01 23:47:37 DEBUG :: SEARCHQUEUE-MANUAL-412374 :: [Nyaa] :: GET URL: https://nyaa.si/?page=rss&c=1_0&s=id&o=desc&f=0&q=call+of+the+night+009 [Status: 200]
2022-09-01 23:47:37 DEBUG :: SEARCHQUEUE-MANUAL-412374 :: [Nyaa] :: Search String: call of the night 009
2022-09-01 23:47:37 DEBUG :: SEARCHQUEUE-MANUAL-412374 :: [Nyaa] :: Search Mode: Episode

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Sep 2, 2022

This pull request fixes 2 alerts when merging 1c72d67 into 32108d7 - view on LGTM.com

fixed alerts:

  • 1 for Testing equality to None
  • 1 for Except block handles 'BaseException'

@BKSteve
Copy link
Collaborator

BKSteve commented Sep 2, 2022

The Nyaa site isn't getting size seeders and leechers info.
nyaa.py (break point line 56) data =
{'title': '[Erai-raws] Sekai no Owari ni Shiba Inu to - 16 [720p] [ENG]', 'link': 'https://nyaa.si/download/1571869.torrent', 'size': -1, 'seeders': None, 'leechers': None}

but site https://nyaa.si/?page=rss&c=1_0&s=id&o=desc&f=2&q=Sekai+no+Owari+ni+Shiba+Inu+to+16 using same string provides

<title>[Erai-raws] Sekai no Owari ni Shiba Inu to - 16 [720p] [ENG]</title>
<link>https://nyaa.si/download/1571869.torrent</link>
<guid isPermaLink="true">https://nyaa.si/view/1571869</guid>
<pubDate>Sun, 28 Aug 2022 11:37:30 -0000</pubDate>
<nyaa:seeders>16</nyaa:seeders>
<nyaa:leechers>0</nyaa:leechers>
<nyaa:downloads>227</nyaa:downloads>
<nyaa:infoHash>c8a7a3d8ab21a2a822dedb3f8cdfcce0c3b12caa</nyaa:infoHash>
<nyaa:categoryId>1_2</nyaa:categoryId>
<nyaa:category>Anime - English-translated</nyaa:category>
<nyaa:size>7.8 MiB</nyaa:size>
...

don't know enough / no time ATM to track this down the filtering of one to the other.

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Sep 3, 2022

This pull request fixes 2 alerts when merging c5f2d52 into 57da5c4 - view on LGTM.com

fixed alerts:

  • 1 for Testing equality to None
  • 1 for Except block handles 'BaseException'

@miigotu
Copy link
Contributor Author

miigotu commented Sep 3, 2022

The Nyaa site isn't getting size seeders and leechers info. nyaa.py (break point line 56) data = {'title': '[Erai-raws] Sekai no Owari ni Shiba Inu to - 16 [720p] [ENG]', 'link': 'https://nyaa.si/download/1571869.torrent', 'size': -1, 'seeders': None, 'leechers': None}

but site https://nyaa.si/?page=rss&c=1_0&s=id&o=desc&f=2&q=Sekai+no+Owari+ni+Shiba+Inu+to+16 using same string provides

<title>[Erai-raws] Sekai no Owari ni Shiba Inu to - 16 [720p] [ENG]</title>
<link>https://nyaa.si/download/1571869.torrent</link>
<guid isPermaLink="true">https://nyaa.si/view/1571869</guid>
<pubDate>Sun, 28 Aug 2022 11:37:30 -0000</pubDate>
<nyaa:seeders>16</nyaa:seeders>
<nyaa:leechers>0</nyaa:leechers>
<nyaa:downloads>227</nyaa:downloads>
<nyaa:infoHash>c8a7a3d8ab21a2a822dedb3f8cdfcce0c3b12caa</nyaa:infoHash>
<nyaa:categoryId>1_2</nyaa:categoryId>
<nyaa:category>Anime - English-translated</nyaa:category>
<nyaa:size>7.8 MiB</nyaa:size>
...

don't know enough / no time ATM to track this down the filtering of one to the other.

Fixed in 0fde830

Signed-off-by: miigotu <miigotu@gmail.com>
Signed-off-by: miigotu <miigotu@gmail.com>
…foreign languages. Default is the|a|an, but for example spanish would be "un|una|el|la|los|las"

Can be set in config->general or under the Localization domain in the config.ini
Fixes #8081

Signed-off-by: miigotu <miigotu@gmail.com>
…r result for anime

Signed-off-by: miigotu <miigotu@gmail.com>
…d hackiness for it. Guides need updated to instruct people how to install dependencies!

Signed-off-by: miigotu <miigotu@gmail.com>
…file, first parse it with guessit and see if we can find the show to match it to. If so, we know to only use anime regexes or regular regexes. Fallback to old way otherwise.

Fix up some logging in post processor and processTV

Signed-off-by: miigotu <miigotu@gmail.com>
…odd poetry-date-version-plugin references from their source

Signed-off-by: miigotu <miigotu@gmail.com>
Signed-off-by: miigotu <miigotu@gmail.com>
@lgtm-com
Copy link
Contributor

lgtm-com bot commented Sep 3, 2022

This pull request fixes 2 alerts when merging e12ce20 into 57da5c4 - view on LGTM.com

fixed alerts:

  • 1 for Testing equality to None
  • 1 for Except block handles 'BaseException'

@ghost
Copy link

ghost commented Sep 3, 2022

Current problem is that poetry install right now only works on 1.2.0. To use 1.1.4 I have to change the name of the header for dev dependencies in pyproject.toml. Maybe the old tag is backwards compatible idk.

Not going to lie I'm struggling to launch sickchill with poetry on Win11 with virtualenv
Not everything seems accurate there (ps script for example)
https://python-poetry.org/docs/#installing-with-the-official-installer
https://python-poetry.org/docs/#installing-manually

What I had to do on linux (had issue with python3-poetry (1.12) and pip3 install as root wants to uninstall packages) with venv:

python3 -m venv .venv
source .venv/bin/activate
pip3 install -U pip setuptools
pip3 install poetry
poetry install --no-root
poetry run python3 SickChill.py
> No module named 'html5lib'
pip3 install html5lib
poetry run python3 SickChill.py

on Windows11 with python3.10 from MS store it need to run with .venv\Scripts\python

python3 -m venv .venv
.venv\Scripts\Activate.ps1
pip3 install poetry
poetry install --no-root
poetry run .venv\Scripts\python SickChill.py
> No module named 'html5lib'
pip3 install html5lib
poetry run .venv\Scripts\python SickChill.py

this is not working for windows with python from MS store, many PATH issues,
Works with a python install from python.org.

# for git install
pip3 install -U "poetry>=1.2.0"
poetry install
poetry run SickChill

#for pip install
pip install -U sickchill
SickChill

@miigotu
Copy link
Contributor Author

miigotu commented Sep 3, 2022

html5lib isn't supposed to be required though. We need to use a try/except to allow it of it's there and ignore it if it isn't. I thought I had caught all the places for that. You are doing this with the tests branch right?

@miigotu
Copy link
Contributor Author

miigotu commented Sep 3, 2022

@pigsyn I just checked, and it does say "No module named 'html5lib'" but it starts and runs anyway right after that

image

@miigotu
Copy link
Contributor Author

miigotu commented Sep 4, 2022

@pigsyn aha, I found that poetry itself wants html5lib lol
image

#This reinstalls html5lib
pip install "poetry>=1.2.0"

Signed-off-by: miigotu <miigotu@gmail.com>
…n rss searches

Signed-off-by: miigotu <miigotu@gmail.com>
… think

Signed-off-by: miigotu <miigotu@gmail.com>
@lgtm-com
Copy link
Contributor

lgtm-com bot commented Sep 4, 2022

This pull request fixes 3 alerts when merging 24102cf into 57da5c4 - view on LGTM.com

fixed alerts:

  • 1 for Testing equality to None
  • 1 for Unused local variable
  • 1 for Except block handles 'BaseException'

Signed-off-by: miigotu <miigotu@gmail.com>
@lgtm-com
Copy link
Contributor

lgtm-com bot commented Sep 5, 2022

This pull request fixes 3 alerts when merging 5737f5e into 57da5c4 - view on LGTM.com

fixed alerts:

  • 1 for Testing equality to None
  • 1 for Unused local variable
  • 1 for Except block handles 'BaseException'

@miigotu miigotu merged commit 4c50ad3 into develop Sep 5, 2022
@miigotu miigotu deleted the tests branch September 5, 2022 03:04
@BKSteve
Copy link
Collaborator

BKSteve commented Sep 11, 2022

Looking into errors on Syno box with latest develop.
When switching from master to develop I'm now getting this error.

This looks to be the cause:
File "/volume1/@appstore/sickchill/share/SickChill/sickchill/init_helpers.py", line 156, in get_current_version result = subprocess.run(["poetry", "version", "-s"], capture_output=True, text=True)

The env is correct location and .venv doesn't exist, all packages in correct location.

2022-09-11 15:30:08 DEBUG :: CHECKVERSION :: Branch checkout: master->develop
2022-09-11 15:30:08 DEBUG :: CHECKVERSION :: check_for_new_news: Checking GitHub for latest news.
2022-09-11 15:30:28 DEBUG :: WEBSERVER-HOME_0 :: cur_commit = ebf2dcd109b246bd6e7f582786b7c2a446c39b99, newest_commit = 67bc45427c2ad1c6bd396d91c4e69f07c022a06d, num_commits_behind = 326
2022-09-11 15:30:28 DEBUG :: WEBSERVER-HOME_0 :: Branch checkout: master->develop
2022-09-11 15:30:28 INFO :: WEBSERVER-HOME_0 :: Creating update folder /volume1/@appdata/sickchill/data/sc-update before extracting
2022-09-11 15:30:28 INFO :: WEBSERVER-HOME_0 :: Downloading update from https://github.com/SickChill/SickChill/tarball/develop
2022-09-11 15:30:33 INFO :: WEBSERVER-HOME_0 :: Extracting file /volume1/@appdata/sickchill/data/sc-update/sc-update.tar
2022-09-11 15:30:36 INFO :: WEBSERVER-HOME_0 :: Deleting file /volume1/@appdata/sickchill/data/sc-update/sc-update.tar
2022-09-11 15:30:36 INFO :: WEBSERVER-HOME_0 :: Moving files from /volume1/@appdata/sickchill/data/sc-update/SickChill-SickChill-67bc454 to /volume1/@appstore/sickchill/share/SickChill

cut the standard lines

2022-09-11 15:30:39 INFO :: EVENT-QUEUE :: Shutting down Tornado
2022-09-11 15:30:49 INFO :: EVENT-QUEUE :: Restarting SickChill with ['/volume1/@appstore/sickchill/env/bin/python3', '/volume1/@appstore/sickchill/share/SickChill/SickChill.py', '--config', '/volume1/@appdata/sickchill/data/config.ini', '--datadir', '/volume1/@appdata/sickchill/data', '--nolaunch']
Traceback (most recent call last):
  File "/volume1/@appstore/sickchill/share/SickChill/SickChill.py", line 14, in <module>
    import sickchill.start
  File "/volume1/@appstore/sickchill/share/SickChill/sickchill/__init__.py", line 5, in <module>
    from .show.indexers import indexer, ShowIndexer
  File "/volume1/@appstore/sickchill/share/SickChill/sickchill/show/indexers/__init__.py", line 1, in <module>
    from .handler import ShowIndexer
  File "/volume1/@appstore/sickchill/share/SickChill/sickchill/show/indexers/handler.py", line 3, in <module>
    from sickchill import logger, settings
  File "/volume1/@appstore/sickchill/share/SickChill/sickchill/logger.py", line 15, in <module>
    from sickchill import settings
  File "/volume1/@appstore/sickchill/share/SickChill/sickchill/settings.py", line 7, in <module>
    from sickchill.oldbeard.common import SD
  File "/volume1/@appstore/sickchill/share/SickChill/sickchill/oldbeard/common.py", line 20, in <module>
    version=get_current_version(), os=platform.system(), architecture=platform.machine(), os_version=platform.release(), instance=INSTANCE_ID
  File "/volume1/@appstore/sickchill/share/SickChill/sickchill/init_helpers.py", line 156, in get_current_version
    result = subprocess.run(["poetry", "version", "-s"], capture_output=True, text=True)
  File "/var/packages/python38/target/lib/python3.8/subprocess.py", line 493, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/var/packages/python38/target/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/var/packages/python38/target/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'poetry'

Poetry is installed under /volume1/@appstore/sickchill/env/bin/poetry and package here /volume1/@appstore/sickchill/env/lib/python3.8/site-packages/ but doesn't want to be found.
Also installed as part of Python38 package /volume1/@appstore/python38/poetry

Suggestions or things I need to check?

@ghost
Copy link

ghost commented Sep 11, 2022

2022-09-11 15:30:49 INFO :: EVENT-QUEUE :: Restarting SickChill with ['/volume1/@appstore/sickchill/env/bin/python3', '/volume1/@appstore/sickchill/share/SickChill/SickChill.py', '--config', '/volume1/@appdata/sickchill/data/config.ini', '--datadir', '/volume1/@appdata/sickchill/data', '--nolaunch']
FileNotFoundError: [Errno 2] No such file or directory: 'poetry'

I had this subprocess and no such file error when I tried to start develop with systemctl without using poetry, I'll recheck
It works from cli with python but not as service

@BKSteve
Copy link
Collaborator

BKSteve commented Sep 11, 2022

I put the `shell=True' in line 156 and it can run

result = subprocess.run(["poetry", "version", "-s"], shell=True, capture_output=True, text=True)

@ghost
Copy link

ghost commented Sep 11, 2022

It's the same on ubuntu

sickchill@ubuntu:/opt/sickchill$ /opt/sickchill/.venv/bin/python3.8 /opt/sickchill/SickChill.py --datadir=/opt/sickchill
Traceback (most recent call last):
  File "/opt/sickchill/SickChill.py", line 14, in <module>
    import sickchill.start
  File "/opt/sickchill/sickchill/__init__.py", line 5, in <module>
    from .show.indexers import indexer, ShowIndexer
  File "/opt/sickchill/sickchill/show/indexers/__init__.py", line 1, in <module>
    from .handler import ShowIndexer
  File "/opt/sickchill/sickchill/show/indexers/handler.py", line 3, in <module>
    from sickchill import logger, settings
  File "/opt/sickchill/sickchill/logger.py", line 15, in <module>
    from sickchill import settings
  File "/opt/sickchill/sickchill/settings.py", line 7, in <module>
    from sickchill.oldbeard.common import SD
  File "/opt/sickchill/sickchill/oldbeard/common.py", line 20, in <module>
    version=get_current_version(), os=platform.system(), architecture=platform.machine(), os_version=platform.release(), instance=INSTANCE_ID
  File "/opt/sickchill/sickchill/init_helpers.py", line 156, in get_current_version
    result = subprocess.run(["poetry", "version", "-s"], capture_output=True, text=True)
  File "/usr/lib/python3.8/subprocess.py", line 493, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'poetry'

Works if you activate venv and pip install poetry_date_version_plugin
/opt/sickchill/.venv/bin/python3.8 -m poetry run /opt/sickchill/SickChill.py --datadir=/opt/sickchill
or
/opt/sickchill/.venv/bin/poetry run SickChill --datadir=/opt/sickchill

But maybe it's an issue ?
Could not run Systemd Unit like sickchill is started in containers, going to recheck for subprocess

@BKSteve
Copy link
Collaborator

BKSteve commented Sep 11, 2022

Yes. On DSM I installed the poetry_date_version_plugin leaving only adding shell to get it running

@miigotu
Copy link
Contributor Author

miigotu commented Sep 12, 2022

I'll make some commits hopefully tomorrow

@miigotu
Copy link
Contributor Author

miigotu commented Sep 12, 2022

@BKSteve the syno package needs updated to use a pip install. The git updater and source updater are being removed. Tired of taking bandaids off one by one, may as well break everything that needs broken all at once so this is hopefully the last time. We will only be checking the importlib.metadata (as designed by standard python practice) for versioning, which requires the package to actually be installed.

Switching between master and develop will be handled by running for example SickChill, or SickChill-develop, they will be packaged separately on pypi.

Syno is the last package still using a source install or git install. We need a unified install method.

@BKSteve
Copy link
Collaborator

BKSteve commented Sep 12, 2022

@miigotu yes it will need an update.
Waiting till the bandaids are off and dried out a little. SPK building is in itself a fun subject.

The above was to just get the current way working.

@miigotu
Copy link
Contributor Author

miigotu commented Sep 12, 2022

It's not going to self update anymore after the next release to master until the syno package is reworked, but maybe that's ok. I loathe the self updating anyway, if someone has pip they should be able to sudo -U sc-sickchill; pip install -U sickchill or whatever. A notification of a new version is much safer and overall more reliable to not break people's stuff.

@miigotu
Copy link
Contributor Author

miigotu commented Sep 12, 2022

Maybe the syno package itself should be rebuilt for each SC release, with the package version set as the SC version and the SC from pypi pinned to the version, so the update shows in the syno package manager instead.

I could automatically check out the syno package source and edit it in GitHub actions maybe, and make a PR to synocommunity on each release. It's just 2 sed or tee lines once the package is set up for that.

@BKSteve
Copy link
Collaborator

BKSteve commented Sep 12, 2022

Once I've finished the get SC on DSM step by step I'll work on it.

@miigotu
Copy link
Contributor Author

miigotu commented Sep 12, 2022

Once I've finished the get SC on DSM step by step I'll work on it.

I'll help with it also, sync your synocommunity fork and open a PR to your own fork and tag me. Once we get it nice we can change the target of the PR to synocommunity to get it merged. This is a high priority item, before I release develop.

@BKSteve BKSteve mentioned this pull request Oct 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants