andreahlert opened a new pull request, #61616:
URL: https://github.com/apache/airflow/pull/61616

   ## Summary
   
   Replace blocking `os.path` and `pathlib.Path` calls inside async functions 
with async-safe `anyio.Path` equivalents, fixing all ASYNC240 lint violations 
and re-enabling the rule.
   
   - **`providers/standard/triggers/file.py`**: Replace `os.path.isfile()`, 
`os.path.getmtime()`, `os.walk()`, `os.remove()` with `anyio.Path` and 
`anyio.to_thread.run_sync()`
   - **`providers/edge3/cli/worker.py`**: Replace `pathlib.exists()`, 
`pathlib.stat()` with `anyio.Path`
   - **`devel-common/sphinx_exts/pagefind_search/builder.py`**: Replace 
`pathlib.glob()`, `pathlib.is_file()`, `pathlib.read_text()` with `anyio.Path`
   - **Test files**: Convert blocking pathlib calls in async tests to 
`anyio.Path`
   - **`pyproject.toml`**: Remove `ASYNC240` from the ruff ignore list
   
   closes #61418
   Related: #61417
   
   ## Decision context
   
   `anyio` was chosen as the async filesystem library per discussion on the 
issue (approved by @jscheffl). It is already a transitive dependency of the 
project via httpx, sqlalchemy async, etc.
   
   ## Test plan
   
   - [ ] Verify `ruff check --select ASYNC240` passes with zero violations
   - [ ] Run `providers/standard/tests/unit/standard/triggers/test_file.py`
   - [ ] Run `providers/edge3/tests/unit/edge3/cli/test_worker.py`
   - [ ] Run `airflow-core/tests/unit/api_fastapi/auth/test_tokens.py`


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to