Code Monkey home page Code Monkey logo

pyre2's Introduction

pyre2: Python RE2 wrapper for linear-time regular expressions

Build CI Status Release CI Status GitHub tag (latest SemVer, including pre-release) Conda CI Status License Python version version platforms downloads

pyre2 is a Python extension that wraps Google's RE2 regular expression library. The RE2 engine compiles (strictly) regular expressions to deterministic finite automata, which guarantees linear-time behavior.

Intended as a drop-in replacement for re. Unicode is supported by encoding to UTF-8, and bytes strings are treated as UTF-8 when the UNICODE flag is given. For best performance, work with UTF-8 encoded bytes strings.

Normal usage for Linux/Mac/Windows:

$ pip install pyre2

Requirements for building the C++ extension from the repo source:

  • A build environment with gcc or clang (e.g. sudo apt-get install build-essential)
  • Build tools and libraries: RE2, pybind11, and cmake installed in the build environment.
    • On Ubuntu/Debian: sudo apt-get install build-essential cmake ninja-build python3-dev cython3 pybind11-dev libre2-dev
    • On Gentoo, install dev-util/cmake, dev-python/pybind11, and dev-libs/re2
    • For a venv you can install the pybind11, cmake, and cython packages from PyPI

On MacOS, use the brew package manager:

$ brew install -s re2 pybind11

On Windows use the vcpkg package manager:

$ vcpkg install re2:x64-windows pybind11:x64-windows

You can pass some cmake environment variables to alter the build type or pass a toolchain file (the latter is required on Windows) or specify the cmake generator. For example:

$ CMAKE_GENERATOR="Unix Makefiles" CMAKE_TOOLCHAIN_FILE=clang_toolchain.cmake tox -e deploy

For development, get the source:

$ git clone git://github.com/andreasvc/pyre2.git
$ cd pyre2
$ make install

