Doesn't work in python 3.10
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Start with simvue/eco/emissions_monitor.py, at the CO2Monitor definition shown in the traceback, and reproduce the import failure under Python 3.10. Check the project's existing tests or test setup for supported Python versions. Done means the Python API imports and runs correctly on Python 3.10 without breaking newer supported versions.
Written by the indexing model from the issue text.
Description
Description of Bug
Python API crashes on python 3.10, since it uses timezone.UTC, which is an alias that was only introduced in 3.11.
Steps To Reproduce
Steps to reproduce the behavior:
- Try running it on 3.10
Expected behavior
Runs correctly
Actual Behaviour
from simvue.config.user import SimvueConfiguration
../../../Library/Caches/pypoetry/virtualenvs/simvue-moose-SyxDCI6N-py3.10/lib/python3.10/site-packages/simvue/config/user.py:39: in <module>
from simvue.eco.config import EcoConfig
../../../Library/Caches/pypoetry/virtualenvs/simvue-moose-SyxDCI6N-py3.10/lib/python3.10/site-packages/simvue/eco/__init__.py:11: in <module>
from .emissions_monitor import CO2Monitor as CO2Monitor
../../../Library/Caches/pypoetry/virtualenvs/simvue-moose-SyxDCI6N-py3.10/lib/python3.10/site-packages/simvue/eco/emissions_monitor.py:41: in <module>
class CO2Monitor(pydantic.BaseModel):
../../../Library/Caches/pypoetry/virtualenvs/simvue-moose-SyxDCI6N-py3.10/lib/python3.10/site-packages/simvue/eco/emissions_monitor.py:82: in CO2Monitor
_last_local_write = pydantic.PrivateAttr(datetime.datetime.now(tz=datetime.UTC))
E AttributeError: module 'datetime' has no attribute 'UTC'
- Dominant language
- Python
- Stars
- 4
- Forks
- 1
- Avg merge
- 5d 8h
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from simvue-io/python-api
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
simvue-io/python-api#994 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 68/100
simvue-io/python-api#538 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
simvue-io/python-api#1004 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
simvue-io/python-api#1000 · 2 comments ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
simvue-io/python-api#987 ·
All issues in simvue-io/python-api
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100