lincc-frameworks / lincc-frameworks/python-project-template
Remove pinned python version from black precommit hook
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Jinja
- Sterne
- 85
- Forks
- 16
- Ø Merge
- 6 Std. 18 Min.
- Gemergte PRs (30 T.)
- 1
Beschreibung
@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
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie mit python-project-template/.pre-commit-config.yaml.jinja und prüfen Sie, wie py.pref(python_versions) den language_version des Hooks erzeugt. Prüfen Sie die verlinkte Anleitung zu pre-commit language-version und passen Sie anschließend das Template so an, dass generierte Konfigurationen keine fehlschlagende festgelegte Python-Version erzwingen; überprüfen Sie die resultierende Konfiguration für die betroffenen Projekte.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 68/100