-
Notifications
You must be signed in to change notification settings - Fork 265
Add support for SQLAlchemy 2.0 #249
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
Changes from all commits
aeced78
d6cdc9e
7e566af
962531f
cb3ae35
2efec56
7154e08
8f596eb
790f98c
a544669
f454869
a18d600
5ea20c8
892a98c
bbfacf7
f5b6947
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -25,10 +25,11 @@ classifiers = [ | |||||||||||
"Programming Language :: Python :: 3.8", | ||||||||||||
"Programming Language :: Python :: 3.9", | ||||||||||||
"Programming Language :: Python :: 3.10", | ||||||||||||
"Programming Language :: Python :: 3.11", | ||||||||||||
] | ||||||||||||
requires-python = ">=3.7" | ||||||||||||
dependencies = [ | ||||||||||||
"SQLAlchemy >= 1.4.36, < 2.0", | ||||||||||||
"SQLAlchemy >= 1.4.36", | ||||||||||||
"inflect >= 4.0.0", | ||||||||||||
"importlib_metadata; python_version < '3.10'", | ||||||||||||
] | ||||||||||||
|
@@ -44,6 +45,8 @@ test = [ | |||||||||||
"pytest-cov", | ||||||||||||
"psycopg2-binary", | ||||||||||||
"mysql-connector-python", | ||||||||||||
] | ||||||||||||
Comment on lines
47
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will cause the sqlmodel tests to actually run, and restore the lost coverage. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @agronholm sqlmodel is not compatible with sqlalchemy 2.0, this makes it tricky. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh right. Hmm, those tests need to be run somehow. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you had the right idea, but couldn't you just have compared the sqlalchemy version to the string There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are many roads that lead to Rome. This way has the advantage that if one wants to pin SQLalchemy to a certain version only the install line needs to be changed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not going to want to pin it to a specific version. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems resolved to me since bbfacf7, see lines 24-29 |
||||||||||||
sqlmodel = [ | ||||||||||||
"sqlmodel", | ||||||||||||
] | ||||||||||||
citext = ["sqlalchemy-citext >= 1.7.0"] | ||||||||||||
|
@@ -75,7 +78,8 @@ strict = true | |||||||||||
plugins = ["sqlalchemy.ext.mypy.plugin"] | ||||||||||||
|
||||||||||||
[tool.pytest.ini_options] | ||||||||||||
addopts = "-rsx --tb=short" | ||||||||||||
pythonpath = "src/sqlacodegen" | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is unnecessary. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed in #275 |
||||||||||||
addopts = "-rsx --tb=short --import-mode=importlib" | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed in #275 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pytest recommends to use importlib: https://docs.pytest.org/en/7.1.x/explanation/goodpractices.html |
||||||||||||
testpaths = ["tests"] | ||||||||||||
|
||||||||||||
[coverage.run] | ||||||||||||
|
@@ -88,7 +92,7 @@ show_missing = true | |||||||||||
[tool.tox] | ||||||||||||
legacy_tox_ini = """ | ||||||||||||
[tox] | ||||||||||||
envlist = py37, py38, py39, py310 | ||||||||||||
envlist = py37, py38, py39, py310, py311 | ||||||||||||
skip_missing_interpreters = true | ||||||||||||
isolated_build = true | ||||||||||||
|
||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only just noticed: what caused the reformatting? That makes it hard to see the actual changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you could undo the formatting changes and only leave the actual changes in, then I'm ready to merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting removed in #275