From 48e7c984e7c981b395af43734b43d2b544ece43d Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Tue, 10 Sep 2024 10:04:58 -0400 Subject: [PATCH] fix cibuildwheel: No build identifiers selected: BuildSelector(build_config='cp39-*', skip_config='*musllinux*', requires_python==3.10')>, prerelease_pythons=False) --- .github/workflows/release.yml | 2 +- src/pymatgen/io/abinit/pseudos.py | 11 +++++------ src/pymatgen/io/cp2k/inputs.py | 2 +- src/pymatgen/io/vasp/inputs.py | 4 ++-- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3e761bd4c19..a8451965a76 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,7 +45,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-14, windows-latest] - python-version: ["39", "310", "311", "312"] + python-version: ["310", "311", "312"] runs-on: ${{ matrix.os }} steps: - name: Check out repo diff --git a/src/pymatgen/io/abinit/pseudos.py b/src/pymatgen/io/abinit/pseudos.py index fb0ecc28c31..db9a6d2bb08 100644 --- a/src/pymatgen/io/abinit/pseudos.py +++ b/src/pymatgen/io/abinit/pseudos.py @@ -92,12 +92,11 @@ class Pseudo(MSONable, abc.ABC): """ @classmethod - def as_pseudo(cls, obj): - """ - Convert obj into a pseudo. Accepts: + def as_pseudo(cls, obj: Self | str) -> Self: + """Convert obj into a Pseudo. - * Pseudo object. - * string defining a valid path. + Args: + obj (str | Pseudo): Path to the pseudo file or a Pseudo object. """ return obj if isinstance(obj, cls) else cls.from_file(obj) @@ -227,7 +226,7 @@ def compute_md5(self): text = file.read() # usedforsecurity=False needed in FIPS mode (Federal Information Processing Standards) # https://github.com/materialsproject/pymatgen/issues/2804 - md5 = hashlib.new("md5", usedforsecurity=False) # hashlib.md5(usedforsecurity=False) is py39+ + md5 = hashlib.md5(usedforsecurity=False) md5.update(text.encode("utf-8")) return md5.hexdigest() diff --git a/src/pymatgen/io/cp2k/inputs.py b/src/pymatgen/io/cp2k/inputs.py index d1d519a600e..a754522011e 100644 --- a/src/pymatgen/io/cp2k/inputs.py +++ b/src/pymatgen/io/cp2k/inputs.py @@ -2327,7 +2327,7 @@ def get_hash(self) -> str: """Get a hash of this object.""" # usedforsecurity=False needed in FIPS mode (Federal Information Processing Standards) # https://github.com/materialsproject/pymatgen/issues/2804 - md5 = hashlib.new("md5", usedforsecurity=False) # hashlib.md5(usedforsecurity=False) is py39+ + md5 = hashlib.md5(usedforsecurity=False) md5.update(self.get_str().lower().encode("utf-8")) return md5.hexdigest() diff --git a/src/pymatgen/io/vasp/inputs.py b/src/pymatgen/io/vasp/inputs.py index 0b691867a9c..d8deb7da7e7 100644 --- a/src/pymatgen/io/vasp/inputs.py +++ b/src/pymatgen/io/vasp/inputs.py @@ -2028,7 +2028,7 @@ def md5_computed_file_hash(self) -> str: """MD5 hash of the entire PotcarSingle.""" # usedforsecurity=False needed in FIPS mode (Federal Information Processing Standards) # https://github.com/materialsproject/pymatgen/issues/2804 - md5 = hashlib.new("md5", usedforsecurity=False) # hashlib.md5(usedforsecurity=False) is py39+ + md5 = hashlib.md5(usedforsecurity=False) md5.update(self.data.encode("utf-8")) return md5.hexdigest() @@ -2064,7 +2064,7 @@ def md5_header_hash(self) -> str: self.hash_str = hash_str # usedforsecurity=False needed in FIPS mode (Federal Information Processing Standards) # https://github.com/materialsproject/pymatgen/issues/2804 - md5 = hashlib.new("md5", usedforsecurity=False) # hashlib.md5(usedforsecurity=False) is py39+ + md5 = hashlib.md5(usedforsecurity=False) md5.update(hash_str.lower().encode("utf-8")) return md5.hexdigest()