-
Notifications
You must be signed in to change notification settings - Fork 636
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
[REQUIRED FIRST] Fix lint by making pkg tests folders namespace pkgs #131
Conversation
Would you mind posting the error that you're seeing? I have a feeling this is caused by the lack of a namespace declaration for the tests module: Which is waiting on a pylint fix: pylint-dev/pylint#3609. |
Considering excluding lint rules is manual and also hard to inform a user who encounters these issues, I'd vote for re-adding the workaround. |
@toumorokoshi This is the error I'm seeing:
Wow I think you're definitely right. I didn't notice that comment 😓 I agree adding the disables is not very intuitive, which workaround do you mean? Do you mean the |
@toumorokoshi Please let me know if I misunderstood the needed change, but when I made each of these packages that had errors include this workaround, it still seemed to fail 😕 I'm suspicious that because there are also "naming" lint errors, there's something else I'm missing. Previous what fixed it is a version bump for Here's the run for my code: https://github.com/NathanielRN/opentelemetry-python-contrib-1/runs/1359261481?check_suite_focus=true And here's the diff where I added the workaround to all those modules: master...NathanielRN:test-namespace-module |
No idea why there's a |
It actually needs to be the first package imported. This is a bug in pylint where the python 3.4+ way of declaring a namespace (not including an init.py file) is not recognized properly. Looking at the first few lines of your github actions job:
If the first package doesn't declare the package as a namespace, then it'll be considered a module, and thus won't attempt to load any more. See the packaging documentation for more information The first "tests" module is opentelemetry-instrumentation-wsgi. I put the namespace hack in there and it ran fine. Can you give that a shot and see if it works? I see your point about getting incremental changes in, but I think in this case we'd just reverse this PR as is once we get namespaces working properly. |
a64b0b6
to
05d16c0
Compare
05d16c0
to
9f950d5
Compare
You're awesome @toumorokoshi ! It works! Updated the PR :) |
Very excited to see this fix :-) |
Description
Solves the issue with the lint tests by disabling the few remaining lint errors. We already ignore the
import-error
case for manytests/
directories so this follows nicely. Also needed to update topylint==2.4.4
to solve some test issues.It is curious that this didn't fail in the main repo... I was thinking maybe because
opentelemetry-test
package is closer to{toxinidir}
root? This was a helpful comment:https://github.com/open-telemetry/opentelemetry-python/blob/master/docs/examples/opentracing/rediscache.py#L10-L14
Fixes #127
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
The tests work now!
Checklist:
- [ ] Changelogs have been updated- [ ] Unit tests have been added- [ ] Documentation has been updated