-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Use python-typing-update
on half of the tests
directory
#6317
Conversation
Pull Request Test Coverage Report for Build 2168507121
💛 - Coveralls |
tests/test_func.py
Outdated
INPUT_DIR = join(dirname(__file__), "input") | ||
MSG_DIR = join(dirname(__file__), "messages") |
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.
Not that it's a problem, but there's unrelated change there ?
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.
Yeah I noticed it too. It's probably from an of the upgrade tools in Marc's tool updating this as well due to the 3.9+ flag.
However, I think it is actually a good change 😄
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.
Hmm that's suspicious though, in python 3.8 __file__
is not abspathed:
cat a.py
print(__file__)
python3 a.py
a.py
cat a.py
import os
print(os.path.abspath(__file__))
python3 a.py
/home/pierre/astroid/a.py
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.
Hmm is it related to dirname
perhaps?
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.
Ho, it's actually worst if we take dirname into account:
cat a.py
import os
print(os.path.dirname(__file__))
python3 a.py
#nothing printed
cat a.py
import os
print(os.path.dirname(os.path.abspath(__file__)))
python3 a.py
/home/pierre/astroid
(This is python 3.8)
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.
Do we want to revert?
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 think it's safer.
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 think it's safer.
I agree. Let's revert it here.
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.
Let's just focus on the typing changes here.
As part of python-typing-update
, pyupgrade
is run. The version setting is passed directly to it. If those updates depend on --py39-plus
we probably shouldn't do them at this time.
tests/test_func.py
Outdated
INPUT_DIR = join(dirname(__file__), "input") | ||
MSG_DIR = join(dirname(__file__), "messages") |
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 think it's safer.
I agree. Let's revert it here.
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Type of Changes
Description
Ref #4683.