Aidbox / aidbox-python-sdk

MIT License
10 stars 6 forks source link

Update to python 3.11 #38

Closed ir4y closed 1 year ago

ir4y commented 1 year ago

There is an issue with pytest. It is partially fixed now at this branch https://github.com/Aidbox/aidbox-python-sdk/tree/update-python-3-11 Unfortunately, aidbox initializes on each test. It should be fixed. Aidbox should be initialized only once per test suite run.

ruscoder commented 1 year ago

Any updates here?

ruscoder commented 1 year ago

I see that scope session was removed in this commit https://github.com/Aidbox/aidbox-python-sdk/commit/5de622b417e2b91938799c73706d6d6773a8b683

What is the purpose of this commit?

ruscoder commented 1 year ago

In general, recreating app on each test it's not an issue and happens fast (even in official documentation it's a preferred way).

The only issue I've found is sqlalchemy caching, that's fixed by this commit https://github.com/Aidbox/aidbox-python-sdk/commit/59ba8f646152734465bb4361f425da0d3c0fd55e, sqlalchemy by default doesn't recreate tables.

And the second bad thing - noisy logs

INFO     aidbox_sdk:main.py:35 Creating seeds and applying migrations
INFO     aidbox_sdk:main.py:38 Aidbox app successfully registered

but it's too easy to turn off in conftest:

logging.getLogger("aidbox_sdk").setLevel(logging.WARNING)

and in pyproject.toml

[tool.pytest.ini_options]
log_cli_level = "WARNING"
ir4y commented 1 year ago

The support for 3.11 was done. The issue is stale, so I am closing it.

Logs configuration is up to the end SDK user.