-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
remove regex dependency #2663
remove regex dependency #2663
Conversation
I can handle the pipenv related changes as I suspect the changes might break compatibility with older versions of Python. |
I spoke too soon, there's another thing to fix in trans.py. |
Thanks! Feel free to push to this branch. Hopefully I got CI clean this time. |
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.
Nice work all. This will make black a much lighter and reliable install.
@@ -101,7 +101,6 @@ def find_python_files(base: Path) -> List[Path]: | |||
"platformdirs>=2", | |||
"tomli>=0.2.6,<2.0.0", | |||
"typed-ast>=1.4.2; python_version < '3.8' and implementation_name == 'cpython'", | |||
"regex>=2021.4.4", |
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.
So nice.
@@ -453,7 +453,7 @@ def make_naked(string: str, string_prefix: str) -> str: | |||
# with 'f'... | |||
if "f" in prefix and "f" not in next_prefix: | |||
# Then we must escape any braces contained in this substring. | |||
SS = re.subf(r"(\{|\})", "{1}{1}", SS) | |||
SS = re.sub(r"(\{|\})", r"\1\1", SS) |
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.
This will never have unicode to match right so we should be safe ... :D
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 far as I can tell the missing unicode support is just about character classes, so some "word" characters don't match \w
in re but do in regex. That doesn't apply here.
We were no longer using it.