-
Notifications
You must be signed in to change notification settings - Fork 239
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
Update to pyparsing>=3.0.0 #480
Changes from 3 commits
0039779
478d8a0
b8e9b5c
c319f2a
45cf08f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,8 +16,8 @@ | |
ParseResults, | ||
QuotedString, | ||
ZeroOrMore, | ||
stringEnd, | ||
stringStart, | ||
Comment on lines
-19
to
-20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could check the version then import stringStart as string_start. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @henryiii Thanks for the suggestion. Regarding the check itself, I can check There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd be tempted to do:
Unlike Python version, you can't statically check There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @henryiii
There are other options such as using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you need a conditional import? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I am not sure whether "future release" will fall under 3.X.X or not. |
||
string_end, | ||
string_start, | ||
) | ||
|
||
from .specifiers import InvalidSpecifier, Specifier | ||
|
@@ -135,7 +135,7 @@ def serialize(self) -> str: | |
MARKER_ATOM = MARKER_ITEM | Group(LPAREN + MARKER_EXPR + RPAREN) | ||
MARKER_EXPR << MARKER_ATOM + ZeroOrMore(BOOLOP + MARKER_EXPR) | ||
|
||
MARKER = stringStart + MARKER_EXPR + stringEnd | ||
MARKER = string_start + MARKER_EXPR + string_end | ||
|
||
|
||
def _coerce_parse_result(results: Union[ParseResults, List[Any]]) -> List[Any]: | ||
|
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.
Why is this necessary?
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.
As a general note: Please include a body to your commit messages, describing why a change is being made.
https://chris.beams.io/posts/git-commit/#why-not-how
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.
@pradyunsg To enforce using the correct dependency versions. Installing
nox
->pytest
->packaging
->pyparsing<3
.https://github.com/moyiz/packaging/runs/4054317198?check_suite_focus=true
Same goes for
build
package.Edit: Updated commit messages accordingly. Thanks.
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.
But why does it matter? We're not running packaging during the lint step and even if we did nox would've installed it in a venv separate from nox itself.
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.
@layday
nox
indeed creates a virtualenv, butpyparsing
version seems to be overridden inpython -m pip install build twine
sincepackaging
is a dependency ofbuild
and the latest release forcespyparsing<3
. Thissession.install(".")
is required to enforce the current requirements ofpackaging
, rather than latest release.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.
That doesn't answer the why :)
I think I understand what is going on here. Because this project doesn't use a
src
-based tree, the copy ofpackaging
from the working directory takes precedence over the one from the nox venv. So withpackaging
now only supportingpyparsing >= 3
,build
crashes.Instead of pre- or re-installing
packaging
I would suggest using thebuild
console script, which would prevent thecwd
from being added to the Python path: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.
@layday Awesome catch, thanks!
Removed the re-installations in favor of the above console script.