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

remove regex dependency #2663

Merged
merged 6 commits into from Dec 2, 2021
Merged

remove regex dependency #2663

merged 6 commits into from Dec 2, 2021

Conversation

JelleZijlstra
Copy link
Collaborator

We were no longer using it.

@ichard26
Copy link
Collaborator

ichard26 commented Dec 2, 2021

I can handle the pipenv related changes as I suspect the changes might break compatibility with older versions of Python.

@JelleZijlstra
Copy link
Collaborator Author

I spoke too soon, there's another thing to fix in trans.py.

CHANGES.md Outdated Show resolved Hide resolved
@JelleZijlstra
Copy link
Collaborator Author

I can handle the pipenv related changes as I suspect the changes might break compatibility with older versions of Python.

Thanks! Feel free to push to this branch. Hopefully I got CI clean this time.

Copy link
Collaborator

@cooperlees cooperlees left a 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",
Copy link
Collaborator

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)
Copy link
Collaborator

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

Copy link
Collaborator Author

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.

@ichard26 ichard26 merged commit bd9d52b into main Dec 2, 2021
@ichard26 ichard26 deleted the regnix branch December 2, 2021 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: dependencies C: packaging Installation and packaging of Black
Projects
None yet
3 participants