Skip to content

Commit 271c179

Browse files
authored
Upgrade dependencies and drop Python versions < 3.10 (#103)
Updated the project to require Python 3.10 or newer, removing compatibility for older versions. Upgraded all dependencies to their latest versions and removed unused ones like Flask-UUID. Cleaned up Docker-related files by removing unused configurations and updated Python versioning.
1 parent 511a106 commit 271c179

File tree

9 files changed

+18
-57
lines changed

9 files changed

+18
-57
lines changed

brainzutils/__init__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
import sys
2-
3-
if sys.version_info >= (3, 10):
4-
from importlib.metadata import version, PackageNotFoundError
5-
else:
6-
# importlib.metadata's API changed in 3.10, so use a backport for versions less than this.
7-
from importlib_metadata import version, PackageNotFoundError
1+
from importlib.metadata import version, PackageNotFoundError
82

93
try:
104
__version__ = version(__name__)

brainzutils/flask/__init__.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
from flask import Flask
2-
from flask_uuid import FlaskUUID
32
from flask_debugtoolbar import DebugToolbarExtension
43

54

65
class CustomFlask(Flask):
76
"""Custom version of Flask with our bells and whistles."""
87

98
def __init__(self, import_name, config_file=None, debug=None,
10-
use_flask_uuid=False,
119
*args, **kwargs):
1210
"""Create an instance of Flask app.
1311
@@ -18,15 +16,12 @@ def __init__(self, import_name, config_file=None, debug=None,
1816
config_file (str): Path to a config file that needs to be loaded.
1917
Should be in a form of Python module.
2018
debug (bool): Override debug value.
21-
use_flask_uuid (bool): Turn on Flask-UUID extension if set to True.
2219
"""
2320
super(CustomFlask, self).__init__(import_name, *args, **kwargs)
2421
if config_file:
2522
self.config.from_pyfile(config_file)
2623
if debug is not None:
2724
self.debug = debug
28-
if use_flask_uuid:
29-
FlaskUUID(self)
3025

3126
def init_debug_toolbar(self):
3227
"""This method initializes the Flask-Debug extension toolbar for the

requirements.txt

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
Flask>=2.1.0
2-
Jinja2>=3.0
3-
itsdangerous>=2.0
4-
click>=8.0
5-
Werkzeug>=2.0
1+
Flask>=3.1.0
2+
Jinja2>=3.1.6
3+
itsdangerous>=2.2.0
4+
click>=8.1.8
5+
Werkzeug>=3.1.3
66
Flask-DebugToolbar
7-
Flask-UUID>=0.2
8-
sentry-sdk[flask]>=1.5.8
9-
certifi
10-
redis>=4.2.2
11-
msgpack>=0.5.6
12-
requests>=2.27.1
13-
SQLAlchemy>=2.0
7+
sentry-sdk[flask]>=2.27.0
8+
redis>=5.2.1
9+
msgpack>=1.1.0
10+
requests>=2.32.3
11+
SQLAlchemy>=2.0.40
1412
mbdata@git+https://github.com/acoustid/mbdata.git@v29.0.0
15-
importlib-metadata>=3.10.0;python_version<'3.10'

requirements_dev.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
psycopg2-binary==2.9.3
2-
freezegun==1.2.1
3-
pytest==7.1.1
4-
pytest-cov==3.0.0
5-
pylint==2.13.5
1+
psycopg2-binary==2.9.10
2+
freezegun==1.5.1
3+
pytest==8.3.5
4+
pytest-cov==6.1.1
5+
pylint==3.3.6

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
author="MetaBrainz Foundation",
99
author_email="support@metabrainz.org",
1010
py_modules=["brainzutils"],
11-
python_requires='>=3.7',
11+
python_requires='>=3.10',
1212
packages=find_packages(),
1313
use_scm_version=True,
1414
setup_requires=['setuptools_scm'],

test/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM metabrainz/python:3.10-20220315
1+
FROM metabrainz/python:3.13-20250313
22

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

test/Dockerfile.pylint

Lines changed: 0 additions & 16 deletions
This file was deleted.

test/docker-compose.pylint.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

test/docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: "2"
21
services:
32

43
test:

0 commit comments

Comments
 (0)