# A lot of these can probably be reduced, these were just ported from geowatch
# fairly blindly.

### Specialized Versions
# These packages have different minimum versions for wheels between our original 3.8
# target and more recent python releases.

# For a helper, Jon's local repo contains a script to try and automatically
# figure out the correct pins for each version. Not ready for prime time yet
# though. May be integrated into xdev in the future.
# https://github.com/Erotemic/local/blob/main/tools/supported_python_versions_pip.py

numpy>=1.26.0  ; python_version < '4.0'  and python_version >= '3.12'    # Python 3.12+
numpy>=1.23.2  ; python_version < '3.12' and python_version >= '3.11'    # Python 3.11
numpy>=1.21.6  ; python_version < '3.11' and python_version >= '3.10'  # Python 3.10
numpy>=1.19.3  ; python_version < '3.10' and python_version >= '3.9'   # Python 3.9
numpy>=1.19.3  ; python_version < '3.9' and python_version >= '3.8'    # Python 3.8

scipy>=1.11.2    ; python_version < '4.0'  and python_version >= '3.12'    # Python 3.12+
scipy>=1.9.2     ; python_version < '3.12' and python_version >= '3.11'    # Python 3.11
scipy>=1.8.0     ; python_version < '3.11' and python_version >= '3.10'  # Python 3.10
scipy>=1.8.0     ; python_version < '3.10' and python_version >= '3.9'    # Python 3.9

shapely>=2.0.2 ; python_version < '4.0'  and python_version >= '3.12'  # Python 3.11+
shapely>=2.0.1 ; python_version < '3.12'  and python_version >= '3.11'  # Python 3.11+
shapely>=2.0.1 ; python_version < '3.11' and python_version >= '3.10'  # Python 3.10
shapely>=2.0.1 ; python_version < '3.10' and python_version >= '3.9'   # Python 3.9
shapely>=2.0.1 ; python_version < '3.9' and python_version >= '3.8'    # Python 3.8

rasterio>=1.3.9     ; python_version < '4.0'  and python_version >= '3.12'    # Python 3.12+
rasterio>=1.3.4     ; python_version < '3.12' and python_version >= '3.11'    # Python 3.11
rasterio>=1.3.4     ; python_version < '3.11' and python_version >= '3.10'    # Python 3.10
rasterio>=1.3.4     ; python_version < '3.10'    # Python 3.8-3.9

pandas>=2.1.1     ; python_version < '4.0'  and python_version >= '3.12'    # Python 3.12+
pandas>=1.5.0     ; python_version < '3.12' and python_version >= '3.11'    # Python 3.11
pandas>=1.4.2     ; python_version < '3.11' and python_version >= '3.10'    # Python 3.10
pandas>=1.4.2     ; python_version < '3.10'    # Python 3.8-3.9

# xdev availpkg scikit-learn --request_min=0.24.0
scikit-learn>=1.3.1     ; python_version < '4.0'  and python_version >= '3.12'    # Python 3.12+
scikit-learn>=1.1.3     ; python_version < '3.12' and python_version >= '3.11'    # Python 3.11
scikit-learn>=1.1.0     ; python_version < '3.11' and python_version >= '3.10'    # Python 3.10
scikit-learn>=1.0.2     ; python_version < '3.10' and python_version >= '3.9'    # Python 3.9
scikit-learn>=1.0.2     ; python_version < '3.9' and python_version >= '3.8'    # Python 3.8

scikit-image>=0.22.0    ; python_version < '4.0'  and python_version >= '3.12'   # Python 3.12+
scikit-image>=0.20.0    ; python_version < '3.12' and python_version >= '3.11'   # Python 3.11
scikit-image>=0.19.0    ; python_version < '3.11' and python_version >= '3.10'   # Python 3.10
scikit-image>=0.18.0    ; python_version < '3.10' and python_version >= '3.9'   # Python 3.9
scikit-image>=0.17.2    ; python_version < '3.9' and python_version >= '3.8'    # Python 3.8

jq>=1.5.0  ;                             python_version >= '3.11' and platform_system!='Windows'    # Python 3.11+
jq>=1.2.2  ; python_version < '3.11' and python_version >= '3.10' and platform_system!='Windows'    # Python 3.10
jq>=1.2.1  ; python_version < '3.10' and platform_system!='Windows'    # Python 3.8-3.9

# Pinned due to CRS issue. Unsure if this is necessary. Need to check dashboards.
# TODO: try and fix and unpin pyproj 
pyproj>=3.6.1        ; python_version < '4.0'  and python_version >= '3.12'    # Python 3.12+
pyproj>=3.4.1,<3.5.0 ; python_version < '3.12' and python_version >= '3.11'    # Python 3.11+
pyproj>=3.3.1,<3.5.0 ; python_version < '3.11' and python_version >= '3.10'    # Python 3.10
pyproj>=3.2.1,<3.5.0 ;  python_version <  '3.10'    # Python 3.8-3.9

