mosdef-hub / gmso

Flexible storage of chemical topology for molecular simulation
https://gmso.mosdef.org
MIT License
53 stars 32 forks source link

[pre-commit.ci] pre-commit autoupdate #816

Closed pre-commit-ci[bot] closed 2 months ago

pre-commit-ci[bot] commented 3 months ago

updates:

chrisjonesBSU commented 2 months ago

I'm stumped with this one.

- hook id: pydocstyle
- exit code: 1
- 
WARNING: Error in file gmso/utils/ff_utils.py: Unexpected token tk.FSTRING_MIDDLE (class), expected 1

It looks like pydocstyle has been deprecated and archived. I wonder if something broke between pydocstyle and the latest version of pre-commit? I'm not that familiar with the internal working of pre-commit, but it seems like we might need to replace the pydocstyle hook at some point. ruff is an alternative they give.

chrisjonesBSU commented 2 months ago

I dug around a little bit, I think the error isn't a pre-commit error, but related to the tokenize and token packages in python's built in libraries. If I run pre-commit locally on ff_utils.py with python 3.12, I get this error, if I downgrade to python 3.11, this error doesn't occur and all of the pre-commit checks pass.

CalCraven commented 2 months ago

I dug around a little bit, I think the error isn't a pre-commit error, but related to the tokenize and token packages in python's built in libraries. If I run pre-commit locally on ff_utils.py with python 3.12, I get this error, if I downgrade to python 3.11, this error doesn't occur and all of the pre-commit checks pass.

I can second this, I ran it on 3.11 and didn't get the error.

To add to the reading, it looks like this may have some info about FSTRING_MIDDLE.

It may actually be an issue with pre-commit (pydocstyle) being unable to parse the updated lexing of f-strings.

Therefore, I think we may be forced to replace pydocstyle for ruff, as mentioned above by @chrisjonesBSU. A second solution would be to not check this file in the pre-commit-config file.

CalCraven commented 2 months ago

https://github.com/astral-sh/ruff-pre-commit This looks like what we want

CalCraven commented 2 months ago

Tried to test this in #819, so we'll see if the linting works.