You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Api client should raise_for_status() instead of None if there is an error. Like this we can call the API client and give a more meaningful error to the user.
Things to consider:
The API client should throw but the emissionsTracker should not break, this means that we should try-catch in the emissions tracker.
One should check as well if in any of the responses we are if response is None because now they will throw the error
About test deps not separated from build deps. I think this is only true for the env api. Thanks for pointing out. We use it to deploy our API, we could separate it into api-test and api.
Hello,
Yes, we would like to switch to UV. I stopped my PR has I don't know how to migrate some part, which I do not write done :-(. I can do the rebase tomorrow and check what is left to do.
Activity
bcmyguest commentedon Jun 29, 2025
Would be happy to take this one if it's still relevant :)
bcmyguest commentedon Jun 29, 2025
Noticed a couple of other things when trying to get env setup.
uvfor dependency resolution (on install and pip compile)eg. (not sure this is complete, more info here
urllib==2.5.0is not possible on py3.8CODECARBON_ALLOW_MULTIPLE_RUNSenv variable could be done withpytest-dotenvsetting inpytest.iniand adding a.env.testfileAll except the second one are somewhat debatable, so not sure the best place to put them - happy to elaborate.
inimaz commentedon Jun 30, 2025
Hello @bcmyguest It is still relevant! Feel free to take it/ask for any questions.
uv, I agree. I see @benoit-cty already started a branch to migrate maybe it can be discussed in that PR?api. Thanks for pointing out. We use it to deploy our API, we could separate it intoapi-testandapi.pytest.ini, indeed go ahead!benoit-cty commentedon Jul 1, 2025
Hello,
Yes, we would like to switch to UV. I stopped my PR has I don't know how to migrate some part, which I do not write done :-(. I can do the rebase tomorrow and check what is left to do.
Thanks for contributing !
benoit-cty commentedon Jul 2, 2025
Hello @bcmyguest I've made the rebase if you want to have a look at #815
fix(api_client): raise HTTPError instead of returning None on API errors
fix(api_client): raise HTTPError instead of returning None on API errors
fix: raise HTTP errors in ApiClient instead of returning None (mlco2#820
sankalpsthakur commentedon Jul 27, 2026
I'd like to take this — will make the API client raise on HTTP errors and catch in the emissions tracker.
fix: raise HTTP errors from ApiClient instead of returning None
fix: raise HTTP errors from ApiClient instead of returning None