knadh / tg-archive

A tool for exporting Telegram group chats into static websites like mailing list archives.
MIT License
829 stars 121 forks source link

pytz missing in requirements.txt #96

Closed joschi closed 1 year ago

joschi commented 1 year ago

The newly added dependency on pytz is missing in the requirements.txt file (as of tg-archive 1.1.1).

# docker run -it --rm python:3.10 /bin/bash
root@ea4803a88961:/# pip install tg-archive==1.1.1
Collecting tg-archive==1.1.1
  Downloading tg-archive-1.1.1.tar.gz (28 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-_y3qx6gu/tg-archive_f8161a99aa3a49f99c04d3eb8ea3fcb6/setup.py", line 5, in <module>
          from tgarchive import __version__
        File "/tmp/pip-install-_y3qx6gu/tg-archive_f8161a99aa3a49f99c04d3eb8ea3fcb6/tgarchive/__init__.py", line 6, in <module>
          import yaml
      ModuleNotFoundError: No module named 'yaml'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

[notice] A new release of pip available: 22.3.1 -> 23.0.1
[notice] To update, run: pip install --upgrade pip
root@ea4803a88961:/# pip install PyYAML
Collecting PyYAML
  Downloading PyYAML-6.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (733 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 733.7/733.7 kB 7.3 MB/s eta 0:00:00
Installing collected packages: PyYAML
Successfully installed PyYAML-6.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[notice] A new release of pip available: 22.3.1 -> 23.0.1
[notice] To update, run: pip install --upgrade pip
root@ea4803a88961:/# pip install tg-archive==1.1.1
Collecting tg-archive==1.1.1
  Using cached tg-archive-1.1.1.tar.gz (28 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-2ff4jqgs/tg-archive_23604a55fee94a65b16d5f1555e0a3b2/setup.py", line 5, in <module>
          from tgarchive import __version__
        File "/tmp/pip-install-2ff4jqgs/tg-archive_23604a55fee94a65b16d5f1555e0a3b2/tgarchive/__init__.py", line 8, in <module>
          from .db import DB
        File "/tmp/pip-install-2ff4jqgs/tg-archive_23604a55fee94a65b16d5f1555e0a3b2/tgarchive/db.py", line 7, in <module>
          import pytz
      ModuleNotFoundError: No module named 'pytz'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

[notice] A new release of pip available: 22.3.1 -> 23.0.1
[notice] To update, run: pip install --upgrade pip
root@ea4803a88961:/# pip install pytz=2022.7.1
ERROR: Invalid requirement: 'pytz=2022.7.1'
Hint: = is not a valid operator. Did you mean == ?

[notice] A new release of pip available: 22.3.1 -> 23.0.1
[notice] To update, run: pip install --upgrade pip
root@ea4803a88961:/# pip install pytz==2022.7.1
Collecting pytz==2022.7.1
  Downloading pytz-2022.7.1-py2.py3-none-any.whl (499 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 499.4/499.4 kB 4.8 MB/s eta 0:00:00
Installing collected packages: pytz
Successfully installed pytz-2022.7.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[notice] A new release of pip available: 22.3.1 -> 23.0.1
[notice] To update, run: pip install --upgrade pip
root@ea4803a88961:/# pip install tg-archive==1.1.1
Collecting tg-archive==1.1.1
  Using cached tg-archive-1.1.1.tar.gz (28 kB)
  Preparing metadata (setup.py) ... done
Collecting telethon==1.24.0
  Downloading Telethon-1.24.0-py3-none-any.whl (528 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 528.5/528.5 kB 6.1 MB/s eta 0:00:00
Collecting jinja2>=2.11.3
  Downloading Jinja2-3.1.2-py3-none-any.whl (133 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.1/133.1 kB 15.8 MB/s eta 0:00:00
Requirement already satisfied: PyYAML>=5.4.1 in /usr/local/lib/python3.10/site-packages (from tg-archive==1.1.1) (6.0)
Collecting cryptg==0.2.post2
  Downloading cryptg-0.2.post2.tar.gz (16 kB)
  Preparing metadata (setup.py) ... done
Collecting Pillow>=8.3.2
  Downloading Pillow-9.4.0-cp310-cp310-manylinux_2_28_aarch64.whl (3.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.1/3.1 MB 22.8 MB/s eta 0:00:00
Collecting feedgen>=0.9.0
  Downloading feedgen-0.9.0.tar.gz (217 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 217.9/217.9 kB 27.3 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting python-magic>=0.4.24
  Downloading python_magic-0.4.27-py2.py3-none-any.whl (13 kB)
Collecting cffi>=1.0.0
  Using cached cffi-1.15.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (449 kB)
Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Collecting pyaes
  Downloading pyaes-1.6.1.tar.gz (28 kB)
  Preparing metadata (setup.py) ... done
Collecting rsa
  Downloading rsa-4.9-py3-none-any.whl (34 kB)
Collecting lxml
  Downloading lxml-4.9.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl (6.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.8/6.8 MB 19.8 MB/s eta 0:00:00
Collecting python-dateutil
  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 kB 17.7 MB/s eta 0:00:00
Collecting MarkupSafe>=2.0
  Downloading MarkupSafe-2.1.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (26 kB)
Collecting six>=1.5
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting pyasn1>=0.1.3
  Downloading pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.1/77.1 kB 13.1 MB/s eta 0:00:00
Building wheels for collected packages: tg-archive, cryptg, feedgen, pyaes
  Building wheel for tg-archive (setup.py) ... done
  Created wheel for tg-archive: filename=tg_archive-1.1.1-py3-none-any.whl size=29787 sha256=c489f3b6fc1723ac04c4d4cc24a59def1eab75835519dece6a1b42afaa8c0cf1
  Stored in directory: /root/.cache/pip/wheels/fc/26/31/f47be0d9ed0a9514c9c3ab8dd5cdb7b3030632dfbe73c77284
  Building wheel for cryptg (setup.py) ... done
  Created wheel for cryptg: filename=cryptg-0.2.post2-cp310-cp310-linux_aarch64.whl size=36172 sha256=9258d90d477969b2e8606ac84f6778b352321e1992977a4b8cf2db157a55ed79
  Stored in directory: /root/.cache/pip/wheels/5b/57/c5/a0cd09a10e131b660dc2c22e48a1ff1f58100881411f4ea068
  Building wheel for feedgen (setup.py) ... done
  Created wheel for feedgen: filename=feedgen-0.9.0-py2.py3-none-any.whl size=44370 sha256=e217499a1ceec5cbb22018e71d91df729e17fee2daaac044fb2f8c5600a156aa
  Stored in directory: /root/.cache/pip/wheels/af/65/6a/b476c887721f4ae97f7a46225de4dfe46c623ca62a448239d2
  Building wheel for pyaes (setup.py) ... done
  Created wheel for pyaes: filename=pyaes-1.6.1-py3-none-any.whl size=26347 sha256=09aa18945138ee1f16bdcb4138f0c2233b9ddef4ec2f856d29b5f0afb9c04250
  Stored in directory: /root/.cache/pip/wheels/60/9b/97/e53da26f9cc31f82f8c9bf9870328e72888be92cc4660f4a06
Successfully built tg-archive cryptg feedgen pyaes
Installing collected packages: pyasn1, pyaes, six, rsa, python-magic, pycparser, Pillow, MarkupSafe, lxml, telethon, python-dateutil, jinja2, cffi, feedgen, cryptg, tg-archive
Successfully installed MarkupSafe-2.1.2 Pillow-9.4.0 cffi-1.15.1 cryptg-0.2.post2 feedgen-0.9.0 jinja2-3.1.2 lxml-4.9.2 pyaes-1.6.1 pyasn1-0.4.8 pycparser-2.21 python-dateutil-2.8.2 python-magic-0.4.27 rsa-4.9 six-1.16.0 telethon-1.24.0 tg-archive-1.1.1
knadh commented 1 year ago

pytz is a part of the Python standard library. Can't recollect from which version on. Which version are you using?

joschi commented 1 year ago

@knadh Python 3.10.10 via https://hub.docker.com/_/python.

❯ docker run -it --rm python:3.10 python -V
Python 3.10.10

pytz is a part of the Python standard library.

Are you sure about this? I couldn't find anything backing this. 🤔

knadh commented 1 year ago

Ah, my bad! Released version 1.1.2 with pytz added to requirements. pytz is no apparently no longer recommended as timezone functions are now available in the stdlib. I misread that.