transition-zero / tz-client

A client repository for accessing FEO data programmatically.
https://docs.feo.transitionzero.org
Apache License 2.0
21 stars 4 forks source link

BUG: incorrect python version stated #58

Closed Mason-TZ closed 9 months ago

Mason-TZ commented 9 months ago

Checklist

Reproducible Example

When creating a new environment I observed in pyproject.toml that requires-python = ">=3.9". I proceeded with:

conda create -n feo-client python=3.9
pip install .
feo auth login

Issue Description

After initial login stages, I was met with:

Traceback (most recent call last):
  File "/home/mason/mambaforge/envs/feo-client/bin/feo", line 5, in <module>
    from feo.client.cli import main
  File "/home/mason/mambaforge/envs/feo-client/lib/python3.9/site-packages/feo/client/__init__.py", line 30, in <module>
    from feo.client.asset import Asset, AssetCollection
  File "/home/mason/mambaforge/envs/feo-client/lib/python3.9/site-packages/feo/client/asset.py", line 5, in <module>
    from feo.client import api
  File "/home/mason/mambaforge/envs/feo-client/lib/python3.9/site-packages/feo/client/api/__init__.py", line 26, in <module>
    from feo.client.api.aliases import AliasAPI
  File "/home/mason/mambaforge/envs/feo-client/lib/python3.9/site-packages/feo/client/api/aliases.py", line 4, in <module>
    from feo.client.api.schemas import AliasResponse
  File "/home/mason/mambaforge/envs/feo-client/lib/python3.9/site-packages/feo/client/api/schemas.py", line 7, in <module>
    class PowerUnit(BaseModel):
  File "/home/mason/mambaforge/envs/feo-client/lib/python3.9/site-packages/feo/client/api/schemas.py", line 11, in PowerUnit
    latitude: float | None
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

Expected Behavior

I expected this python version to work.

Mason-TZ commented 9 months ago

Also running into this while testing so far:

So in the pyproject.toml file: -> rquires-python = ">=3.9"

If using python=3.9: -> fails as above

If using python=3.10: -> import warnings -> pre-commit fails as reqs 3.11

If using python=3.11: -> tox fails as fo-client requires python: 3.10.12

Mason-TZ commented 9 months ago

Final note: works fine if you just install python 3.11 (no issues). Just was a bit mislead by the minimum python version in the pyproject.toml file. Will close this issue