Bug 50120 - missing runtime dependency on requests
Summary: missing runtime dependency on requests
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: python3-module-pooch (show other bugs)
Version: unstable
Hardware: x86_64 Linux
: P5 normal
Assignee: Yuri N. Sedunov
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-22 19:41 MSK by Stanislav Levin
Modified: 2024-04-22 20:46 MSK (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stanislav Levin 2024-04-22 19:41:31 MSK
```console
[user@host dir]$ python3 -c "import pooch; pooch.retrieve('https://raw.githubusercontent.com/scipy/dataset-ascent/main/ascent.dat', known_hash='03ce124c1afc880f87b55f6b061110e2e1e939679184f5614e38dacc6c1957e2')"
```

Actual result:
```
Downloading data from 'https://raw.githubusercontent.com/scipy/dataset-ascent/main/ascent.dat' to file '/usr/src/.cache/pooch/a054439914b0bb9423fcdf06445c6c08-ascent.dat'.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/site-packages/pooch/core.py", line 239, in retrieve
    stream_download(url, full_path, known_hash, downloader, pooch=None)
  File "/usr/lib/python3/site-packages/pooch/core.py", line 794, in stream_download
    import requests.exceptions  # pylint: disable=C0415
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'requests'
```

Expected result:
dowloaded data file
Comment 1 Yuri N. Sedunov 2024-04-22 19:46:29 MSK
(Ответ для Stanislav Levin на комментарий #0)
...
>   File "/usr/lib/python3/site-packages/pooch/core.py", line 794, in
> stream_download
>     import requests.exceptions  # pylint: disable=C0415
                                  ^^^^^^^^^^^^^^^^^^^^^^^ 
Это надо вешать на rpm-build-python3, который, видимо, не справляется с комментарием в конце строки.
Comment 2 Stanislav Levin 2024-04-22 20:07:18 MSK
Это не так, импорт вложенный, поэтому в slight:
[user@host python3-module-pooch]$ RPM_PYTHON3_IMPORT_PATH=$(pwd) RPM_BUILD_ROOT=$(pwd) RPM_PYTHON3_REQ_METHOD=slight /usr/lib/rpm/python3.req pooch/pooch/downloaders.py 2>&1 | grep requests
py3req:pooch/pooch/downloaders.py: "requests" lines:[[[195]], [632], [[[790]]], [[[955]]], [[1074]]]: Ignore for REQ:slight

и в strict:
[user@host python3-module-pooch]$ RPM_PYTHON3_IMPORT_PATH=$(pwd) RPM_BUILD_ROOT=$(pwd) RPM_PYTHON3_REQ_METHOD=strict /usr/lib/rpm/python3.req pooch/pooch/downloaders.py 2>&1 | grep requests
python3(requests)

Это же можно видеть и в логе сборке в сизиф:
https://git.altlinux.org/tasks/archive/done/_333/341168/build/100/x86_64/log

[00:00:05] py3req:/usr/src/tmp/python3-module-pooch-buildroot/usr/lib/python3/site-packages/pooch/core.py: "requests.exceptions" lines:[[794]]: Ignore for REQ:slight

...

[00:00:05] py3req:/usr/src/tmp/python3-module-pooch-buildroot/usr/lib/python3/site-packages/pooch/downloaders.py: "requests" lines:[[[197]], [640], [[[798]]], [[[964]]], [[1084]]]: Ignore for REQ:slight
Comment 3 Repository Robot 2024-04-22 20:46:05 MSK
python3-module-pooch-1.8.1-alt1.1 -> sisyphus:

 Mon Apr 22 2024 Yuri N. Sedunov <aris@altlinux> 1.8.1-alt1.1
 - rebuilt with python3_req_method=strict (ALT #50120)
 - split tests to separate subpackage