Fix invalid escape sequences (#41130)

Using Python 3.12 in a freshly cloned Spack repository results in
warnings such as this:
```
==> Warning: invalid escape sequence '\$'
==> Warning: invalid escape sequence '\('
==> Warning: invalid escape sequence '\.'
==> Warning: invalid escape sequence '\.'
```
These will turn into errors in 3.13, so fix them. All of them actually
do not need to be regexes, so convert them into normal strings.
This commit is contained in:
Michael Kuhn 2023-11-18 14:43:35 +01:00 committed by GitHub
parent cb764ce41c
commit 223e5b8ca2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -76,8 +76,8 @@ def cmake_args(self):
@when("+fismahigh")
def patch(self):
filter_file("http://www\.ecmwf\.int", "", "cmake/atlas-import.cmake.in") # noqa: W605
filter_file("int\.ecmwf", "", "cmake/atlas-import.cmake.in") # noqa: W605
filter_file("http://www.ecmwf.int", "", "cmake/atlas-import.cmake.in", string=True)
filter_file("int.ecmwf", "", "cmake/atlas-import.cmake.in", string=True)
filter_file('http[^"]+', "", "cmake/atlas_export.cmake")
patterns = [".travis.yml", "tools/install*.sh", "tools/github-sha.sh"]
for pattern in patterns:

View File

@ -26,9 +26,10 @@ def patch(self):
patched_file = "configure"
with keep_modification_time(patched_file):
filter_file(
"if test x\$CC_TEST_SAME != x\$NETCDF_CC_TEST_SAME; then", # noqa: W605
"if test x$CC_TEST_SAME != x$NETCDF_CC_TEST_SAME; then",
"if false; then",
patched_file,
string=True,
)
def url_for_version(self, version):

View File

@ -66,11 +66,12 @@ def patch(self):
)
# 239
filter_file(
"append\('/usr/include/jxrlib'\)", # noqa: W605
"append('/usr/include/jxrlib')",
"extend(('{0}/libjxr/image', '{0}/libjxr/common', '{0}/libjxr/glue'))".format( # noqa: E501
spec["jxrlib-debian"].prefix.include
),
"setup.py",
string=True,
)
# 367