Skip to content
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

Conda patch for None vs empty string change #33

Merged
merged 4 commits into from
Sep 12, 2021

Conversation

sarnold
Copy link

@sarnold sarnold commented Sep 12, 2021

So much (global) Python churn I have no idea why this changed; actually I was hoping you had an answer for that... Anyway, I dropped a patch for the conda recipe just in case. I haven't seen this issue crop up in conda-forge at all, so, go figure...

@sarnold
Copy link
Author

sarnold commented Sep 12, 2021

Hmm, I was busy the other day so I only tested the conda build, but now I'm seeing the same breakage (change) when running the usual tox environments in my local checkout; applying the patch makes everything green again. That said, it's not clear at all what the actual root cause is. Also it appears the conda patch isn't just for conda now...

* release workflow: restrict pypi upload to repo owner
* tox.ini: replace deprecated pep517 module, update deploy url

Signed-off-by: Stephen L Arnold <[email protected]>
@sarnold
Copy link
Author

sarnold commented Sep 12, 2021

tox -e py,dev,perf,deploy,check

...

Successfully installed pyre2-0.3.6 regex-2021.8.28
perf run-test: commands[2] | python tests/performance.py

+-----------------+---------------------------------------------------------------------------+------------+--------------+---------------+-------------+-----------------+----------------+
|Test             |Description                                                                |# total runs|``re`` time(s)|``re2`` time(s)|% ``re`` time|``regex`` time(s)|% ``regex`` time|
+=================+===========================================================================+============+==============+===============+=============+=================+================+
|Findall URI|Email|Find list of '([a-zA-Z][a-zA-Z0-9]*)://([^ /]+)(/[^ ]*)?|([^ @]+)@([^ @]+)'|2           |12.558        |0.065          |0.51%        |9.968            |0.65%           |
+-----------------+---------------------------------------------------------------------------+------------+--------------+---------------+-------------+-----------------+----------------+
|Replace WikiLinks|This test replaces links of the form [[Obama|Barack_Obama]] to Obama.      |100         |1.093         |1.342          |122.78%      |1.525            |88.00%          |
+-----------------+---------------------------------------------------------------------------+------------+--------------+---------------+-------------+-----------------+----------------+
|Remove WikiLinks |This test splits the data by the <page> tag.                               |100         |0.655         |0.310          |47.23%       |0.635            |48.74%          |
+-----------------+---------------------------------------------------------------------------+------------+--------------+---------------+-------------+-----------------+----------------+

(a few minutes later)

deploy run-test: commands[4] | bash -c 'gitchangelog $(git describe --abbrev=0)..'
v0.3.6-7-gbb60374
-----------------

Fix
~~~
- Apply emptygroups fix and remove conda-only patch, also. [Stephen L
  Arnold]

  * release workflow: restrict pypi upload to repo owner
  * tox.ini: replace deprecated pep517 module, update deploy url

Other
~~~~~
- Merge pull request #32 from JustAnotherArchivist/match-getitem.
  [Andreas van Cranenburgh]

  Make Match objects subscriptable
- Add test for Match subscripting. [JustAnotherArchivist]
- Make Match objects subscriptable. [JustAnotherArchivist]

  Fixes #31


check create: /home/nerdboy/src/pyre2-fresh/.tox/check
check installdeps: pip>=20.0.1, pytest
check installed: attrs==21.2.0,iniconfig==1.1.1,packaging==21.0,pluggy==1.0.0,py==1.10.0,pyparsing==2.4.7,pytest==6.2.5,toml==0.10.2
check run-test-pre: PYTHONHASHSEED='2525309259'
check run-test: commands[0] | pip install pyre2 --force-reinstall --prefer-binary -f dist/
Looking in links: dist/
Collecting pyre2
  Using cached pyre2-0.3.6-cp39-cp39-manylinux2010_x86_64.whl (909 kB)
Installing collected packages: pyre2
Successfully installed pyre2-0.3.6
check run-test: commands[1] | python -m unittest discover -f -s .
............................................................
----------------------------------------------------------------------
Ran 60 tests in 0.134s

OK
___________________________________ summary ____________________________________
  py: commands succeeded
  dev: commands succeeded
  perf: commands succeeded
  deploy: commands succeeded
  check: commands succeeded
  congratulations :)

@andreasvc andreasvc merged commit 8d853ab into andreasvc:master Sep 12, 2021
@andreasvc
Copy link
Owner

Hmm. I get the following with Python 3.7:

031 This one was formerly a None vs empty string difference until July 2021:
032
033     >>> re.search(r'((.*)*.)', 'a').groups()
034     ('a', '')
035     >>> re2.search(r'((.*)*.)', 'a').groups()
Expected:
    ('a', '')
Got:
    ('a', None)

Could it be that the behavior changed in Python 3.8+? Perhaps taking the test out is best if Python's behavior is inconsistent.

@andreasvc
Copy link
Owner

This seems to be related to #27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants