MAINT: line ending test cannot run on Windows (check git blobs instead of the working tree?)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- git, python
- Ambito
- testing-qa
Direzione di ricerca
Inizia da mne/tests/test_line_endings.py, in particolare da _assert_line_endings e dal relativo elenco skip_files, e verifica come il test attuale legge i byte dell’albero di lavoro. Controlla il comportamento esistente di CI e Git nel repository, quindi verifica che il test possa esaminare in modo coerente i byte sottoposti a commit su Windows e sulle altre piattaforme senza modificare deliberatamente i file CRLF. Il lavoro è completato quando lo skip di Windows non è più necessario e il controllo dei caratteri di fine riga continua a coprire i file previsti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
mne/tests/test_line_endings.py skips itself unconditionally on Windows:
def _assert_line_endings(dir_):
"""Check line endings for a directory."""
if sys.platform == "win32":
pytest.skip("Skipping line endings check on Windows")
The CI matrix currently runs 8 combinations, all ubuntu-* or macos-* — there is no
Windows runner — so between the two, this check never executes on Windows at all.
It has to skip, because the check reads the working-tree bytes:
with open(filename, "rb") as fid:
text = fid.read().decode("utf-8")
...
crcount = text.count("\r")
With Git for Windows' default core.autocrlf=true, a checkout turns every text file into
CRLF, so crcount would be non-zero for the entire repository and the test would fail for
reasons that have nothing to do with what is committed.
The practical consequence is that a Windows contributor cannot run this check locally; a CRLF
file only gets caught once Linux CI sees it.
A fix that won't work (writing it down so nobody tries it)
Adding a broad .gitattributes (e.g. *.py text eol=lf for every extension in good_exts)
would make the working tree LF and let the test run — but it would also rewrite the files that
are deliberately CRLF. skip_files lists several of them:
test_old_layout_latin1_software_filter.vhdr/.vmrk/_longname.vhdr— the comment in
the test says part of testing compatibility with older BrainVision formats is testing the
line endings and coding schemes used thereFreeSurferColorLUT.txt,test_edf_stim_channel.txt,FieldTrip.py,license.txt,
searchindex.dat
Forcing those to LF would change the very bytes those compatibility tests depend on. So
.gitattributes is not a safe way to make this test runnable on Windows.
Suggestion
Check the committed bytes rather than the checked-out ones, e.g. via
git ls-files --eol (the i/ field is the index/worktree-independent line ending), or by
reading blobs through git cat-file. That is unaffected by core.autocrlf, so the check
would give the same answer on every platform and the win32 skip could go away.
This is a change to how the test works rather than a bug fix, so I'd rather check the
direction first. Happy to implement it if you think it's worth doing; also completely fine if
you'd rather keep the current behaviour and leave the check to Linux CI.
- Lingua principale
- Python
- Stelle
- 3.5k
- Fork
- 1.6k
- Merge medio
- 1g 3h
- PR unite (30g)
- 73
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di mne-tools/mne-python
-
ENH: Add `description` filter parameter to `Raw.crop_by_annotations()`Forse già presa @aman-coder03 l’ha presa 193 giorni fa. ApertaENH
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
mne-tools/mne-python#13743 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
ENH
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
mne-tools/mne-python#14427 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 56/100
mne-tools/mne-python#14426 ·
I maintainer di solito rispondono entro 1 giorno
-
BUG
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
mne-tools/mne-python#14421 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
BUG
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
mne-tools/mne-python#14420 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di mne-tools/mne-python
Issue simili
-
bug needs-triage priority:medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
yeongseon/azure-functions-logging-python#583 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation needs-triage priority:medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
yeongseon/azure-functions-validation-python#546 ·
I maintainer di solito rispondono entro 1 giorno
-
PHP workflow streaming requests buffer the full SSE responseForse già presa @Winoren l’ha presa oggi. Apertareview: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
langgenius/dify#44270 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
P4: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
jeffknupp/association#523 ·
-
bug help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
DarkStarSystems/pcons#229 ·
I maintainer di solito rispondono entro 1 giorno