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

DeprecationWarning for inspect.formatargspec #507

Closed
sqlalchemy-bot opened this issue Sep 13, 2018 · 6 comments
Closed

DeprecationWarning for inspect.formatargspec #507

sqlalchemy-bot opened this issue Sep 13, 2018 · 6 comments
Labels
Milestone

Comments

@sqlalchemy-bot
Copy link

@sqlalchemy-bot sqlalchemy-bot commented Sep 13, 2018

Migrated issue, originally created by Jakub Gocławski (@jgoclawski)

Since pytest now displays DeprecationWarning by default, our tests on Python 3.7. are now full of:

/usr/local/lib/python3.7/site-packages/alembic/util/langhelpers.py:91: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly
 formatvalue=lambda x: '=' + x)

The warning is displayed 100+ times for a small project.
Seems like a followup of #458, but inspect.formatargspec is still used twice in langhelpers.py.

For now our workaround is to set:

[tool:pytest]
filterwarnings =
    always
    ignore::DeprecationWarning:alembic[.*]
@sqlalchemy-bot
Copy link
Author

@sqlalchemy-bot sqlalchemy-bot commented Sep 13, 2018

Changes by Jakub Gocławski (@jgoclawski):

  • edited description
@sqlalchemy-bot
Copy link
Author

@sqlalchemy-bot sqlalchemy-bot commented Sep 13, 2018

Michael Bayer (@zzzeek) wrote:

I really thought this had been reported, although I might be thinking of a similar issue in dogpile. Here we need to port the patch from SQLAlchemy https://bitbucket.org/zzzeek/sqlalchemy/commits/e81102fbd7e03713ffd0e25b39d, PRs can work here.

@sqlalchemy-bot
Copy link
Author

@sqlalchemy-bot sqlalchemy-bot commented Sep 13, 2018

Changes by Michael Bayer (@zzzeek):

  • set milestone to "fasttrack"
@sqlalchemy-bot sqlalchemy-bot added the bug label Nov 27, 2018
@sqlalchemy-bot sqlalchemy-bot added this to the fasttrack milestone Nov 27, 2018
@jared-mackey
Copy link

@jared-mackey jared-mackey commented Nov 27, 2018

@zzzeek Any update on fixing these?

@zzzeek
Copy link
Member

@zzzeek zzzeek commented Nov 27, 2018

looks like it's here: https://gerrit.sqlalchemy.org/#/c/sqlalchemy/alembic/+/933/ have had no time to go through outstanding gerrits ready for merge

@zzzeek
Copy link
Member

@zzzeek zzzeek commented Nov 28, 2018

need to add collections.abc as well as that also emits deprecation warnings

@zzzeek zzzeek added the py3k label Nov 28, 2018
vvvrrooomm pushed a commit to vvvrrooomm/alembic that referenced this issue Jan 10, 2019
Resolved remaining Python 3 deprecation warnings, covering
the use of inspect.formatargspec() with a vendored version
copied from the Python standard library, importing
collections.abc above Python 3.3 when testing against abstract
base classes, fixed one occurrence of log.warn(), as well as a few
invalid escape sequences.

Add DeprecationWarning to the test suite as an error raise
as has been the case within SQLAlchemy for some time now.

Fixes: sqlalchemy#507
Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Change-Id: I121121b3d2dd90e6f3c9b16dec2fc80b9699c400
Pull-request: https://bitbucket.org/zzzeek/alembic/pull-requests/85
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.