Skip to content

Version compatible inspect handling for class parameters#299

Merged
sderickson merged 2 commits intomainfrom
fix_inspect_version_deprecation
May 18, 2023
Merged

Version compatible inspect handling for class parameters#299
sderickson merged 2 commits intomainfrom
fix_inspect_version_deprecation

Conversation

@johnlarkin1
Copy link
Copy Markdown
Contributor

getargspec was deprecated in Python 3.0, but finally removed in Python 3.11. For reference: Pylons/pyramid#3688

That seems like a valid amount of time for us to have fixed it.

We can do our best effort and if the user is running a Python version that still has getargspec use that, but if they have getfullargspec which is available in Python 3.11, we can use that.

Checklist

General Contributing

  • Have you read the Code of Conduct and signed the CLA?

Is This a Code Change?

  • Non-code related change (markdown/git settings etc)
  • Code Change
  • Example/Test Code Change

Validation

  • Have you ran tox?
  • Do the tests pass?

`getargspec` was deprecated in Python 3.0, but finally removed in Python
3.11. For reference: Pylons/pyramid#3688

That seems like a valid amount of time.

We can do our best effort and if the user is running a Python version
that still has `getargspec` use that, but if they have `getfullargspec`
which is available in Python 3.11, we can use that.
@johnlarkin1 johnlarkin1 requested a review from sderickson May 18, 2023 18:08
@johnlarkin1 johnlarkin1 mentioned this pull request May 18, 2023
include `isclass`
@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2023

Codecov Report

Merging #299 (49fa860) into main (bdd49bc) will decrease coverage by 0.01%.
The diff coverage is 71.42%.

❗ Current head 49fa860 differs from pull request most recent head 61df2af. Consider uploading reports for the commit 61df2af to get more accurate results

@@            Coverage Diff             @@
##             main     #299      +/-   ##
==========================================
- Coverage   52.02%   52.02%   -0.01%     
==========================================
  Files          37       37              
  Lines        8458     8462       +4     
  Branches     1810     1810              
==========================================
+ Hits         4400     4402       +2     
- Misses       3741     3743       +2     
  Partials      317      317              
Flag Coverage Δ
unit 52.02% <71.42%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
stone/frontend/ir_generator.py 80.45% <71.42%> (-0.14%) ⬇️

Copy link
Copy Markdown
Contributor

@sderickson sderickson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sderickson sderickson merged commit 199029a into main May 18, 2023
@sderickson sderickson deleted the fix_inspect_version_deprecation branch May 18, 2023 22:06
@devPalacio
Copy link
Copy Markdown
Contributor

Fixes #288

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants