-
Notifications
You must be signed in to change notification settings - Fork 89
Add ability to select path segments using Python re regexprs; follow on to PR#146 #177
Add ability to select path segments using Python re regexprs; follow on to PR#146 #177AlainLich wants to merge 16 commits into
Conversation
Recovered 1) tests/test_path_ext_py from PR submission 2) some github workflows used to validate PR submission
Follow-up PR: "Add ability to select path segments using Python re regexprs" dpath-maintainers#146 on June 1, 2021 Includes: - integration of extension on dpath-python - improvement of tests (under nose2, with scripts test/noseRunner to control code options) - improvement of documentation in README.rst Baseline for integration: commit ea64635 (tag: v2.1.1, origin/master, origin/HEAD, master, AL-master4merge) Merge: 702b5dd 38007df Author: moomoohk <moomoohk2@gmail.com> Date: Wed Nov 30 17:16:05 2022 +0200 Note: at this time, no test wrt. Github.Actions has been made (yet)
Resolved conflicts: dpath/segments.py dpath/version.py Testing to be redone!
- tests improved and running locally - documentation updated Follow-up PR: "Add ability to select path segments using Python re regexprs" dpath-maintainers#146 on June 1, 2021 Baseline for merge: commit 45b3488 (tag: v2.1.2, origin/master, origin/HEAD, master) Author: moomoohk <2220203+moomoohk@users.noreply.github.com> Date: Mon Dec 5 09:52:05 2022 +0200
...ng action manually
...on enhancements 1) suppress dependency on mock now integrated as unittest.mock 2) avoids warnings concerning invalid escape sequences: either use raw strings or use double backslash: testing both 3) detailed the issue of such escape sequences in re.regexp in README.rst, giving example of both techniques No change in .yml: rerunning should resolve identified issues
...path for pypy - Improved Github actions (clean up, test under pypy3) - formatting in accordance with Flake8, deal with errors diagnosed by Flake but accepted by python3 - moved test tools to dir test-utils - tox.ini, flake.ini: avoid spurious diagnostics
...ing StringMatcher capability: 1) supports extension by re.regex (re.Pattern.match) 2) supports duck typed Duck_StringMatcher derived classes which permit user defined pattern matcher 3) included tests and documenation 4) dealt with Flake8 diagnostics Also found a random rare error in test_segments.test_view, left Pdb obtained information in the source file (see bottom of tests/test_segments.py). This corresponds with an unrealistic situation random generated by hypothesis, not easily reproducible for lack of random seed.
...ngMatcher extension
AlainLich
commented
Jan 9, 2023
Hi @moomoohk
-
after looking at yesterday's tests, failure was apparently caused by lack of support for typing.Protocol, which implements https://peps.python.org/pep-0544/ , because pypy's version was older than the one I have been using.
-
I am preparing an improved version that supports both PEP-544 compliant and ignorant compilers, with a little bit more work for the user in the latter case.
-
Apparently most of the work TBD is in the testing, so don't expect a revised version before next week-end.
moomoohk
commented
Jan 10, 2023
Hi Alain,
I've cleared enough from the backlog and now I'd like to focus on your PR.
After reviewing the changes you've made it's clear a lot of work has been put in and that's much appreciated.
That said, I feel that a lot of the changes included aren't within the scope of the feature addition you're proposing.
If the core functionality (adding regexes to paths) works well enough then I'd like to restructure this PR. I hope that's ok with you!
Perhaps the other changes can be considered separately.
Thanks.
AlainLich
commented
Jan 10, 2023
via email
AlainLich
commented
Jan 11, 2023
via email
Deals with - issues testing with pypy (an possibly some older Pythons) - flake8 diagnostics Other developments to go to separate PR
AlainLich
commented
Jan 12, 2023
Hi @moomoohk
a) this is fine, do you expect me to do anything?
b) while you are on this, could you make your workflow "deploy" dependent on your user name; the way things are set up now, each time I pull master for synchronising (and if the version has changed), it launches (under my name) and
fails as it should... and I get some spurious mail. ( https://github.com/AlainLich/dpath-python/actions/runs/3900678773)
Something like the following should work (not tried):
deploy:
...
# Check that this only occurs on maintainer repo
if: ${{ github.actor == "dpath-maintainers" }}
Have a good day :-)
moomoohk
commented
Apr 5, 2023
Hi Alain
Hi @moomoohk
a) this is fine, do you expect me to do anything? b) while you are on this, could you make your workflow "deploy" dependent on your user name; the way things are set up now, each time I pull master for synchronising (and if the version has changed), it launches (under my name) and fails as it should... and I get some spurious mail. ( https://github.com/AlainLich/dpath-python/actions/runs/3900678773)
Something like the following should work (not tried):
deploy: ... # Check that this only occurs on maintainer repo if: ${{ github.actor == "dpath-maintainers" }}Have a good day :-)
Hi Alain,
I might have some time to go through your changes over the next few days.
I would much appreciate if you could open a separate PR/restructure this one to include the necessary changes for your proposed features.
I'll be glad to review miscellaneous infrastructure changes in a separate PR.
As it stands, the miscellaneous changes are blocking your feature.
Thanks and regards
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.
What is this check needed for?
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.
Dpath's minimum supported version is Python 3.7 making this check redundant
AlainLich
commented
Apr 5, 2023
Hi @moomoohk,
I will try to look into this before the end of next week-end. I will send you a few questions about what to keep in the mean time. Will keep the bare minimum for the feature to work, and for tests, and prepare a PR based on current master commit.
For now:
a) do you want to always enable the feature ? to allow enabling/disablig by DPATH_ACCEPT_RE_REGEXP ?
b) I will review tests I have added for their usefulness
Regards
AlainLich
commented
Apr 9, 2023
Hi @moomoohk
following your remarks, I submitted PR #186 as replacement for this one, with only required changes. This PR #177 can be closed.
You were right to spot not needed stuff, some that can be assumed for Python >= 3.7, others that were left from my exercise with duck-typed generalization.
Regards
Alain
moomoohk
commented
Apr 14, 2023
May we close this PR for the time being?
Hi, this is a follow-on of my previous PR (#146) on same subject; apparently it was simpler for me to use a different branch.
This has run Action https://github.com/AlainLich/dpath-python/actions/runs/3684590771 in my branch
AL-master4merge. I have added tests exercising this with most functions, and documented inREADME.rstAll details are in the list of commits, including documentation, tests,...
I hope this suits your needs, let me know if there are still issues for merging in the main baseline.