# Core dependencies needed at runtime that that should install without much issue

### 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.23.5    ;                             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'    # Python 3.8-3.9

scipy>=1.9.3     ;                             python_version >= '3.11'    # Python 3.11+
scipy>=1.8.1     ; python_version < '3.11' and python_version >= '3.10'    # Python 3.10
scipy>=1.8.0     ; python_version < '3.10'    # Python 3.8-3.9

shapely>=2.0.1   ;                             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'    # Python 3.8-3.9

rasterio>=1.3.5     ;                             python_version >= '3.11'    # Python 3.11+
rasterio>=1.3.5     ; python_version < '3.11' and python_version >= '3.10'    # Python 3.10
rasterio>=1.3.5    ; python_version < '3.10'    # Python 3.8-3.9

pandas>=1.5.3,<2.0.0 ;                             python_version >= '3.11'    # Python 3.11+
pandas>=1.5.3,<2.0.0 ; python_version < '3.11' and python_version >= '3.10'    # Python 3.10
pandas>=1.5.3,<2.0.0 ; python_version < '3.10'    # Python 3.8-3.9

scikit_learn>=1.1.3     ; python_version < '4.0'  and python_version >= '3.11'    # Python 3.11+
scikit_learn>=1.1.1     ; python_version < '3.11' and python_version >= '3.10'    # Python 3.10
scikit_learn>=1.1.0     ; python_version < '3.10'    # Python 3.8-3.9

scikit_image>=0.20.0  ;  python_version < '4.0'  and python_version >= '3.11'    # Python 3.11+
scikit_image>=0.19.3  ;  python_version < '3.11' and python_version >= '3.10'    # Python 3.10
scikit_image>=0.18.1  ;  python_version <  '3.10'    # Python 3.8-3.9

jq>=1.7.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

jsonschema>=4.19.2

# Pinned due to CRS issue. Unsure if this is necessary. Need to check dashboards.
# TODO: try and fix and unpin pyproj 
pyproj>=3.4.1,<3.5.0 ;                             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.8.22,<1.9.0  ;                             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.4.1  ; python_version <  '3.10'    # Python 3.8-3.9

Pillow>=10.2.0
#Pillow>=9.2.0     ;                             python_version >= '3.11'    # Python 3.11+
#Pillow>=9.1.1     ; python_version < '3.11' and python_version >= '3.10'    # Python 3.10
#Pillow>=8.0.1     ; python_version <  '3.10'    # Python 3.8-3.9

psutil>=5.9.6     ; python_version < '4.0'  and python_version >= '3.12'    # Python 3.12+
psutil>=5.9.6     ; python_version < '3.12' and python_version >= '3.11'    # Python 3.11
psutil>=5.9.6     ; python_version < '3.11' and python_version >= '3.10'    # Python 3.10
psutil>=5.9.6     ; python_version <  '3.10'    # Python 3.8-3.9

rtree>=1.0.1  ;                             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

sqlalchemy>=1.4.50  ;                             python_version >= '3.11'    # Python 3.11+
sqlalchemy>=1.4.37  ; python_version < '3.11' and python_version >= '3.10'    # Python 3.10
sqlalchemy>=1.3.22  ; python_version <  '3.10'    # Python 3.8-3.9

xxhash>=3.4.1     ; python_version < '4.0'  and python_version >= '3.12'    # Python 3.12+
xxhash>=3.4.1     ; python_version < '3.12' and python_version >= '3.11'    # Python 3.11
xxhash>=3.0.0     ; python_version < '3.11' and python_version >= '3.10'    # Python 3.10
xxhash>=3.0.0     ; python_version < '3.10' and python_version >= '3.9'     # Python 3.9
xxhash>=1.4.4     ; python_version <= '3.8'    # Python 3.8

# xdev availpkg numexpr
numexpr>=2.8.4     ; python_version < '4.0'  and python_version >= '3.11'    # Python 3.11+
numexpr>=2.8.1     ; python_version < '3.11' and python_version >= '3.10'    # Python 3.10
numexpr>=2.7.3     ; python_version < '3.10' and python_version >= '3.9'    # Python 3.9
numexpr>=2.7.3     ; python_version < '3.9'  and python_version >= '3.8'    # Python 3.8

# xdev availpkg 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.3.7     ; python_version < '3.9'  and python_version >= '3.8'    # Python 3.8

# Numeric
kwarray>=0.6.18
xarray>=0.17.0
filterpy>=1.4.5
einops>=0.6.0
dask[array]>=2023.8.1

# Dask related
# cytoolz>=0.11.2
# xxhash>=3.0.0
# cityhash>=0.4.1

### Note: this relies on pygeos which is deprecated.
## dask-geopandas>=0.2.0

# Pygeos is deprecated and merged into shapley 2.0
# # Waiting for 3.11 support
# pygeos>=0.13    ;  python_version < '3.11' and python_version >= '3.10'    # Python 3.10+ 
# pygeos>=0.10.2  ;  python_version <  '3.10'    # Python 3.8-3.9

