lincc-frameworks / lincc-frameworks/python-project-template

Remove pinned python version from black precommit hook

未關閉 適合新手
#575 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

bug
主要語言
Jinja
星號
85
分支
16
平均合併
6 小時 18 分鐘
30 天內合併 PR
1

描述

@camposandro and I have run into this with a couple incubees.

In the precommit template (https://github.com/lincc-frameworks/python-project-template/blob/main/python-project-template/.pre-commit-config.yaml.jinja), we set up the black hook with the following (note the last line, with **language_version**):
```jinja
{%- if 'black' in enforce_style %}
# Analyze the code style and report code that doesn't adhere.
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black-jupyter
name: Format code using black
types_or: [python, pyi, jupyter]
# It is recommended to specify the latest version of Python
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python{{ py.pref(python_versions) }}
{%- endif %}
```

And two users have ended up with some version of `language_version: 3.11`, which caused errors for them.

We should either remove this line, or make it not do this kind of behavior

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 python-project-template/.pre-commit-config.yaml.jinja 開始,檢查 py.pref(python_versions) 如何產生 hook 的 language_version。查看連結的 pre-commit language-version 指南,然後調整範本,使產生的設定不會強制使用會導致失敗的固定 Python 版本;驗證受影響專案的最終設定。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
tooling
Issue 類型
缺陷
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
基本清楚
新手友好度
68/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。