An alternative to the above is provided via the conda recipe (use the miniconda installer if you don't have conda installed already).

The stated goal of this module is to be a drop-in replacement for re, i.e.:

try:
    import re2 as re
except ImportError:
    import re

That being said, there are features of the re module that this module may never have; these will be handled through fallback to the original re module:

  • lookahead assertions (?!...)
  • backreferences, e.g., \\1 in search pattern
  • possessive quantifiers *+, ++, ?+, {m,n}+
  • atomic groups (?>...)
  • \W and \S not supported inside character classes

On the other hand, unicode character classes are supported (e.g., \p{Greek}). Syntax reference: https://github.com/google/re2/wiki/Syntax

However, there are times when you may want to be notified of a failover. The function set_fallback_notification determines the behavior in these cases:

try:
    import re2 as re
except ImportError:
    import re
else:
    re.set_fallback_notification(re.FALLBACK_WARNING)

set_fallback_notification takes three values: re.FALLBACK_QUIETLY (default), re.FALLBACK_WARNING (raise a warning), and re.FALLBACK_EXCEPTION (raise an exception).

Consult the docstrings in the source code or interactively through ipython or pydoc re2 etc.

Python bytes and unicode strings are fully supported, but note that RE2 works with UTF-8 encoded strings under the hood, which means that unicode strings need to be encoded and decoded back and forth. There are two important factors:

  • whether a unicode pattern and search string is used (will be encoded to UTF-8 internally)
  • the UNICODE flag: whether operators such as \w recognize Unicode characters.

To avoid the overhead of encoding and decoding to UTF-8, it is possible to pass UTF-8 encoded bytes strings directly but still treat them as unicode:

In [18]: re2.findall(u'\w'.encode('utf8'), u'Mötley Crüe'.encode('utf8'), flags=re2.UNICODE)
Out[18]: ['M', '\xc3\xb6', 't', 'l', 'e', 'y', 'C', 'r', '\xc3\xbc', 'e']
In [19]: re2.findall(u'\w'.encode('utf8'), u'Mötley Crüe'.encode('utf8'))
Out[19]: ['M', 't', 'l', 'e', 'y', 'C', 'r', 'e']

However, note that the indices in Match objects will refer to the bytes string. The indices of the match in the unicode string could be computed by decoding/encoding, but this is done automatically and more efficiently if you pass the unicode string:

>>> re2.search(u'ü'.encode('utf8'), u'Mötley Crüe'.encode('utf8'), flags=re2.UNICODE)
<re2.Match object; span=(10, 12), match='\xc3\xbc'>
>>> re2.search(u'ü', u'Mötley Crüe', flags=re2.UNICODE)
<re2.Match object; span=(9, 10), match=u'\xfc'>

Finally, if you want to match bytes without regard for Unicode characters, pass bytes strings and leave out the UNICODE flag (this will cause Latin 1 encoding to be used with RE2 under the hood):

>>> re2.findall(br'.', b'\x80\x81\x82')
['\x80', '\x81', '\x82']

Performance is of course the point of this module, so it better perform well. Regular expressions vary widely in complexity, and the salient feature of RE2 is that it behaves well asymptotically. This being said, for very simple substitutions, I've found that occasionally python's regular re module is actually slightly faster. However, when the re module gets slow, it gets really slow, while this module buzzes along.

In the below example, I'm running the data against 8MB of text from the colossal Wikipedia XML file. I'm running them multiple times, being careful to use the timeit module. To see more details, please see the performance script.

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 6.262 0.131 2.08% 5.119 2.55%
Replace WikiLinks This test replaces links of the form [[Obama|Barack_Obama]] to Obama. 100 4.374 0.815 18.63% 1.176 69.33%
Remove WikiLinks This test splits the data by the <page> tag. 100 4.153 0.225 5.43% 0.537 42.01%

Feel free to add more speed tests to the bottom of the script and send a pull request my way!

The tests show the following differences with Python's re module:

  • The $ operator in Python's re matches twice if the string ends with \n. This can be simulated using \n?$, except when doing substitutions.
  • The pyre2 module and Python's re may behave differently with nested groups. See tests/test_emptygroups.txt for the examples.

Please report any further issues with pyre2.

If you would like to help, one thing that would be very useful is writing comprehensive tests for this. It's actually really easy:

  • Come up with regular expression problems using the regular python 're' module.
  • Write a session in python traceback format Example.
  • Replace your import re with import re2 as re.
  • Save it with as test_<name>.txt in the tests directory. You can comment on it however you like and indent the code with 4 spaces.

This code builds on the following projects (in chronological order):

pyre2's People

Contributors

alec avatar andreasvc avatar axiak avatar itsadok avatar justanotherarchivist avatar messense avatar moreati avatar offlinehacker avatar podhmo avatar sarnold avatar socketpair avatar sunu avatar yoav-orca avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pyre2's Issues

re2.sub replacements with a match of "(.*)" hangs forever

Python version: 3.6
pyre2 version: 0.3.3

The failing test case is:

import re, re2
assert re.sub("(.*)", "\\1;replacement", "original") == "original;replacement"
assert re2.sub("(.*)", "\\1;replacement", "original") == "original;replacement"

The first of these (using python's re) works. The second (using re2) hangs forever.

I think the problem is that https://github.com/andreasvc/pyre2/blob/master/src/pattern.pxi#L537-L562 loops forever if count is 0, and the match will match every time you try to replace (for example, the .* in the example above). This means we never hit either of the break statements.

Additionally, we have a preference for a "force re2" mode which would use re2 behaviour even if we have a backreference. We're migrating from the original facebook pyre2 to this module because its much more actively maintained (thank you!) and available on pypi. Given we're not building a library, we don't need a drop-in replacement for python's re and would prefer the (presumably more performant) option of purely using re2. That might also be an alternate route to unblock us on this issue.

issue installing on python 3.11

    778 | #include "re2/stringpiece.h"
        |          ^~~~~~~~~~~~~~~~~~~
  compilation terminated.
  ninja: build stopped: subcommand failed.
  Traceback (most recent call last):
    File "/home/admin/anaconda3/envs/py3.11/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
      main()
    File "/home/admin/anaconda3/envs/py3.11/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/admin/anaconda3/envs/py3.11/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 249, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 413, in build_wheel
      return self._build_with_temp_dir(['bdist_wheel'], '.whl',
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 398, in _build_with_temp_dir
      self.run_setup()
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 335, in run_setup
      exec(code, locals())
    File "<string>", line 116, in <module>
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 87, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1208, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 325, in run
      self.run_command("build")
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1208, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 132, in run
      self.run_command(cmd_name)
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1208, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 84, in run
      _build_ext.run(self)
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
      _build_ext.build_ext.run(self)
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
      self.build_extensions()
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
      _build_ext.build_ext.build_extensions(self)
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 468, in build_extensions
      self._build_extensions_serial()
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 494, in _build_extensions_serial
      self.build_extension(ext)
    File "<string>", line 111, in build_extension
    File "/home/admin/anaconda3/envs/py3.11/lib/python3.11/subprocess.py", line 413, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--verbose']' returned non-zero exit status 1.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyre2
Building wheel for lxml (setup.py) ... error
error: subprocess-exited-with-error

yum install broken on manylinux/cibuildwheel used in main.yml

Apparently there was some recent churn due to centos EOL so the yum command is broken in your ci builds (right after your last tag build). Supposedly this is "fixed" in the latest cibuildwheel release but now the yum command fails with No package re2-devel available. I tried bumping the manylinux image to latest but that also fails. I've never used cibuildwheel or that other stuff before so I'm out of ideas.

c++ 2011 compiler requirement error

Idk if this is the right place for this.

I was getting an error when installing:

/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

Adding '-std=c++11' to the extra_compile_args variable in the setup.py file seems to solve that

Version of RE2 being wrapped?

This is not a proper issue, just a question about which version of re2 is being wrapped.

Based on some log statements that appeared, my guess is that the re2 version is 2016-XX-XX or older, but I'm not positive. Where in the code is that specified or computed?

Thanks

Test issues with current test runners

For the various repackaging efforts (pep517, cmake, etc) the legacy test driver in setup.py got removed, mainly because all the current "best practice" guidance says "use a test runner like pytest or xxx" instead of through setup.py and I started running tests via nose or python unittest. I think the main issue left is the legacy tests were written to run from the tests subdirectory instead of the top-level project dir.

What works:

  $ python -m unittest discover -v tests/

BUT the python doctest module has no discovery and needs to be run from the tests dir.

  $ nosetests -sx tests/re2_test.py
  $ nosetests -sx tests/test_re.py

will run tests on the *.txt targets and then the same tests as unittest discover but does not run/show the doctests found by python -m doctest when run in the tests directory.

  $ cd tests/
  $ python -m unittest discover -v .
  $ python -m doctest -v *.txt

will find all the working tests, however, using pytest/nosetests to discover any actual tests from the top-level project directory fails on several tests:

pytest --doctest-glob=*.txt tests/

(runs the doc tests)

...

=========================== short test summary info ============================
FAILED tests/test_re.py::ReTests::test_bug_3629 - re.error: invalid perl oper...
FAILED tests/test_re.py::ReTests::test_bug_725149 - re.error: invalid perl op...
FAILED tests/test_re.py::ReTests::test_ignore_case - re.error: Backreferences...
FAILED tests/test_re.py::ReTests::test_inline_flags - re.error: invalid perl ...
FAILED tests/test_re.py::ReTests::test_non_consuming - re.error: invalid perl...
FAILED tests/test_re.py::ReTests::test_re_groupref - re.error: Backreferences...
FAILED tests/test_re.py::ReTests::test_re_groupref_exists - re.error: invalid...
================== 7 failed, 67 passed, 11 warnings in 3.33s ===================

Oddly, pytest can run doctests with an ignore:

$ pytest --ignore=tests/test_re.py --doctest-glob=*.txt tests/
============================= test session starts ==============================
platform linux -- Python 3.8.7rc1, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
rootdir: /home/nerdboy/src/pyre2-sdist
collected 14 items                                                             

tests/charliterals.txt .                                                 [  7%]
tests/count.txt .                                                        [ 14%]
tests/emptygroups.txt .                                                  [ 21%]
tests/findall.txt .                                                      [ 28%]
tests/finditer.txt .                                                     [ 35%]
tests/match_expand.txt .                                                 [ 42%]
tests/mmap.txt .                                                         [ 50%]
tests/namedgroups.txt .                                                  [ 57%]
tests/pattern.txt .                                                      [ 64%]
tests/re2_test.py .                                                      [ 71%]
tests/search.txt .                                                       [ 78%]
tests/split.txt .                                                        [ 85%]
tests/sub.txt .                                                          [ 92%]
tests/unicode.txt .                                                      [100%]

=============================== warnings summary ===============================
tests/charliterals.txt::charliterals.txt
tests/re2_test.py::testall
  <doctest charliterals.txt[10]>:1: DeprecationWarning: invalid escape sequence \9

tests/charliterals.txt::charliterals.txt
tests/re2_test.py::testall
  <doctest charliterals.txt[17]>:1: DeprecationWarning: invalid escape sequence \9

tests/re2_test.py::testall
tests/sub.txt::sub.txt
  <doctest sub.txt[5]>:1: DeprecationWarning: invalid escape sequence \(

tests/re2_test.py::testall
tests/search.txt::search.txt
  <doctest search.txt[2]>:1: DeprecationWarning: invalid escape sequence \d

tests/re2_test.py::testall
tests/search.txt::search.txt
  <doctest search.txt[3]>:1: DeprecationWarning: invalid escape sequence \d

tests/re2_test.py::testall
  <doctest unicode.txt[24]>:1: UserWarning: WARNING: Using re module. Reason: \W and \S not supported inside character classes

-- Docs: https://docs.pytest.org/en/stable/warnings.html
======================= 14 passed, 11 warnings in 1.67s ========================

Increasing re2 DFA memory?

I am getting this error: re2/dfa.cc:469: DFA out of memory: prog size 36240 mem 2625198. How do I increase the memory allowed by re2?

re2 is two times slower than re in this scenario

Environment:

  • Python 3.7.7 on MacOS 10.15.3(Catalina)
  • Fresh install of re2.

Scenario:

I have a blacklist file of IPs from where I want to extract all the IPs to a list for my use case. The list contains roughly 32K IPs and contains a variable header. I extracted all the IPs using a simple regex for IP where I am sure that all the IPs are valid.

Code:

import re2

re_ip_search = re2.compile(r'\d+\.\d+\.\d+\.\d+')
blacklist_file = 'bi_ssh_0_1d.ipset'

with open(blacklist_file, 'r') as file:
    lines = [line.rstrip('\n') for line in file]

ip_list = list(filter(re_ip_search.match, lines))

Benchmark:

I used timeit to benchmark the performance:

from timeit import timeit
exec_time = timeit('list(filter(re_ip_search.match, lines))', 
                    number=1, setup = 'from __main__ import re_ip_search, lines')

print(exec_time*1000)   

Result

re -> 14.20 ms (avg)
re2 -> 28.6 ms (avg)

Why is re2 slower by two times in this case. Am I missing something?

RFC: cmake, cython, and hard-coded paths/flags/tests

For several reasons I'm still on a modernize/cleanup kick, mainly for clean CI on the 3 "main" platforms, but also:

  • deprecated practices/EOL python versions
  • minimal/sane defaults and easy(ish) toolchain/flag configuration
  • reasonable integration with OS package managers
  • full cython integration with the above

I have 2 working branches that basically take opposite approaches; one uses scikit-build to abstract away almost everything (with a workaround for the non-working cython bits) and the other uses a minimal build_ext wrapper for cmake.

  1. https://github.com/freepn/py-re2/tree/skbuild
  2. https://github.com/freepn/py-re2/tree/cmake-minimal

The first one takes the usual cmake overrides for toolchain files, external flags, pre-init cache files, etc, but the second one actually seems to short-circuit most of the cmake magic (with a super minimal cmake file).

I'll add more here later...

Compiler flag -march=native could make lib processor dependent

This is especially dangerous when you build your app into docker container (or another virtualization type). The lib will be built with the optimisation of CI-server processor and they could be not compatible with the processor of production machine.

From the gcc docs (http://gcc.gnu.org/onlinedocs/gcc/x86-Options.html):

‘native’
This selects the CPU to generate code for at compilation time by determining the processor type of the compiling machine. Using -march=native enables all instruction subsets supported by the local machine (hence the result might not run on different machines). Using -mtune=native produces code optimized for the local machine under the constraints of the selected instruction set.

We have encountered this problem and got kernel errors:

Sep 17 12:16:44 cryprox-myt-01.aab.yandex.net kernel: traps: python[61336] trap invalid opcode ip:7fa7f2ebfbdb sp:7fff5c14ac20 error:0
Sep 17 12:16:44 cryprox-myt-01.aab.yandex.net kernel:  in re2.so[7fa7f2e87000+43000]

Removing flag solved the problem

win32 wheels

Currently it looks like wheels are not built for win32 (skipped in CI). Was there a reason I should be aware of for this, and would it be possible to support this in a new release?

flake8 and coverage.py syntax errors

eg:

src/re2.pyx:106:9: E999 SyntaxError: invalid syntax

This didn't happen with older flake8 versions; the coverage thing is new. There are some issue/so discussions about cython and coverage.py and projects using the src/ layout. That last bit is usually src/<name> and isn't (by itself) a problem, except the cython coverage plugin apparently gets confused with includes and src/ without any __init__.py etc. :/

I'll keep looking but for now coverage is not working and flake8 config has E999 added to ignore list.

orphaned release tag(?) not on master: commit 2a14413df10f00d00e54da6d231aac54eee4ca4d (tag: v0.3.1)

$ git clone https://github.com/andreasvc/pyre2.git pyre2-fresh && cd pyre2-fresh
$ git log
commit a3e13fdfda5cd99aad5827b8fe2b643601bd60c5 (HEAD -> master, origin/master, origin/HEAD)
Author: Andreas van Cranenburgh <[email protected]>
Date:   Tue Oct 27 21:41:10 2020 +0100

    change package name for pypi

commit 1ef0f0f7725ed553308511d28c9d79d757605ed3 (tag: v0.3)
Author: Andreas van Cranenburgh <[email protected]>
Date:   Tue Oct 27 21:22:52 2020 +0100

    bump version

commit 8a90db3a09d9239cbebeca7e63df41e94fb29e12
Merge: cfc6f2a 61659eb
Author: Andreas van Cranenburgh <[email protected]>
Date:   Tue Oct 27 21:16:24 2020 +0100

    Merge pull request #14 from yoav-orca/master
    
    Support building wheels automatically using github actions

$ git fetch --all
$ git fetch --tags
$ git log --all
commit 2a14413df10f00d00e54da6d231aac54eee4ca4d (tag: v0.3.1)
Author: Andreas van Cranenburgh <[email protected]>
Date:   Tue Oct 27 21:57:29 2020 +0100

    bump version

commit a3e13fdfda5cd99aad5827b8fe2b643601bd60c5 (HEAD -> master, origin/master, origin/HEAD)
Author: Andreas van Cranenburgh <[email protected]>
Date:   Tue Oct 27 21:41:10 2020 +0100

    change package name for pypi

commit 1ef0f0f7725ed553308511d28c9d79d757605ed3 (tag: v0.3)
Author: Andreas van Cranenburgh <[email protected]>
Date:   Tue Oct 27 21:22:52 2020 +0100

    bump version

Tests failing

I am attempting to build this package for my use.

The versions that I am using are the following:

https://github.com/google/re2.git@2019-09-01
https://github.com/andreasvc/pyre2.git@master(3e01eba6ba3eabd1359ef5e16c938c8866deea70)

The error messages seem to be from https://github.com/google/re2/blob/567327038cdd01ed8f2a0e3247b6cd8138dc6356/re2/regexp.cc#L508

Is there a specific version of re2 that is needed?

Test outcomes

======================================================================
ERROR: test_bug_3629 (test_re.ReTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/local/home/cladam/workspaces/hcs/src/Python-pyre2/third-party-src/tests/test_re.py", line 128, in test_bug_3629
    re.compile("(?P<quote>)(?(quote))")
  File "src/compile.pxi", line 6, in re2.compile
    p = _compile(pattern, flags, max_mem)
  File "src/compile.pxi", line 87, in re2._compile
    raise RegexError(error_msg)
RegexError: invalid perl operator: (?(

======================================================================
ERROR: test_bug_725149 (test_re.ReTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/local/home/cladam/workspaces/hcs/src/Python-pyre2/third-party-src/tests/test_re.py", line 589, in test_bug_725149
    self.assertEqual(re.match('(a)(?:(?=(b)*)c)*', 'abb').groups(),
  File "src/re2.pyx", line 162, in re2.match
    return compile(pattern, flags).match(string)
  File "src/compile.pxi", line 6, in re2.compile
    p = _compile(pattern, flags, max_mem)
  File "src/compile.pxi", line 87, in re2._compile
    raise RegexError(error_msg)
RegexError: invalid perl operator: (?=

======================================================================
ERROR: test_flags (test_re.ReTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/local/home/cladam/workspaces/hcs/src/Python-pyre2/third-party-src/tests/test_re.py", line 476, in test_flags
    self.assertNotEqual(re.compile('^pattern$', flag), None)
  File "src/compile.pxi", line 6, in re2.compile
    p = _compile(pattern, flags, max_mem)
  File "src/compile.pxi", line 42, in re2._compile
    return fallback(original_pattern, flags, "re.LOCALE not supported")
  File "src/compile.pxi", line 19, in re2._compile.fallback
    raise RegexError(error_msg)
RegexError: re.LOCALE not supported

======================================================================
ERROR: test_ignore_case (test_re.ReTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/local/home/cladam/workspaces/hcs/src/Python-pyre2/third-party-src/tests/test_re.py", line 417, in test_ignore_case
    self.assertEqual(re.match(r"((a)\s\2)", "a a", re.I).group(1), "a a")
  File "src/re2.pyx", line 162, in re2.match
    return compile(pattern, flags).match(string)
  File "src/compile.pxi", line 6, in re2.compile
    p = _compile(pattern, flags, max_mem)
  File "src/compile.pxi", line 56, in re2._compile
    return fallback(original_pattern, flags, "Backreferences not supported")
  File "src/compile.pxi", line 19, in re2._compile.fallback
    raise RegexError(error_msg)
RegexError: Backreferences not supported

======================================================================
ERROR: test_inline_flags (test_re.ReTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/local/home/cladam/workspaces/hcs/src/Python-pyre2/third-party-src/tests/test_re.py", line 671, in test_inline_flags
    p = re.compile('(?iu)' + upper_char)
  File "src/compile.pxi", line 6, in re2.compile
    p = _compile(pattern, flags, max_mem)
  File "src/compile.pxi", line 87, in re2._compile
    raise RegexError(error_msg)
RegexError: invalid perl operator: (?iu

======================================================================
ERROR: test_non_consuming (test_re.ReTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/local/home/cladam/workspaces/hcs/src/Python-pyre2/third-party-src/tests/test_re.py", line 397, in test_non_consuming
    self.assertEqual(re.match("(a(?=\s[^a]))", "a b").group(1), "a")
  File "src/re2.pyx", line 162, in re2.match
    return compile(pattern, flags).match(string)
  File "src/compile.pxi", line 6, in re2.compile
    p = _compile(pattern, flags, max_mem)
  File "src/compile.pxi", line 87, in re2._compile
    raise RegexError(error_msg)
RegexError: invalid perl operator: (?=

======================================================================
ERROR: test_re_groupref (test_re.ReTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/local/home/cladam/workspaces/hcs/src/Python-pyre2/third-party-src/tests/test_re.py", line 293, in test_re_groupref
    self.assertEqual(re.match(r'^(\|)?([^()]+)\1$', '|a|').groups(),
  File "src/re2.pyx", line 162, in re2.match
    return compile(pattern, flags).match(string)
  File "src/compile.pxi", line 6, in re2.compile
    p = _compile(pattern, flags, max_mem)
  File "src/compile.pxi", line 56, in re2._compile
    return fallback(original_pattern, flags, "Backreferences not supported")
  File "src/compile.pxi", line 19, in re2._compile.fallback
    raise RegexError(error_msg)
RegexError: Backreferences not supported

======================================================================
ERROR: test_re_groupref_exists (test_re.ReTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/local/home/cladam/workspaces/hcs/src/Python-pyre2/third-party-src/tests/test_re.py", line 268, in test_re_groupref_exists
    self.assertEqual(re.match('^(\()?([^()]+)(?(1)\))$', '(a)').groups(),
  File "src/re2.pyx", line 162, in re2.match
    return compile(pattern, flags).match(string)
  File "src/compile.pxi", line 6, in re2.compile
    p = _compile(pattern, flags, max_mem)
  File "src/compile.pxi", line 87, in re2._compile
    raise RegexError(error_msg)
RegexError: invalid perl operator: (?(

======================================================================
ERROR: test_special_escapes (test_re.ReTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/local/home/cladam/workspaces/hcs/src/Python-pyre2/third-party-src/tests/test_re.py", line 360, in test_special_escapes
    "abcd abc bcd bx", re.LOCALE).group(1), "bx")
  File "src/re2.pyx", line 156, in re2.search
    return compile(pattern, flags).search(string)
  File "src/compile.pxi", line 6, in re2.compile
    p = _compile(pattern, flags, max_mem)
  File "src/compile.pxi", line 42, in re2._compile
    return fallback(original_pattern, flags, "re.LOCALE not supported")
  File "src/compile.pxi", line 19, in re2._compile.fallback
    raise RegexError(error_msg)
RegexError: re.LOCALE not supported

======================================================================
FAIL: test_dollar_matches_twice (test_re.ReTests)
$ matches the end of string, and just before the terminating
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/local/home/cladam/workspaces/hcs/src/Python-pyre2/third-party-src/tests/test_re.py", line 682, in test_dollar_matches_twice
    self.assertEqual(pattern.sub('#', 'a\nb\n'), 'a\nb#\n#')
AssertionError: 'a\nb\n#' != 'a\nb#\n#'

Build fails with Python 3.7.0

# ~/ds-venv/bin/pip install re2   
Collecting re2
  Downloading https://files.pythonhosted.org/packages/1d/93/17606ff043e3c27cfd50561b906142de1a8debeb958a3ab4226ca66d195e/re2-0.2.22.tar.gz (1.9MB)
    100% |████████████████████████████████| 1.9MB 24.1MB/s 
Installing collected packages: re2
  Running setup.py install for re2 ... error
    Complete output from command /home/grab/ds-venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-dhg3zzna/re2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-8wgk9u0f/install-record.txt --single-version-externally-managed --compile --install-headers /home/grab/ds-venv/include/site/python3.7/re2:
    running install
    running build
    running build_ext
    building 're2' extension
    creating build
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/src
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include -I/home/grab/ds-venv/include -I/home/grab/.pyenv/versions/3.7.0/include/python3.7m -c src/re2.cpp -o build/temp.linux-x86_64-3.7/src/re2.o
    src/re2.cpp: In function ‘PyObject* __pyx_f_3re2_unicode_to_bytestring(PyObject*, int*)’:
    src/re2.cpp:1429:17: warning: ‘PyObject* PyUnicode_EncodeUTF8(const Py_UNICODE*, Py_ssize_t, const char*)’ is deprecated [-Wdeprecated-declarations]
         __pyx_t_2 = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(__pyx_v_pystring), PyUnicode_GET_SIZE(__pyx_v_pystring), __pyx_k__strict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                     ^~~~~~~~~~~~~~~~~~~~
    In file included from /home/grab/.pyenv/versions/3.7.0/include/python3.7m/Python.h:80:0,
                     from src/re2.cpp:4:
    /home/grab/.pyenv/versions/3.7.0/include/python3.7m/unicodeobject.h:1320:23: note: declared here
     PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF8(
                           ^~~~~~~~~~~~~~~~~~~~
    src/re2.cpp:1429:131: warning: ‘PyObject* PyUnicode_EncodeUTF8(const Py_UNICODE*, Py_ssize_t, const char*)’ is deprecated [-Wdeprecated-declarations]
         __pyx_t_2 = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(__pyx_v_pystring), PyUnicode_GET_SIZE(__pyx_v_pystring), __pyx_k__strict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                                                                                                                       ^
    In file included from /home/grab/.pyenv/versions/3.7.0/include/python3.7m/Python.h:80:0,
                     from src/re2.cpp:4:
    /home/grab/.pyenv/versions/3.7.0/include/python3.7m/unicodeobject.h:1320:23: note: declared here
     PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF8(
                           ^~~~~~~~~~~~~~~~~~~~
    src/re2.cpp: In function ‘int __pyx_f_3re2_pystring_to_bytestring(PyObject*, char**, Py_ssize_t*)’:
    src/re2.cpp:1502:13: warning: ‘int PyObject_AsCharBuffer(PyObject*, const char**, Py_ssize_t*)’ is deprecated [-Wdeprecated-declarations]
       __pyx_r = PyObject_AsCharBuffer(__pyx_v_pystring, ((const char* *)__pyx_v_cstring), __pyx_v_length);
                 ^~~~~~~~~~~~~~~~~~~~~
    In file included from /home/grab/.pyenv/versions/3.7.0/include/python3.7m/Python.h:128:0,
                     from src/re2.cpp:4:
    /home/grab/.pyenv/versions/3.7.0/include/python3.7m/abstract.h:471:17: note: declared here
     PyAPI_FUNC(int) PyObject_AsCharBuffer(PyObject *obj,
                     ^~~~~~~~~~~~~~~~~~~~~
    src/re2.cpp:1502:101: warning: ‘int PyObject_AsCharBuffer(PyObject*, const char**, Py_ssize_t*)’ is deprecated [-Wdeprecated-declarations]
       __pyx_r = PyObject_AsCharBuffer(__pyx_v_pystring, ((const char* *)__pyx_v_cstring), __pyx_v_length);
                                                                                                         ^
    In file included from /home/grab/.pyenv/versions/3.7.0/include/python3.7m/Python.h:128:0,
                     from src/re2.cpp:4:
    /home/grab/.pyenv/versions/3.7.0/include/python3.7m/abstract.h:471:17: note: declared here
     PyAPI_FUNC(int) PyObject_AsCharBuffer(PyObject *obj,
                     ^~~~~~~~~~~~~~~~~~~~~
    src/re2.cpp: In function ‘PyObject* __pyx_pf_3re2_7Pattern_split(PyObject*, PyObject*, PyObject*)’:
    src/re2.cpp:6410:7: warning: variable ‘__pyx_v_num_groups’ set but not used [-Wunused-but-set-variable]
       int __pyx_v_num_groups;
           ^~~~~~~~~~~~~~~~~~
    src/re2.cpp: In function ‘PyObject* __pyx_pf_3re2_7Pattern_subn(PyObject*, PyObject*, PyObject*)’:
    src/re2.cpp:7285:7: warning: variable ‘__pyx_v_encoded’ set but not used [-Wunused-but-set-variable]
       int __pyx_v_encoded;
           ^~~~~~~~~~~~~~~
    src/re2.cpp: In function ‘PyObject* PyInit_re2()’:
    src/re2.cpp:13638:14: warning: variable ‘__pyx_t_6’ set but not used [-Wunused-but-set-variable]
       Py_ssize_t __pyx_t_6;
                  ^~~~~~~~~
    src/re2.cpp: In function ‘int __Pyx_GetException(PyObject**, PyObject**, PyObject**)’:
    src/re2.cpp:14764:24: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
         tmp_type = tstate->exc_type;
                            ^~~~~~~~
    src/re2.cpp:14765:25: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’; did you mean ‘curexc_value’?
         tmp_value = tstate->exc_value;
                             ^~~~~~~~~
    src/re2.cpp:14766:22: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
         tmp_tb = tstate->exc_traceback;
                          ^~~~~~~~~~~~~
    src/re2.cpp:14767:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
         tstate->exc_type = local_type;
                 ^~~~~~~~
    src/re2.cpp:14768:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’; did you mean ‘curexc_value’?
         tstate->exc_value = local_value;
                 ^~~~~~~~~
    src/re2.cpp:14769:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
         tstate->exc_traceback = local_tb;
                 ^~~~~~~~~~~~~
    src/re2.cpp: In function ‘void __Pyx_ExceptionSave(PyObject**, PyObject**, PyObject**)’:
    src/re2.cpp:14790:21: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
         *type = tstate->exc_type;
                         ^~~~~~~~
    src/re2.cpp:14791:22: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’; did you mean ‘curexc_value’?
         *value = tstate->exc_value;
                          ^~~~~~~~~
    src/re2.cpp:14792:19: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
         *tb = tstate->exc_traceback;
                       ^~~~~~~~~~~~~
    src/re2.cpp: In function ‘void __Pyx_ExceptionReset(PyObject*, PyObject*, PyObject*)’:
    src/re2.cpp:14801:24: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
         tmp_type = tstate->exc_type;
                            ^~~~~~~~
    src/re2.cpp:14802:25: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’; did you mean ‘curexc_value’?
         tmp_value = tstate->exc_value;
                             ^~~~~~~~~
    src/re2.cpp:14803:22: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
         tmp_tb = tstate->exc_traceback;
                          ^~~~~~~~~~~~~
    src/re2.cpp:14804:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
         tstate->exc_type = type;
                 ^~~~~~~~
    src/re2.cpp:14805:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’; did you mean ‘curexc_value’?
         tstate->exc_value = value;
                 ^~~~~~~~~
    src/re2.cpp:14806:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
         tstate->exc_traceback = tb;
                 ^~~~~~~~~~~~~
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/home/grab/ds-venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-dhg3zzna/re2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-8wgk9u0f/install-record.txt --single-version-externally-managed --compile --install-headers /home/grab/ds-venv/include/site/python3.7/re2" failed with error code 1 in /tmp/pip-install-dhg3zzna/re2/
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Brocken compatibility with Python < 3.11

It appears that a recent change to the library has caused some compatibility issues with older versions of Python.

Specifically, the commit at https://github.com/andreasvc/pyre2/commit/01c73c9dac4f06c0e1e41519fa8f874bf02fb1b0 has broken backward compatibility for Python versions lower than 3.11.

When attempting to import the library with the line import re2, an error is encountered that results in the traceback shown below:

  File "/Users/evgeniydorogoy/.pyenv/versions/3.8.5/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/evgeniydorogoy/Projects/api/admin.py", line 6, in <module>
    from lexicockpit.api.forms import PatternForm, TicketForm
  File "/Users/evgeniydorogoy/Projects/api/forms.py", line 18, in <module>
    from lexicockpit.backend import validation
  File "/Users/evgeniydorogoy/Projects/backend/validation.py", line 5, in <module>
    import re2
  File "re2.pyx", line 132, in init re2
AttributeError: module 'enum' has no attribute 'global_enum'

Fortunately, for those who want to use the library with older Python versions, this issue can be resolved by reverting to the previous commit at https://github.com/andreasvc/pyre2/commit/8d853ab5076e959eb980ebd2ddbd338f491b58cd.

Group-named regex's groupdict() incompatible with native re

This is a fantastic library, just a small issue of incompatibility with the native re library that I found while working with it:

import re, re2
pat = b'(?P<A>aaa)|(?P<B>bbb)'
p = re.compile(pat)
p2 = re2.compile(pat)

p.match(b'aaa').groupdict()
>>> {'A': b'aaa', 'B': None}

p2.match(b'aaa').groupdict()
>>> {b'A': b'aaa', b'B': None}

In re, the group names are strings even though the pattern was a byte-stream. In re2, the group names are byte-streams.

Failed building wheel for pyre2

When trying to install pyre2 with pip install pyre2 I get the following error:

Building wheels for collected packages: pyre2
  Building wheel for pyre2 (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pyre2 (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [4 lines of output]
      running bdist_wheel
      running build
      running build_ext
      error: [Errno 2] No such file or directory: 'cmake'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyre2
Failed to build pyre2
ERROR: Could not build wheels for pyre2, which is required to install pyproject.toml-based projects

I am running Ubuntu Server 22.04 with Python 3.10.4

Missing file: re2/stringpiece.h

Trying to install on Mac OS X 10.9 x86 under Python 3.6.

GCC has been installed using Homebrew.

In virtual env, executing pip3 install https://github.com/andreasvc/pyre2/archive/master.zip, the error occurs during the build of wheel for re2.

creating build/temp.macosx-10.9-x86_64-3.6/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/re2.cpp -o build/temp.macosx-10.9-x86_64-3.6/src/re2.o -DPY2=0 -O3 -march=native -DNDEBUG -std=c++11
src/re2.cpp:446:10: fatal error: 're2/stringpiece.h' file not found
#include "re2/stringpiece.h"
^~~~~~~~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1

re2 wheels for later python versions

Hi, are there any plans to build re2 for newer Python version? I'm trying to install pyre2 on Windows with Python 3.8 and there's some weird CMake issues I'm not sure I want to debug...

mutex file not found

Hi,

I am facing the following issue, when I try to install it in my environment:

running install
running build
running build_ext
building 're2' extension
/usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/name/anaconda/envs/test_123/include -arch x86_64 -I/Users/name/anaconda/envs/test_123/include -arch x86_64 -I/usr/local/include -I/Users/name/anaconda/envs/test_123/include/python3.5m -c src/re2.cpp -o build/temp.macosx-10.6-x86_64-3.5/src/re2.o -DPY2=0 -O3 -march=native -DNDEBUG -std=c++11
In file included from src/re2.cpp:629:
/usr/local/include/re2/re2.h:186:10: fatal error: 'mutex' file not found
#include
^~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1

I have successfully installed re2 C++ library from : https://github.com/google/re2
my setup:
Anaconda environment
Python : 3.5.5
Cython : 0.28.3

Any suggestions on how to solve this ?

thank you,
goutham.

unexpected perf results and questions

Since I need a good re2 python interface (and there appears to be many, largely unmaintained) I ended up testing this one and the google one using your performance.py script and the results are somewhat unexpected compared to the performance table in the README https://github.com/andreasvc/pyre2#performance

I made a small change to make it run with newer python return _wikidata.decode('utf8') which is maybe why the results look odd; can you verify whether this is correct or not?

re2-perf-data.txt

tags and versions out of sync

Either we crossed each other on the last PR or I just plain missed a commit, but upshot is the v0.3.5 commit got orphaned and conda-forge wants to update to v0.3.6 but pypi only has v0.3.5 (the source version is still v0.3.5). I think the best answer is for me to make a PR with version updates and a typo fix for the release page, and then you'll need to delete both the v0.3.5 and v0.3.6 tags, then push a new v0.3.6 tag after the PR merge. Sorry for the inconvenience...

Delete local tag:

git tag --delete <ref_name>

Delete remote tag:

git push origin :<ref_name>

new pypi wheels

Thanks for taking the cmake PR (hopefully you're surviving the virus apocalypse in decent shape)

This is mainly to document the testing of releases I made from my fork (using only 0.3.2.postN releases, so the next patch version is still available). This includes both CI testing across the github CI runners and then install/runtime testing using a new python package that depends on pyre2. It took a few more workarounds in the wheel building but now they all run correctly on the 3 main OS targets (using only the bundled wheel libs and no extra libre2 package installs). Whew...

Given that ^^ I'd say it's ready for uploading new wheels to pypi (other than some readme cleanup). I did add a platform section to the readme, but I just noticed I didn't update the existing Installation section. Basically the upshot is:

  • normal usage for linux/mac/windows should be: "use the wheels from pypi, ie, pip install pyre2"
  • for development/introspection: "use the install from source" method

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.