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

Depedencies via pip extras #2475

Closed
wants to merge 4 commits into from
Closed

Depedencies via pip extras #2475

wants to merge 4 commits into from

Conversation

samuelhwilliams
Copy link
Contributor

@samuelhwilliams samuelhwilliams commented Jul 24, 2024

We previously haven't ever had a single place that clearly says what dependencies Flask-Admin expects for the 'optional' features, and what versions of those dependencies are required.

This PR pulls all of this information into pyproject.toml and exposes them as extras.

All of the examples have been updated to install using these extras, which simplifies their requirements files.

The controversial change here is that, now, in our 'standard' test runs, we can't get the flask-mongoengine tests to pass because that dependency is very out of date and doesn't support the latest versions of Flask that we support. We may need to consider deprecating/removing flask-mongoengine altogether, but I'm leaving that decision to be had on this thread: #2466. I've added a 'snowflake' tox env for flask-mongoengine that pins required (old) versions of flask/werkzeug/sqlalchemy in the mean time.

  • Add documentation explaining how to install the extras.

@samuelhwilliams samuelhwilliams marked this pull request as draft July 24, 2024 14:21
@samuelhwilliams samuelhwilliams marked this pull request as ready for review July 24, 2024 14:36
Flask-Admin does not yet support Flask v3+, WTForms v3+, or SQLAlchemy
2+. Let's clearly mark this.

And then we also define a set of pip extras, which should let users pull
in the supported versions of dependencies for additional features (eg
supporting geography, mapping, redis CLI, exporting to lots of formats,
etc).

And fix our minimum python version from 3.6 to 3.8. This was done a
little while ago, but not updated here correctly.
And pin requirements files again now that we don't include any direct
project dependencies within the `requirements/*` files.
- Disable `mongoengine` tests. This is the main problem here:
  `Flask-Mongoengine` is now fairly out-of-date and doesn't support
  recent Flask 2.x versions, which our tests try to pull in. With the
  change to how we declare our dependencies (flask), we can't really
  install a specific version of flask that's lower than what we support
  across all of Flask-Admin, which we'd need to do. I don't think we
  want a special case for Flask-Mongoengine. I think we need to accept
  that Flask-Mongoengine is now unsupported and doesn't work with
  Flask-Admin, assuming people are using recent versions of Flask etc.
  We may need to consider deprecating Flask-Mongoengine support
  altogether, but I'm leaving that for a separate issue.

- flask.Markup was removed; use markupsafe instead

- Use BytesIO for file uploads

        rv = client.post('/admin/myfileadmin/upload/',
>                        data=dict(upload=(StringIO(""), 'dummy.txt')))
E       TypeError: a bytes-like object is required, not 'str'

- Update import path

- Ignore deprecation warning from flask.testing

- Flask now requires all routes/views to be registered before the first request

- Werkzeug 2.3.0+ no longer quotes URL params

- Ignore SQLAlchemy2 deprecation warning
@samuelhwilliams samuelhwilliams closed this by deleting the head repository Jul 24, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant