Skip to content

Loosen requests lower pin, fix pre-commit errors#4469

Merged
shyuep merged 27 commits intomaterialsproject:masterfrom
DanielYang59:loosen-requests-dep
Aug 21, 2025
Merged

Loosen requests lower pin, fix pre-commit errors#4469
shyuep merged 27 commits intomaterialsproject:masterfrom
DanielYang59:loosen-requests-dep

Conversation

@DanielYang59
Copy link
Contributor

@DanielYang59 DanielYang59 commented Aug 1, 2025

Summary

  • Loosen requests upper pin, current pin seems too strict and might cause unresolvable dependency
  • Fix a few deprecation warnings
  • Fix some new ruff errors from pre-commit

Note: requests older than 2.30 might not be compatible (but I cannot recreate locally, let me know if there's any case the pin should be further loosened):

_______________________ TestVaspDoc.test_get_incar_tags ________________________

self = <vasp.test_help.TestVaspDoc object at 0x7fe0bbb48640>

    def test_get_incar_tags(self):
        """Get all INCAR tags and check incar_parameters.json file."""
>       incar_tags_wiki = VaspDoc.get_incar_tags()
                          ^^^^^^^^^^^^^^^^^^^^^^^^

/home/runner/work/pymatgen/pymatgen/tests/io/vasp/test_help.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'pymatgen.io.vasp.help.VaspDoc'>

    @classmethod
    def get_incar_tags(cls) -> list[str]:
        """Get a list of all INCAR tags from the VASP wiki."""
        # Use Mediawiki API as documented in
        # https://www.vasp.at/wiki/api.php?action=help&modules=query
        url = (
            "https://www.vasp.at/wiki/api.php?"
            "action=query&list=categorymembers"
            "&cmtitle=Category:INCAR_tag"
            "&cmlimit=500&format=json"
        )
        response = requests.get(url, timeout=60)
>       response_dict = orjson.loads(response.text)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       orjson.JSONDecodeError: unexpected character: line 1 column 1 (char 0)

@DanielYang59 DanielYang59 changed the title Loosen requests upper pin Loosen requests lower pin Aug 1, 2025
/Users/yang/developer/pmg/tests/analysis/test_interface_reactions.py:367:
DeprecationWarning: Arrays of 2-dimensional vectors are deprecated. Use
arrays of 3-dimensional vectors instead. (deprecated in NumPy 2.0)
    positions = [np.cross(v1, v2) for v1, v2 in relative_vectors]
/Users/yang/developer/pmg/src/pymatgen/core/tensors.py:292:
DeprecationWarning: __array_wrap__ must accept context and return_scalar
arguments (positionally) in the future. (Deprecated NumPy 2.0)
src/pymatgen/io/jdftx/outputs.py:328:45: SyntaxError: Cannot use star
expression in index on Python 3.10 (syntax was added in Python 3.11)
@DanielYang59 DanielYang59 changed the title Loosen requests lower pin Loosen requests lower pin, fix some pre-commit errors Aug 1, 2025
@DanielYang59 DanielYang59 marked this pull request as ready for review August 1, 2025 22:48
@DanielYang59 DanielYang59 requested a review from shyuep as a code owner August 1, 2025 22:49
@DanielYang59 DanielYang59 requested a review from mkhorton as a code owner August 1, 2025 22:49
@DanielYang59 DanielYang59 changed the title Loosen requests lower pin, fix some pre-commit errors Loosen requests lower pin, fix pre-commit errors Aug 14, 2025
@shyuep shyuep merged commit c6c5780 into materialsproject:master Aug 21, 2025
44 checks passed
@DanielYang59 DanielYang59 deleted the loosen-requests-dep branch August 21, 2025 17:26
@DanielYang59
Copy link
Contributor Author

DanielYang59 commented Oct 7, 2025

@shyuep can you please consider a new release at some point? previous requests lower pin is causing some compatibility issues with nomad (previously pinned because some compatibility issue with jupyterhub, and we're still testing to drop the upper pin from nomad side) and it would be nice to have a new release without this pin (this would also fix the missing sdist issue)? Thanks

@DanielYang59
Copy link
Contributor Author

thanks a ton!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants