Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"pre-commit autoupdate" updates to 1e2ad21bf1bfe403be122f3a8fc984cad8f5b085 #188

Closed
TheLovinator1 opened this issue May 9, 2024 · 7 comments · Fixed by #195
Closed

"pre-commit autoupdate" updates to 1e2ad21bf1bfe403be122f3a8fc984cad8f5b085 #188

TheLovinator1 opened this issue May 9, 2024 · 7 comments · Fixed by #195

Comments

@TheLovinator1
Copy link

When I run pre-commit autoupdate it updates to 1e2ad21bf1bfe403be122f3a8fc984cad8f5b085.

https://github.com/tox-dev/pyproject-fmt updating 1.7.0 -> 1e2ad21bf1bfe403be122f3a8fc984cad8f5b085

Some problems:

  1. This update needs the Rust toolchain to be installed:
An unexpected error has occurred: CalledProcessError: command: ('C:\\Users\\lovinator\\.cache\\pre-commit\\repoicmye84g\\py_env-python3\\Scripts\\python.EXE', '-mpip', 'install', '.')
return code: 1
stdout:
    Processing c:\users\lovinator\.cache\pre-commit\repoicmye84g
      Installing build dependencies: started
      Installing build dependencies: finished with status 'done'
      Getting requirements to build wheel: started
      Getting requirements to build wheel: finished with status 'done'
      Preparing metadata (pyproject.toml): started
      Preparing metadata (pyproject.toml): finished with status 'error'
stderr:
      error: subprocess-exited-with-error

      Preparing metadata (pyproject.toml) did not run successfully.
      exit code: 1

      [6 lines of output]

      Cargo, the Rust package manager, is not installed or is not on PATH.
      This package requires Rust and Cargo to compile extensions. Install it through
      the system's package manager or via https://rustup.rs/
  1. After installing Rust it will always fail because it tries to move the following between two places:
[tool.poetry.group.dev.dependencies]
ruff = "^0.4.0"
pre-commit = "^3.7.0"
  1. Not a problem but I think the new style looks worse:
[tool.poetry.dependencies]
python = "^3.12"
Django = "^5.0.6"
python-dotenv = "^1.0.1"
psycopg = { extras = [
  "binary",
], version = "^3.1.18" }
django-redis = { extras = [
  "hiredis",
], version = "^5.4.0" }
gunicorn = "^22.0.0"
loguru = "^0.7.2"

vs old version

[tool.poetry.dependencies]
python = "^3.12"
Django = "^5.0.6"
python-dotenv = "^1.0.1"
psycopg = { extras = ["binary"], version = "^3.1.18" }
django-redis = { extras = ["hiredis"], version = "^5.4.0" }
gunicorn = "^22.0.0"
loguru = "^0.7.2"
@gaborbernat
Copy link
Member

The main branch is not yet released so I'm not sure why it gets picked up. That being said this shows that I will need to split out the rust layer into a meta package, and also expose The maximum character length as a configuration argument so you could work around problem 3.

@acdha
Copy link

acdha commented May 10, 2024

I wonder if it's possible that this is because the tags don't have a v prefix like most of the popular hooks do and pre-commit is sorting 1e2ad21bf1bfe403be122f3a8fc984cad8f5b085 ahead of 1.7.0. I had this break because the Cargo dependency pulled in an x86 binary which my ARM Mac couldn't run.

@gaborbernat
Copy link
Member

It is because pre commit tracks the main branch and I moved the tags to a legacy branch now...

@gaborbernat
Copy link
Member

@TheLovinator1
Copy link
Author

pyproject-fmt............................................................Failed
- hook id: pyproject-fmt
- exit code: 1

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\lovinator\.cache\pre-commit\repok_ao7b8v\py_env-python3\Scripts\pyproject-fmt.EXE\__main__.py", line 4, in <module>
  File "C:\Users\lovinator\.cache\pre-commit\repok_ao7b8v\py_env-python3\Lib\site-packages\pyproject_fmt\__main__.py", line 12, in <module>
    from pyproject_fmt.cli import cli_args
  File "C:\Users\lovinator\.cache\pre-commit\repok_ao7b8v\py_env-python3\Lib\site-packages\pyproject_fmt\cli.py", line 24, in <module>
    from packaging.version import Version
ModuleNotFoundError: No module named 'packaging'

I have more work for you lol

@gaborbernat
Copy link
Member

PR welcome 🤗

@gaborbernat
Copy link
Member

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 a pull request may close this issue.

3 participants