Repository: asottile/setup-cfg-fmt

Issue:
Wrongly formating "compatible release" clause
```diff
diff --git a/setup.cfg b/setup.cfg
index efc3a0f..662e52c 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -43,15 +43,15 @@ console_scripts =
 [options.extras_require]
 doc =
     furo
-    sphinx~=3.0
-    sphinx-autodoc-typehints~=1.10
-    sphinxcontrib-autoprogram~=0.1.0
+    sphinx-autodoc-typehints~~=1.10
+    sphinxcontrib-autoprogram~~=0.1.0
+    sphinx~~=3.0
 test =
-    filelock~=3.0
+    filelock~~=3.0
     pytest>=5,<=6
-    pytest-cov~=2.0
+    pytest-cov~~=2.0
     pytest-mock>=2,<=3
-    pytest-xdist~=1.34
+    pytest-xdist~~=1.34
 typing =
     mypy==0.790
     typing-extensions>=3.7.4.3
```

https://www.python.org/dev/peps/pep-0440/#compatible-release

Discussion:

Patch:
diff --git a/setup_cfg_fmt.py b/setup_cfg_fmt.py
index 44d3cb3..d9f84c8 100644
--- a/setup_cfg_fmt.py
+++ b/setup_cfg_fmt.py
@@ -236,7 +236,7 @@ def _normalize_req(req: str) -> str:
     return f'{normalized};{envs}'
 
 
-BASE_NAME_REGEX = re.compile(r'[^!=><\s@]+')
+BASE_NAME_REGEX = re.compile(r'[^!=><\s@~]+')
 REQ_REGEX = re.compile(r'(===|==|!=|~=|>=?|<=?|@)\s*([^,]+)')
 
 


Test patch:
diff --git a/tests/setup_cfg_fmt_test.py b/tests/setup_cfg_fmt_test.py
index 097f081..ceba336 100644
--- a/tests/setup_cfg_fmt_test.py
+++ b/tests/setup_cfg_fmt_test.py
@@ -231,6 +231,7 @@ def test_rewrite(input_s, expected, tmpdir):
         pytest.param('req05 <= 2,!=1', 'req05!=1,<=2', id='<= cond at end'),
         pytest.param('req13 !=2, >= 7', 'req13!=2,>=7', id='>= cond at end'),
         pytest.param('req14 <=2, >= 1', 'req14>=1,<=2', id='b/w conds sorted'),
+        pytest.param('req15~=2', 'req15~=2', id='compatible release'),
     ),
 )
 def test_normalize_lib(lib, expected):