Skip to content

Commit

Permalink
Enable sqlalchemy warnings and update mbdata
Browse files Browse the repository at this point in the history
With SQLAlchemy warnings enabled, SQLAlchemy 1.4 gives the following warning.

MovedIn20Warning: The declarative_base() function is now available as sqlalchemy.orm.declarative_base(). (deprecated since: 1.4) (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
Base = declarative_base()

The rationale of the move is explained here: https://docs.sqlalchemy.org/en/14/changelog/migration_20.html#declarative-becomes-a-first-class-api

This is fixed in mbdata in acoustid/mbdata#52,
meanwhile BU is using our fork anyway so we can update. There are some
other warnings in BU code that result in SQLAlchemy warnings but not
fixing those for now as those are only relevant to CB, will fix those
separately.
  • Loading branch information
amCap1712 committed Sep 30, 2022
1 parent a3d281f commit 4e27f06
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[pytest]
testpaths = brainzutils
addopts = --cov-report html --cov=brainzutils
addopts = --cov-report html --cov=brainzutils -W always::DeprecationWarning

markers =
database: requires access to the musicbrainz sample database
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ redis>=4.2.2
msgpack==0.5.6
requests>=2.27.1
SQLAlchemy>=1.3.16,<2.0
mbdata@git+https://github.com/amCap1712/mbdata.git@upstream-schema-changes
mbdata@git+https://github.com/amCap1712/mbdata.git@fix-sqlalchemy-warnings
sqlalchemy-dst>=1.0.1
importlib-metadata>=3.10.0;python_version<'3.10'
1 change: 1 addition & 0 deletions test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ services:
- ../:/code
environment:
PYTHONDONTWRITEBYTECODE: 1
SQLALCHEMY_WARN_20: 1
depends_on:
- redis
- musicbrainz_db
Expand Down

0 comments on commit 4e27f06

Please sign in to comment.