# Utilities
rich>=12.5.1
textual>=0.1.18
text_unidecode>=1.3
configargparse>=1.7.0
parse>=1.19.0
affine>=2.3.0
ubelt>=1.3.4
xmltodict>=0.12.0
Pygments>=2.12.0
requests>=2.27.1
fasteners>=0.17.3
kwutil>=0.2.5

blake3>=0.3.1  ;  python_version < '4' and python_version >= '3.11'    # Python 3.11+ 
blake3>=0.2.1  ;  python_version < '3.11' # Python 3.10- 

more_itertools>=8.12.0
pint >= 0.18
# retry>=0.9.2


girder_client>=3.1.15

lxml>=4.9.2     ; python_version < '4.0'  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

tempenv>=0.2.0
pystac_client>=0.5.1
scriptconfig>=0.7.10

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

# protobuf>=3.15.8
networkx>=2.8.0
python_dateutil>=2.8.2
pytimeparse>=1.1.8
progiter>=1.1.0
fire>=0.4.0

# Parsing
lark >= 1.1.7
lark_cython >= 0.0.15

# Imaging
distinctipy>=1.2.1
kwimage>=0.9.25
kwcoco>=0.7.7
delayed_image>=0.2.12

# Try 1.3.1?
albumentations==1.0.0  # pinned for invariants model

ndsampler>=0.7.8
tifffile>=2021.4.8

# Includes SimpleITK. Used in depth predictor.
medpy>=0.4.0

# Plotting
kwplot>=0.4.14
seaborn>=0.11.1

# GIS
geopandas>=0.10.2
utm>=0.7.0
rgd_imagery_client>=0.2.7
rgd_client>=0.2.7
geojson>=3.0.1

# Machine learning

# Note: torch 1.10 does not run latest models
torch>=2.0.0        ; python_version < '4.0'  and python_version >= '3.11'  # Python 3.11+
torch>=1.12.0       ; python_version < '3.11'                               # Python 3.10-

torchvision>=0.15.1 ; python_version < '4.0'  and python_version >= '3.11'  # Python 3.11+
torchvision>=0.13.0 ; python_version < '3.11'                               # Python 3.10-


torchmetrics>=0.11.0
torch_liberator>=0.2.1

omegaconf >=2.3
hydra-core >=1.3.2

#pytorch_lightning[extra]>=1.8.6,<2.0.0
#pytorch_lightning[extra]>=1.8.6
#pytorch_lightning>=1.9.0


# FIXME: pinned because update broke our aliases
jsonargparse[signatures]==4.19.0
pytorch_lightning==2.0.8
#pytorch_lightning>=2.0.8
#jsonargparse[signatures]>=4.24.1

monai>=0.8.0     ; python_version < '4.0'  and python_version >= '3.11'    # Python 3.11+
monai>=0.6.0     ; python_version < '3.11' 

torch_optimizer>=0.1.0
netharn>=0.6.1

timm>=0.6.13,<0.9.0 ; python_version < '4.0'  and python_version >= '3.11'  # Python 3.11+
timm>=0.4.12,<0.9.0 ; python_version < '3.11'                               # Python 3.10-

# Do we need to pin this?
#kornia<=0.5
kornia>=0.6.8
segmentation-models-pytorch>=0.2.0  ; python_version < '3.11'

ujson>=5.6.0 ; python_version < '4.0'  and python_version >= '3.11'  # Python 3.11+
ujson>=5.2.0 ; python_version < '3.11'                               # Python 3.10-

kwimage_ext >= 0.2.1; platform_system=="Linux"

py-cpuinfo>=9.0.0     ; python_version < '4.0'  and python_version >= '3.13'    # Python 3.13+
py-cpuinfo>=9.0.0     ; python_version < '3.13' and python_version >= '3.6'     # Python 3.6


ruamel.yaml>=0.17.22,<=0.17.32

ijson>=3.2.1 ; python_version < '4.0'  and python_version >= '3.13'    # Python 3.13+
ijson>=3.2.1 ; python_version < '3.13' and python_version >= '3.12'    # Python 3.12
ijson>=3.2.1 ; python_version < '3.12' and python_version >= '3.11'    # Python 3.11
ijson>=3.2.1 ; python_version < '3.11' and python_version >= '3.10'    # Python 3.10
ijson>=3.1.4 ; python_version < '3.10' and python_version >= '3.6'     # Python 3.6-3.9

lazy_loader>=0.3

colormath>=3.0.0

imagesize>=1.4.1
pytorch_msssim==0.1.5

absl_py>=1.4.0

# PyYAML>=6.0

PyYAML>=6.0
tqdm>=4.64.1

cmd_queue >= 0.1.20

# NOTE: It is difficult to pin a minimum version of fsspec because of its
# interactions with other libraries.
fsspec>=2023.6.0
# fsspec>=2022.10.0
s3fs>=2023.6.0

portion>=2.4.1
