Skip to content
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
Upgrade dependencies and drop Python versions < 3.10
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.
  • Loading branch information
amCap1712 committed Apr 30, 2025
commit ca51240dd9a13c5d52c0b6fd5135199e8ff57d5d
8 changes: 1 addition & 7 deletions brainzutils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
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
from importlib.metadata import version, PackageNotFoundError

try:
__version__ = version(__name__)
Expand Down
5 changes: 0 additions & 5 deletions brainzutils/flask/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
from flask import Flask
from flask_uuid import FlaskUUID
from flask_debugtoolbar import DebugToolbarExtension


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

def __init__(self, import_name, config_file=None, debug=None,
use_flask_uuid=False,
*args, **kwargs):
"""Create an instance of Flask app.

Expand All @@ -18,15 +16,12 @@ def __init__(self, import_name, config_file=None, debug=None,
config_file (str): Path to a config file that needs to be loaded.
Should be in a form of Python module.
debug (bool): Override debug value.
use_flask_uuid (bool): Turn on Flask-UUID extension if set to True.
"""
super(CustomFlask, self).__init__(import_name, *args, **kwargs)
if config_file:
self.config.from_pyfile(config_file)
if debug is not None:
self.debug = debug
if use_flask_uuid:
FlaskUUID(self)

def init_debug_toolbar(self):
"""This method initializes the Flask-Debug extension toolbar for the
Expand Down
23 changes: 10 additions & 13 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
Flask>=2.1.0
Jinja2>=3.0
itsdangerous>=2.0
click>=8.0
Werkzeug>=2.0
Flask>=3.1.0
Jinja2>=3.1.6
itsdangerous>=2.2.0
click>=8.1.8
Werkzeug>=3.1.3
Flask-DebugToolbar
Flask-UUID>=0.2
sentry-sdk[flask]>=1.5.8
certifi
redis>=4.2.2
msgpack>=0.5.6
requests>=2.27.1
SQLAlchemy>=2.0
sentry-sdk[flask]>=2.27.0
redis>=5.2.1
msgpack>=1.1.0
requests>=2.32.3
SQLAlchemy>=2.0.40
mbdata@git+https://github.com/acoustid/[email protected]
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.9.3
freezegun==1.2.1
pytest==7.1.1
pytest-cov==3.0.0
pylint==2.13.5
psycopg2-binary==2.9.10
freezegun==1.5.1
pytest==8.3.5
pytest-cov==6.1.1
pylint==3.3.6
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
author="MetaBrainz Foundation",
author_email="[email protected]",
py_modules=["brainzutils"],
python_requires='>=3.7',
python_requires='>=3.10',
packages=find_packages(),
use_scm_version=True,
setup_requires=['setuptools_scm'],
Expand Down
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.10-20220315
FROM metabrainz/python:3.13-20250313

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
16 changes: 0 additions & 16 deletions test/Dockerfile.pylint

This file was deleted.

8 changes: 0 additions & 8 deletions test/docker-compose.pylint.yml

This file was deleted.

1 change: 0 additions & 1 deletion test/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "2"
services:

test:
Expand Down