# Need to update to 1.9.5
fiona>=1.9.5          ; python_version < '4.0'  and python_version >= '3.12'    # Python 3.12
fiona>=1.8.22,<1.9.0  ; python_version < '3.12'  and python_version >= '3.11'    # Python 3.11
fiona>=1.8.22,<1.9.0  ; python_version < '3.11' and python_version >= '3.10'    # Python 3.10
fiona>=1.8.22,<1.9.0  ;  python_version <  '3.10'    # Python 3.8-3.9

matplotlib>=3.8.2  ; python_version < '4.0'  and python_version >= '3.12'    # Python 3.12+
matplotlib>=3.8.2  ; python_version < '3.12' and python_version >= '3.11'    # Python 3.11
matplotlib>=3.8.2  ; python_version < '3.11' and python_version >= '3.10'    # Python 3.10
matplotlib>=3.6.2  ; python_version <  '3.10'    # Python 3.8-3.9

Pillow>=10.0.0     ; python_version < '4.0'  and python_version >= '3.12'  # Python 3.12
Pillow>=9.2.0     ; python_version < '3.12' and python_version >= '3.11'  # Python 3.11
Pillow>=9.1.0     ; python_version < '3.11' and python_version >= '3.10'  # Python 3.10
Pillow>=8.0.0     ; python_version < '3.10' and python_version >= '3.6'    # Python 3.6-3.9

rtree>=1.2.0  ; python_version < '4.0' and python_version >= '3.12'    # Python 3.12+
rtree>=1.0.1  ; python_version < '3.12' and python_version >= '3.11'    # Python 3.11
rtree>=1.0.0  ; python_version < '3.11' and python_version >= '3.10'    # Python 3.10
rtree>=0.9.7  ; python_version < '3.10'    # Python 3.8-3.9

# python ~/local/tools/supported_python_versions_pip.py mgrs
mgrs>=1.4.6     ; python_version < '4.0'  and python_version >= '3.12'    # Python 3.12+
mgrs>=1.4.6     ; python_version < '3.12' and python_version >= '3.11'    # Python 3.11
mgrs>=1.4.3     ; python_version < '3.11' and python_version >= '3.10'    # Python 3.10
mgrs>=1.4.3     ; python_version < '3.10' and python_version >= '3.9'     # Python 3.9
mgrs>=1.4.3     ; python_version < '3.10' and python_version >= '3.9'    # Python 3.9
mgrs>=1.4.3     ; python_version < '3.9'  and python_version >= '3.8'    # Python 3.8

# Numeric
kwarray>=0.6.19
einops>=0.6.0

# Utilities
rich>=12.3.0
parse>=1.19.0
affine>=2.3.0
ubelt>=1.3.6
xmltodict>=0.12.0
requests>=2.27.1
xarray>=0.17.0

pint>=0.23      ; python_version < '4.0'  and python_version >= '3.12'    # Python 3.12+
pint>=0.18      ; python_version < '3.12'                                 # Python 3.11-

pygtrie>=2.5.0     ; python_version < '4.0'  and python_version >= '3.13'    # Python 3.13+
pygtrie>=2.5.0     ; python_version < '3.13' and python_version >= '3.6'     # Python 3.6

girder_client>=3.1.15
lxml>=5.1.0     ; python_version < '4.0'  and python_version >= '3.12'    # Python 3.11+
lxml>=4.9.2     ; python_version < '3.12' and python_version >= '3.11'    # Python 3.11+
lxml>=4.6.3     ; python_version < '3.11' and python_version >= '3.10'    # Python 3.10
lxml>=4.5.2     ; python_version < '3.10' and python_version >= '3.9'     # Python 3.9
lxml>=4.4.1     ; python_version < '3.9'  and python_version >= '3.8'     # Python 3.8
lxml>=4.2.4     ; python_version < '3.8'  and python_version >= '3.7'     # Python 3.7

pystac_client>=0.5.1
scriptconfig>=0.7.10
networkx>=2.8
python_dateutil>=2.8.2
pytimeparse>=1.1.8
progiter>=1.1.0

# Imaging
distinctipy>=1.2.1 ; python_version < '4.0' and python_version >= '3.8'  # Python 3.8+
kwimage>=0.10.0
delayed_image>=0.3.1

tifffile>=2022.8.12 ; python_version < '4.0'  and python_version >= '3.12'   # Python 3.12+
tifffile>=2021.4.8  ; python_version < '3.12' # Python 3.11

# Plotting
kwplot>=0.4.14
seaborn>=0.11.1

# GIS
geopandas>=0.10.2,<1.0.0
utm>=0.7.0
rgd_imagery_client>=0.2.7
rgd_client>=0.2.7
geojson>=3.1.0     ; python_version < '4.0'  and python_version >= '3.12'   # Python 3.12+
geojson>=3.0.1     ; python_version < '3.12' and python_version >= '3.8'    # Python 3.11-


ruamel.yaml>=0.17.22,<=0.17.32

lazy_loader>=0.3; python_version < '4.0'  and python_version >= '3.12'   # Python 3.12+
lazy_loader>=0.1; python_version < '3.12' and python_version >= '3.8'   # Python 3.11-

kwutil>=0.2.5
