Update to pyparsing>=3.0.0 by moyiz · Pull Request #480 · pypa/packaging

pradyunsg

Add support to `pyparsing>=3.0.0`.
Changes required:
- `originalTextFor` -> `original_text_for`
- `stringEnd` -> `string_end`
- `stringStart` -> `string_start`

Update UT: `test_parseexception_error_msg` to check for `string_end`
instead of `stringEnd` in exception message.
Install current `packaging` and its dependencies during lint.
`nox` depends on `packaging`, by installing `nox` during lint phase,
`packaging` dependencies defined in working branch are overridden by
latest `packaging` release dependencies.
In this case, since the PR changes the constraints on `pyparsing`,
without a `session.install(".")` the incorrect `pyparsing` version will
be installed.
This ensures that we install the dependencies of current working branch
of `packaging`.
Similar to previous commit. `build` package depends on `packaging` and
installing it overrides the dependencies of current working branch by
the dependencies of latest `packaging` release.

henryiii

moyiz added a commit to moyiz/packaging that referenced this pull request

Oct 30, 2021
Support `pyparsing` 2 and 3.

Related changes in `pyparsing==3.0.0`:
- `originalTextFor` -> `original_text_for`
- `stringEnd` -> `string_end`
- `stringStart` -> `string_start`

Implemented according to this suggestion:
pypa#480 (comment)

Determine which attributres to import according to
`pyparsing.__version__`, and import pyparsing 2 attributes as 3.

Update UT: `test_parseexception_error_msg` to check for either
`string_end` or `stringEnd` in exception message.

moyiz added a commit to moyiz/packaging that referenced this pull request

Oct 30, 2021
Support `pyparsing` 2 and 3.

Related changes in `pyparsing==3.0.0`:
- `originalTextFor` -> `original_text_for`
- `stringEnd` -> `string_end`
- `stringStart` -> `string_start`

Implemented according to this suggestion:
pypa#480 (comment)

Determine which attributres to import according to
`pyparsing.__version__`, and import pyparsing 2 attributes as 3.

Update UT: `test_parseexception_error_msg` to check for either
`string_end` or `stringEnd` in exception message.

moyiz added a commit to moyiz/packaging that referenced this pull request

Oct 30, 2021
Support `pyparsing` 2 and 3.

Related changes in `pyparsing==3.0.0`:
- `originalTextFor` -> `original_text_for`
- `stringEnd` -> `string_end`
- `stringStart` -> `string_start`

Implemented according to this suggestion:
pypa#480 (comment)

Determine which attributres to import according to
`pyparsing.__version__`, and import pyparsing 2 attributes as 3.

Update UT: `test_parseexception_error_msg` to check for either
`string_end` or `stringEnd` in exception message.

moyiz added a commit to moyiz/packaging that referenced this pull request

Oct 31, 2021
Support `pyparsing` 2 and 3.

Related changes in `pyparsing==3.0.0`:
- `originalTextFor` -> `original_text_for`
- `stringEnd` -> `string_end`
- `stringStart` -> `string_start`

Implemented according to this suggestion:
pypa#480 (comment)

Determine which attributres to import according to
`pyparsing.__version__`, and import pyparsing 2 attributes as 3.

Update UT: `test_parseexception_error_msg` to check for either
`string_end` or `stringEnd` in exception message.

@moyiz

@brettcannon

moyiz added a commit to moyiz/packaging that referenced this pull request

Nov 2, 2021
See discussion in : pypa#480
`pyparsing` is backward compatible for now (synonyms for camel cased
attributes).
Fix unit test to accecpt either pyparsing 2 or 3 exception message.

@moyiz moyiz mentioned this pull request

Nov 2, 2021