stephenmcd / mezzanine

CMS framework for Django
http://mezzanine.jupo.org
BSD 2-Clause "Simplified" License
4.75k stars 1.64k forks source link

[BUG] pytz not defined as a requirement, thus "quick start" instructions on homepage fail #2007

Closed tswfi closed 2 years ago

tswfi commented 2 years ago

Is there an existing issue for this?

Current Behavior

Pytz is not installed by default. Following the "quick start" instructions from homepage:

demo> pipenv install mezzanine
Installing mezzanine...
Adding mezzanine to Pipfile's [packages]...
✔ Installation Succeeded 
Pipfile.lock not found, creating...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
✔ Success! 
Updated Pipfile.lock (9c2e16)!
Installing dependencies from Pipfile.lock (9c2e16)...
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/0 — 00:00:00
demo> mezzanine-project myproject
demo> cd myproject
demo> python manage.py createdb
Traceback (most recent call last):
  File "/home/tsw/git/mezzazine_vanilla/myproject/manage.py", line 7, in <module>
    from mezzanine.utils.conf import real_project_name
  File "/home/tsw/.local/share/virtualenvs/mezzazine_vanilla-ZPLJQPDu/lib/python3.9/site-packages/mezzanine/utils/conf.py", line 11, in <module>
    from mezzanine.utils.timezone import get_best_local_timezone
  File "/home/tsw/.local/share/virtualenvs/mezzazine_vanilla-ZPLJQPDu/lib/python3.9/site-packages/mezzanine/utils/timezone.py", line 4, in <module>
    import pytz
ModuleNotFoundError: No module named 'pytz'
demo> 

pytz-deprecation-shim seems to be installed but is probably not enough

demo> pipenv graph
Mezzanine==5.0.0
  - beautifulsoup4 [required: >=4.5.3, installed: 4.10.0]
    - soupsieve [required: >1.2, installed: 2.3.1]
  - bleach [required: >=2, installed: 4.1.0]
    - packaging [required: Any, installed: 21.3]
      - pyparsing [required: >=2.0.2,!=3.0.5, installed: 3.0.6]
    - six [required: >=1.9.0, installed: 1.16.0]
    - webencodings [required: Any, installed: 0.5.1]
  - chardet [required: >=4, installed: 4.0.0]
  - django [required: >=2.2, installed: 4.0]
    - asgiref [required: >=3.4.1,<4, installed: 3.4.1]
    - sqlparse [required: >=0.2.2, installed: 0.4.2]
  - django-contrib-comments [required: >=1.9, installed: 2.1.0]
    - Django [required: >=2.2, installed: 4.0]
      - asgiref [required: >=3.4.1,<4, installed: 3.4.1]
      - sqlparse [required: >=0.2.2, installed: 0.4.2]
  - filebrowser-safe [required: >=1.0.0, installed: 1.0.0]
  - grappelli-safe [required: >=1.0.0, installed: 1.0.0]
  - pillow [required: >=7, installed: 8.4.0]
  - requests [required: >=2.1.0, installed: 2.26.0]
    - certifi [required: >=2017.4.17, installed: 2021.10.8]
    - charset-normalizer [required: ~=2.0.0, installed: 2.0.9]
    - idna [required: >=2.5,<4, installed: 3.3]
    - urllib3 [required: >=1.21.1,<1.27, installed: 1.26.7]
  - requests-oauthlib [required: >=1.3, installed: 1.3.0]
    - oauthlib [required: >=3.0.0, installed: 3.1.1]
    - requests [required: >=2.0.0, installed: 2.26.0]
      - certifi [required: >=2017.4.17, installed: 2021.10.8]
      - charset-normalizer [required: ~=2.0.0, installed: 2.0.9]
      - idna [required: >=2.5,<4, installed: 3.3]
      - urllib3 [required: >=1.21.1,<1.27, installed: 1.26.7]
  - tzlocal [required: >=2, installed: 4.1]
    - pytz-deprecation-shim [required: Any, installed: 0.1.0.post0]
      - tzdata [required: Any, installed: 2021.5]
demo> 

Expected Behavior

"quick start" from homepage works

Steps To Reproduce

follow the "quick start" instructions from the homepage

Environment

- Operating System: linux
- Python version: 3.9.9
- Django version: 4.0.0 (comes automatically as it is defined as a requirement for mezzanine, see pipenv graph)
- Database engine and version: I'm guessing the "quick start" defaults to sqlite?
- Mezzanine version: 5.0.0

Anything else?

I'm guessing this comes from the fact that Django 4.0.0 was just released and it moved away from pytz (https://docs.djangoproject.com/en/4.0/releases/4.0/#zoneinfo-default-timezone-implementation)

mezzanine requirements define Django > 2.2 but no upper limit (https://github.com/stephenmcd/mezzanine/blob/master/setup.cfg#L43)

skru commented 2 years ago

https://github.com/stephenmcd/mezzanine/issues/2008

jerivas commented 2 years ago

Fixed in #2009