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

Upgrade to python 3, flask 2, and other dependencies #84

Merged
merged 1 commit into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions brainzutils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# TODO: We are the backport of importlib to support python 3.7.
# When we raise the minimum to python 3.8, we can remove this and use the builtin importlib module.
from importlib_metadata import version, PackageNotFoundError
import sys

if sys.version_info >= (3, 10):
from importlib.metadata import version, PackageNotFoundError
else:
# importlib.metadata's API changed in 3.10, so use a backport for versions less than this.
from importlib_metadata import version, PackageNotFoundError

try:
__version__ = version(__name__)
except PackageNotFoundError:
# package is not installed
pass
__version__ = "unknown"
24 changes: 12 additions & 12 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Flask>=1.1.2
Jinja2>=2.11.2
werkzeug>=1.0.1
Flask-DebugToolbar>=0.11.0
Flask>=2.1.0
Jinja2>=3.0
itsdangerous>=2.0
click>=8.0
Werkzeug>=2.0
Flask-DebugToolbar>=0.13.1
Flask-UUID>=0.2
sentry-sdk[flask]>=0.20.2
sentry-sdk[flask]>=1.5.8
certifi
redis>=3.5,<4.0
msgpack==0.5.6
requests>=2.23.0
SQLAlchemy>=1.3.16
redis>=4.2.2
msgpack-python==0.5.6
requests>=2.27.1
SQLAlchemy>=1.3.16,<2.0
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

big API changes in sqlalchemy2, so I decided to pin this here for now until we can be sure that mbdata works with it

mbdata@git+https://github.com/amCap1712/mbdata.git@upstream-schema-changes
sqlalchemy-dst>=1.0.1
importlib-metadata>=3.10.0
itsdangerous==2.0.1
MarkupSafe==2.0.1
importlib-metadata>=3.10.0;python_version<'3.10'
10 changes: 5 additions & 5 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
psycopg2-binary==2.8.6
freezegun==0.3.15
pytest==4.6.9
pytest-cov==2.8.1
pylint==1.9.4
psycopg2-binary==2.9.3
freezegun==1.2.1
pytest==7.1.1
pytest-cov==3.0.0
pylint==2.13.5
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
packages=find_packages(),
use_scm_version=True,
setup_requires=['setuptools_scm'],
install_requires=open("requirements.txt").read().split(),
install_requires=open("requirements.txt").read().splitlines(),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this fixes some of the issues that we had in requirements file (it was splitting on whitespace, not newline). We could also consider removing comments:

[line for line in open("requirements.txt").read().splitlines() if line and not line.startswith('#')]

Still doesn't remove inline comments. I wonder if a specific requirements parser would be a better idea?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix with a comment in requirements.txt is good enough IMO.

That said, I guess its fine to use a special parser for this or moving this other way around as that answer suggests etc. Maybe open a ticket for later improvement.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course, perhaps the better solution would be to switch to poetry/pyproject.toml instead, which should be able to reuse the same dependency list...

)
2 changes: 1 addition & 1 deletion test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM metabrainz/python:3.7-20210115
FROM metabrainz/python:3.10-20220315

ENV DOCKERIZE_VERSION v0.6.1
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
Expand Down