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

update pendulum == 3.0 #293

Closed
wants to merge 1 commit into from
Closed

update pendulum == 3.0 #293

wants to merge 1 commit into from

Conversation

azliu0
Copy link

@azliu0 azliu0 commented Mar 6, 2024

Resolves #292. Updated dependencies to support pendulum >= 3.0 so that the package is compatible with Python 3.12. All tests pass.

@azliu0 azliu0 force-pushed the master branch 2 times, most recently from 10cea75 to 3b47e38 Compare March 6, 2024 06:34
@azliu0 azliu0 changed the title update pendulum >= 3.0 update pendulum == 3.0 Mar 6, 2024
@dusktreader
Copy link
Owner

When I install flask-praetorian with the updated dependencies and python 3.12 in a docker container, I'm getting compatibility issues with flask-mail:

flask-praetorian-tutorial-dev-api-1  |
flask-praetorian-tutorial-dev-api-1  |   Backend 'setuptools.build_meta:__legacy__' is not available.
flask-praetorian-tutorial-dev-api-1  |
flask-praetorian-tutorial-dev-api-1  |   Traceback (most recent call last):
flask-praetorian-tutorial-dev-api-1  |     File "/usr/local/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 77, in _build_backend
flask-praetorian-tutorial-dev-api-1  |       obj = import_module(mod_path)
flask-praetorian-tutorial-dev-api-1  |             ^^^^^^^^^^^^^^^^^^^^^^^
flask-praetorian-tutorial-dev-api-1  |     File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
flask-praetorian-tutorial-dev-api-1  |       return _bootstrap._gcd_import(name[level:], package, level)
flask-praetorian-tutorial-dev-api-1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
flask-praetorian-tutorial-dev-api-1  |     File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
flask-praetorian-tutorial-dev-api-1  |     File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
flask-praetorian-tutorial-dev-api-1  |     File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
flask-praetorian-tutorial-dev-api-1  |     File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
flask-praetorian-tutorial-dev-api-1  |     File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
flask-praetorian-tutorial-dev-api-1  |     File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
flask-praetorian-tutorial-dev-api-1  |     File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
flask-praetorian-tutorial-dev-api-1  |     File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
flask-praetorian-tutorial-dev-api-1  |     File "<frozen importlib._bootstrap_external>", line 995, in exec_module
flask-praetorian-tutorial-dev-api-1  |     File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
flask-praetorian-tutorial-dev-api-1  |     File "/tmp/tmpwyl3p68n/.venv/lib/python3.12/site-packages/setuptools/__init__.py", line 8, in <module>
flask-praetorian-tutorial-dev-api-1  |       import distutils.core
flask-praetorian-tutorial-dev-api-1  |   ModuleNotFoundError: No module named 'distutils'
flask-praetorian-tutorial-dev-api-1  |
flask-praetorian-tutorial-dev-api-1  |
flask-praetorian-tutorial-dev-api-1  |   at /usr/local/lib/python3.12/site-packages/poetry/installation/chef.py:164 in _prepare
flask-praetorian-tutorial-dev-api-1  |       160│
flask-praetorian-tutorial-dev-api-1  |       161│                 error = ChefBuildError("\n\n".join(message_parts))
flask-praetorian-tutorial-dev-api-1  |       162│
flask-praetorian-tutorial-dev-api-1  |       163│             if error is not None:
flask-praetorian-tutorial-dev-api-1  |     → 164│                 raise error from None
flask-praetorian-tutorial-dev-api-1  |       165│
flask-praetorian-tutorial-dev-api-1  |       166│             return path
flask-praetorian-tutorial-dev-api-1  |       167│
flask-praetorian-tutorial-dev-api-1  |       168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:
flask-praetorian-tutorial-dev-api-1  |
flask-praetorian-tutorial-dev-api-1  | Note: This error originates from the build backend, and is likely not a problem with poetry but with flask-mail (0.9.1) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "flask-mail (==0.9.1)"'.

I may explore changing to depend on flask-mailgun instead.

@azliu0
Copy link
Author

azliu0 commented Mar 9, 2024

How can I reproduce this error? On my end, it seems like the latest version of flask-mail (0.9.1) and flask-praetorian (with pendulum==3.0) work fine together.

When I run the flask-praetorian-tutorial-api container with flask-praetorian updated dependencies, I have to make two changes to api/src/pyproject.toml:

  • flask-sqlalchemy = "^3.1.1"
  • pendulum = "^3.0"

The first change seems unrelated to upgrading pendulum. After making these changes, I'm able to run the container fine.

@azliu0 azliu0 reopened this Mar 9, 2024
@dusktreader
Copy link
Owner

How can I reproduce this error? On my end, it seems like the latest version of flask-mail (0.9.1) and flask-praetorian (with pendulum==3.0) work fine together.

When I run the flask-praetorian-tutorial-api container with flask-praetorian updated dependencies, I have to make two changes to api/src/pyproject.toml:

  • flask-sqlalchemy = "^3.1.1"
  • pendulum = "^3.0"

The first change seems unrelated to upgrading pendulum. After making these changes, I'm able to run the container fine.

Did you change the base image for the flask-praetorian-tutorial/api's image? I get this error when I switch it to python:3.12-bookworm.

@dusktreader
Copy link
Owner

Addressed the issues encountered here with the flask-mail dependency in #296

@dusktreader
Copy link
Owner

@azliu0
Support for Python 3.12 has been published in flask-praetorian v1.6.0 on PyPI.

@azliu0
Copy link
Author

azliu0 commented Mar 12, 2024

great, thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dependency issues with pendulum and python 3.12
2 participants