-
-
Notifications
You must be signed in to change notification settings - Fork 454
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
src/tox.ini: Check that there are no .all imports from namespace packages #32879
Comments
This comment has been minimized.
This comment has been minimized.
New commits:
|
Commit: |
Author: Matthias Koeppe |
comment:4
It works well. I am positive with the branch. One small comment: I am dimly aware that there was a discussion somewhere(perhaps on sage-devel) on using two space characters (vs. one space character) to separate sentences. I don't remember the conclusion, but I feel uncomfortable with it, just like a typo. Hence please fix: - name: 'namespace_pkg_all_import: import from .all of a namespace package'
hint: |
Sage library code should not import from sage.PAC.KAGE.all when sage.PAC.KAGE is an implicit
- Hint: namespace package. Type import_statements("SOME_IDENTIFIER") to find a more specific import.
+ Hint: namespace package. Type import_statements("SOME_IDENTIFIER") to find a more specific import.
pattern: 'from\s+sage[.](categories|misc|rings|combinat|graphs|interfaces|libs)[.]all\s+import'
filePattern: '.*[.](py|pyx)$' |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:6
Thank you. |
Reviewer: Kwankyu Lee |
Changed branch from u/mkoeppe/src_tox_ini__check_that_there_are_no__all_imports_from_namespace_packages to |
Changed commit from |
comment:8
Imho, it is a very bad idea to introduce a check before it has been fully fixed. This just makes the linter useless. |
comment:9
Useless, I don't think so. Sorry for ruining the green linter checkmarks on the tickets though |
comment:10
I have to agree. Now the linter workflow is falling for each ticket and it's no longer clear if that's because the ticket introduced some new issues or because of the all imports. I propose to either remove the all imports soon or demote this check to a warning instead of an error (if that's possible with relint). |
comment:11
Replying to @tobiasdiez:
+1, help welcome |
comment:12
Sorry, but if you don't plan to work on this yourself I would say we should demote it for now to a warning and fully activate it later. |
We add the following test to the
relint
linting workflow:Library code should not import from
sage.PAC.KAGE.all
whensage.PAC.KAGE
is a namespace package (see #32501)CC: @kwankyu @fchapoton
Component: refactoring
Author: Matthias Koeppe
Branch:
928561e
Reviewer: Kwankyu Lee
Issue created by migration from https://trac.sagemath.org/ticket/32879
The text was updated successfully, but these errors were encountered: