Skip to content

Instantly share code, notes, and snippets.

View tapetersen's full-sized avatar
🎯
Focusing

Tobias Alex-Petersen tapetersen

🎯
Focusing
View GitHub Profile
@tapetersen
tapetersen / main.py
Created September 30, 2025 10:51
Test for anyio #983
import fastapi
app = fastapi.FastAPI()
@app.get("/")
async def root():
return {"msg": "Hello World"}
if __name__ == "__main__":
uvicorn.run(app)
@tapetersen
tapetersen / anyio_test.py
Created November 14, 2022 16:47
Anyio thread issue
import anyio
from anyio import from_thread, to_thread
def main():
def in_main():
anyio.Event()
def in_thread():
from_thread.run_sync(in_main)
@tapetersen
tapetersen / Makefile
Created November 2, 2022 16:32
Pex race condition repro
SHELL=/bin/bash
export PEX_ROOT:=$(abspath .)/.pex
download-wheels: requirements-ci.txt
pip wheel -r requirements-ci.txt --wheel-dir wheels
pexes: $(patsubst %,pex%.pex,$(shell seq 10))
pex%.pex:
PIP_NO_INDEX=1 PIP_FIND_LINKS=wheels pex -o $@ -r requirements-ci.txt
{
"name": "tobias/symfony-cache-issue",
"description": "Testcase for a symfony cache issue",
"type": "project",
"require": {
"symfony/cache": "^4.2"
},
"authors": [
{
"name": "Tobias Alex-Petersen",