potiuk commented on PR #36638:
URL: https://github.com/apache/airflow/pull/36638#issuecomment-1880000485

   Update @jscheffl.
   
   I spent a little time and implemented the final version that I foresaw 
initiallly for that. That one is quite a bit more complex, because it 
implements all the selective checks rules needed and separate matrix job that I 
wanted to implement in the first place, but it should explain what I wanted to 
achieve as a target,.
   
   Example:
   
   If. your PR changes two files:
   
   * airflow/models.py
   * airflow/providers/my_changed_provider.py
   
   Then what is going to happen:
   
   a) when you run mypy for local pre-commits, it will run it on individual 
files (`mypy airflow/models.py` for `mypy-core` changes and `mypy 
airflow/providers/my_changed_provider.py --namespace-packages` for 
`mypy-providers`
   
   b) when you run CI in PR there will be two parallel jobs running:
   
   mypy ['airflow'. ' airflow/providers']
   
   the first job will run:
   
   ```bash
   mypy airflow
   ```
   
   The second will run:
   
   ```bash
   mypy airflow/providers --namespace-packages
   ```
   
   And all the `mypy-airflow`, `mypy-providers` checsk will be skipped in 
regular static checks (because they work on individual files not on all 
packages and my produce different results than than the `package` based ones, 
and the `package` based ones will produce stable and complete results
   
   This way **maybe** (rarel) locally run mypy check might produce a different 
result of mypy check, but then the complete `package` check will always run 
whole `airflow` or `providers` check and it will provide consistent output. 
This will work fine for both - regular PRs and canary runs now, no need to make 
a "full mypy run" separately for canary run.
   
   This one I hope - even if the code is more complex - provides the target / 
complete solution I wanted to do in stages initially.
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to