BUG: Disallow shadowed modulenames#25181
Merged
mattip merged 8 commits intonumpy:mainfrom Nov 19, 2023
Merged
Conversation
7 tasks
Member
Author
HaoZeke
commented
Nov 19, 2023
Comment on lines
+453
to
+462
| # gh-22819 -- begin | ||
| parser = make_f2py_parser() | ||
| args, comline_list = parser.parse_known_args(comline_list) | ||
| pyf_files, _ = filter_files("", "[.]pyf([.]src|)", comline_list) | ||
| # Checks that no existing modulename is defined in a pyf file | ||
| # TODO: Remove all this when scaninputline is replaced | ||
| if "-h" not in comline_list and args.module_name: # Can't check what doesn't exist yet, -h creates the pyf | ||
| modname = validate_modulename(pyf_files, args.module_name) | ||
| comline_list += ['-m', modname] # needed for the rest of scaninputline | ||
| # gh-22819 -- end |
Member
Author
Member
Author
|
@mattip, apart from the issues this closes, the PR is required for #25111, since the command invoked for building the modules used is
|
Member
|
Makes sense, thanks @HaoZeke |
Member
|
Backport needed if #25123 is to be backported. |
This was referenced Nov 30, 2023
Member
Member
Author
DimitriPapadopoulos
added a commit
to DimitriPapadopoulos/numpy
that referenced
this pull request
Apr 17, 2025
Asserting on a non-empty string literal will always pass This line had been added by numpy#25181 / 0f6e357 without any explanation. I believe it's an error because the assertion is a no-op. So remove it.
DimitriPapadopoulos
added a commit
to DimitriPapadopoulos/numpy
that referenced
this pull request
Apr 17, 2025
Asserting on a non-empty string literal will always pass This line had been added by numpy#25181 / 0f6e357 without any explanation. I believe it's an error because the assertion is a no-op. So remove it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is a better version of #25114.
Closes #22819. Closes #25182.
Enforces the following:
-mis passed with a.pyfin a-ccall, the name is ignored and taken from the.pyffile (the only logical option)-crun will only produce onepythonmodule, so there can only be one.pyffile-mis passed without-cand.pyffiles are present (new, BUG:f2pygenerates incorrect wrapper files when passed-mand a.pyf#25182)For the last point
-m blahis internally replaced with-m modnamefrom the.pyffile, so no additional (incorrect) wrappers are produced.There already is a note in the documentation, but this is a much better solution (and also paves the way for #25111). The documentation could probably use an update, and since this is technically a user facing change it might need a release note.