Conversation
|
I made a second commit because I used a less elegant approach in the first one (unpacking to a temporary directory). |
| CLI tool for downloading subtitles from napiprojekt.pl, fork of [gabrys/napi.py](https://github.com/gabrys/napi.py) | ||
|
|
||
| ## prerequisites | ||
| - Python 3.7 or newer |
There was a problem hiding this comment.
is it needed to drop support for 3.7 and 3.8?
There was a problem hiding this comment.
is it needed to drop support for 3.7 and 3.8?
I'm afraid so, because for py7zr version 1.0.0, the minimum required version is Python 3.9, and the maximum is Python 3.13 (planned support for 3.14).
| @@ -1,6 +1,6 @@ | |||
| [tool.poetry] | |||
| name = "napi-py" | |||
| version = "1.2.4" | |||
There was a problem hiding this comment.
if dropping the support is required, I think it should be 1.3.0
There was a problem hiding this comment.
if dropping the support is required, I think it should be 1.3.0
Yes, that makes sense, and you're right.
napi/read_7z.py
Outdated
| self._length = 0 | ||
| self._lock = threading.Lock() | ||
|
|
||
| def write(self, data: bytes) -> None: |
There was a problem hiding this comment.
linter complains about returning type None instead of int as required by interface
I think there's a bit more work to make this change working with tests passing etc, i.e.
- run
poetry updateand commit updated .lock file - make sure tests are passing through the means of
make testexecuted in projects directory - add all required changes to this PR
The implementation itself makes sense, so there's just some boilerplate needed around python tooling. I may help you with it or base off of your changes and do it on my own but again, my spare time is super limited so can't promise doing it any time soon
There was a problem hiding this comment.
As I mentioned when reporting the issue, I am not a Python expert. I admit that I did not perform exhaustive testing. I built a .whl package based on my commits and installed it locally using vevn. I have been using it for a few days instead of the old version, and everything seems to be working fine.
I will run poetry update and add a new poetry.lock. I will also try to run all the tests. I will try to do it myself, and if I have any problems, I will ask you for help. I just don't know when I'll have spare time - it might take me a while.
|
A new poetry.lock file has been generated. Unit tests passed. I built a .whl package and installed it locally - it seems to work correctly (I tried it on different subs, with different encodings). I tried to make various changes to pass the acceptance tests, but I didn't succeed (e.g., I added a User-Agent in api.py). I know your spare time is limited, but maybe you can find a moment to put me on the right track. Below are some of the test results: |
|
Hey, thanks for taking more time to figure out the PR! I can see that tests fail when run as a one session, however, when run individually, they're mostly passing. It seems that there's only one regression, for subtitles for movie hash
and checking stored subtitle file. I'm pretty sure it was re-encoding them fine in previous version so something's wrong with re-encoding logic. Also, current version of py7zr is yanked due to security issue https://pypi.org/project/py7zr/1.1.2/ I'm fine with former issue, not sure about the severity of the latter. Did not have enough time to debug why tests fail when run in a session, sorry. Will try to come back to this PR soon-ish |
In the new versions of Python (3.13 and 3.14) attempt to build pylzma ends with an error.
Replacing pylzma with py7zr should solve the problem.