python / python/mypy

Not possible to build and install mypy with mypyc support, and run the tests against it.

Aperta
#16,143 3 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug
Lingua principale
Python
Stelle
20.6k
Fork
3.3k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

mypy's built wheels includes two installable packages available after mypy is fully installed. They appear to not be practically usable:

  • import mypy.test
  • import mypyc.test

The testsuite depends on conftest.py and pyproject.toml from the root of the repository to run. Also, the test-data/ directory provides data the tests need. None of this data is distributed in the built wheels.

The fact that the packages are installed at all appears to be a bug. This is a side effect of #2784 which requested that the sdist (not the wheel) include the testsuite so that redistributors such as Debian can run the tests when packaging.

The intertwining of the testsuite as part of the mypy module alongside the requirement to use data from the sources makes it difficult to test mypy correctly. Allowing the tests to be detected by pytest means making the mypy/ directory importable and causes the tests to incorrectly run against the pure-python version, which means the compiled extensions do not get tested.

And mypy's own CI is working around this with editable installs: https://github.com/python/mypy/blob/9b9152484c6b1ba3934373ca0c7600f71392fb06/.github/workflows/test.yml#L137-L145

Also, the installation footprint of these unused files seems to be a couple of MB, which could be a nice optimization...

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia leggendo .github/workflows/test.yml intorno alla soluzione alternativa per l’installazione editable, quindi esamina conftest.py, pyproject.toml e test-data/. Determina in che modo il wheel compilato e l’albero dei sorgenti espongono mypy.test e mypyc.test. Il lavoro è completato quando la suite di test può esercitare estensioni compilate tramite una build installata senza includere nel wheel pacchetti di test inutilizzabili o i dati di test necessari.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
build-system, devtools, testing-qa
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.