-
Notifications
You must be signed in to change notification settings - Fork 11
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
Allow other forms of "import lib" #25
Merged
Merged
Conversation
This file contains 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
If you don't add the -e for the VCS installs, that should work. |
Cheers, that does indeed help. I've manually tested with the forms I could think of (looks good) and compared the pip vendoring results (no changes compared to vendoring master). |
jku
pushed a commit
to jku/vendoring
that referenced
this pull request
Feb 2, 2021
Especially the first regex is problematic: it's greedy in that it eats newlines before and after but it does not allow comments or "as" keyword after the module name. * Don't match on newlines on both start and end (because then the next line can't do the same: Use re.MULTILINE instead so line starts and ends can be matched with ^ and $ * Make sure the first regex does not prevent other text after module name * No need to match whitespace greedily when one is enough This fixes the case: import a import a and the case import a as b and the case import a # with comment and makes the regexes a little simpler to read Fixes pradyunsg#29 Fixes pradyunsg#25
jku
force-pushed
the
fix-simple-import
branch
from
February 2, 2021 10:19
532d3b8
to
927af73
Compare
Especially the first regex is problematic: it's greedy in that it eats newlines before and after but it does not allow comments or "as" keyword after the module name. * Don't match on newlines on both start and end (because then the next line can't do the same: Use re.MULTILINE instead so line starts and ends can be matched with ^ and $ * Make sure the first regex does not prevent other text after module name * No need to match whitespace greedily when one is enough This fixes the case: import a import a and the case import a as b and the case import a # with comment and makes the regexes a little simpler to read Fixes pradyunsg#29 Fixes pradyunsg#25
jku
force-pushed
the
fix-simple-import
branch
from
February 2, 2021 10:22
927af73
to
c0ce3a3
Compare
pradyunsg
approved these changes
Feb 2, 2021
Thanks @jku! :) |
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.
Currently both of these won't be properly vendored:
Only require any whitespace after 'lib' like the other import-form
already does.
Fixes #24
I admit this has not been tested as well as I'd like since I cannot figure out an easy way to vendor unreleased code... Is there a trick to vendoring something from a git commit or a local dir? I've tried various things like using
-e git://github.com/org/project.git@commithash#egg=projectname
in vendoring.txt but nothing seems to actually work (the example fails with a pip bug pypa/pip#4390).