Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Support module wildcards everywhere #235
Support module wildcards everywhere #235
Changes from 1 commit
d5de725
42af972
8df31fb
d996763
bcdf15a
a2f108e
337902b
c632021
3edda0e
1f61f78
04276a1
eb59109
4d0f9bf
b1488fb
59bb745
f2fdeba
44d5503
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 convinced we should be changing the tests - if anything it's a smell that the Import Linter is not behaving deterministically, which I think should at least be an aspiration.
I think a better way to address this is just to move the
sort
up the stack, so whilemodule_expressions_to_modules
returns a set, thecheck
methods that use it sort the results.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, good idea!
But I guess as soon as I introduce any kind of ordering, I'll have to adjust the order in the assertions aswell, right? Or what do you mean by "changing the tests"?
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.
Oh I see what you mean. Yes I don't mind if the assertions change if the ordering becomes alphabetical.
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.
Hm, I'm not able to reproduce the original issue currently. I.e. all tests now pass on Python 3.12 at least.
If I understand correctly,
tox
should run the tests etc. for several python versions.However, if I try to run
tox
locally, I get the following error:This seems to be related to
importlib_metadata
changing stuff, but installing a different version (the proposed solution found by googling) does not work.How did you setup
tox
locally?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.
While I have still not run tox locally, I fixed the typing error related to
Set[...]
vsset[...]
. So hopefully, everything passes nowThere 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.
Sorry for the delay in replying. If you create a new virtual environment and then pip install tox into it, you should be able to then run it. The only thing is you'll need to make sure you have Python versions accessible for each version of Python you want to run it under. I would suggest just picking one and running that (I use pyenv for that).
E.g. running tox on 3.10 you can do
tox -epy310
.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.
Ah, I see. I somehow expected
tox
to switch python versions for. No idea why. :DSo, now the output should be stable, since I'm ordering both source and forbidden modules of a forbidden contract.