[tool.poetry]
name = "pipeline-eds"
version = "0.3.65"
description = "A Python API pipeline library and CLI toolkit for Emerson Ovation EDS systems — built for engineers, control technicians, and wastewater SCADA teams."

authors = ["George Clayton Bennett <george.bennett@memphistn.gov>"]
license = "MIT"
readme = "README.md"
packages = [
    { include = "pipeline", from = "src" },
	{ include = "workspaces", from = "." }
] # This makes `pipeline` available as an importable top-level module
homepage = "https://github.com/city-of-memphis-wastewater/pipeline"
repository = "https://github.com/city-of-memphis-wastewater/pipeline"
include = [
    "src/pipeline/data/*"
]

classifiers=[
    "Programming Language :: Python :: 3",
    "License :: OSI Approved :: MIT License",
    "Operating System :: OS Independent",
    "Intended Audience :: Developers",
	"Intended Audience :: System Administrators",
    "Intended Audience :: Science/Research",
    "Topic :: Scientific/Engineering :: Information Analysis",
    "Topic :: Scientific/Engineering :: Visualization",
    "Environment :: Console",
    "Topic :: Software Development :: Libraries :: Python Modules",
	"Topic :: Utilities",
]
	
[tool.poetry.scripts]
pipeline = "pipeline.cli:app" # for installation of pipeline as a CLI. Ex: pipeline trend M100FI -s June3 -f June17
eds = "pipeline.cli:app" # alias eds for pipeline CLI
pipeline-eds = "pipeline.cli:app" # alias eds for pipeline CLI


[tool.pytest.ini_options]
markers = [
    "slow: marks tests as slow (deselect with '-m \"not slow\"')",
]
#addopts = "--cov=pipeline --cov-report=html" #  visually inspect coverage, e.g. before a release or PR.
addopts = "-ra --cov=pipeline --cov-report=term-missing" # for development — fast and informative in terminal.
testpaths = ["tests"]
pythonpath = ["src", "."]

[tool.poetry.dependencies]
python = ">=3.8.0,<3.15"

# backports.tarfile is required due to a transitive dependency (likely jaraco.context's
# use of tarball functionality) which unconditionally imports the backport, even
# though standard Python 3.x includes the necessary functionality.
"backports.tarfile" = "^1.2" # <--- Unconditional entry (no python marker)
cherrypy = "^18.10.0"
colorama = [
    { version = "^0.4.6", python = ">=3.8,<3.15" }
]
distro = "^1.9.0"
#fastapi = "^0.116.1" # version clarity introduced in v0.3.55
# fastapi: align the FastAPI version split with the Pydantic v1/v2 transition (Python 3.12).
fastapi = [
    { version = "^0.116.1", python = ">=3.12" },  # Use modern FastAPI for Python >=3.12 (where Pydantic V2 is mandatory)
    { version = "0.99.1", python = "<3.12" },     # Use last FastAPI that officially supported Pydantic V1 (for Python 3.8-3.11)
]
freesimplegui = "^5.2.0.post1"
# keyring: Version 25.x requires Python >=3.9, so we pin 24.x for 3.8.
keyring = [
    { version = "^25.6.0", python = ">=3.9" },
    { version = "^24.3", python = "3.8.*" },
]

keyrings-alt = "^5.0.2"
matplotlib = [
    { version = "^3.10.6", python = ">=3.10", optional = true },
    { version = "^3.9.0", python = "3.9.*", optional = true },
    { version = "^3.7", python = "3.8.*", optional = true },
]
# mysql-connector-python: Version 9.1.0+ requires Python >=3.9. We pin 8.3.x for 3.8.
mysql-connector-python = [
    { version = "^9.3.0", python = ">=3.9" },
    { version = "^8.3.0", python = "3.8.*" },
]
# pendulum: Version 3.x requires Python >=3.9, so we pin 2.x for 3.8. 
pendulum = [
    { version = "^3.1.0", python = ">=3.9" },
    { version = "^2.1.2", python = "3.8.*" },
]

plotly = "^6.2.0"

#pydantic = "1.10.13" # version clarity introduced in v0.3.55
pydantic = [
    { version = "^2.0.0", python = ">=3.12" },    # Use V2 for Python 3.12 and newer
    { version = "1.10.13", python = "<3.12" },    # Use V1 for Python 3.8 through 3.11
]

pyhabitat = "^1.0.35"	
pyodbc = { version = "^5.1.0", optional = true }
pyyaml = ">=6.0.2,<7.0.0"
requests = ">=2.32.3,<3.0.0"

#rich = "^14.1.0"
# rich: Pin to an older version for Python <3.10, where Streamlit 1.25.x is used (which requires rich <14)
rich = [
    { version = "^14.1.0", python = ">=3.10" }, # Use the latest rich for modern Python
    { version = "^10.14.0", python = "<3.10" },  # Use rich <14 for Python 3.8-3.9
]
# NOTE: Rich version 1.25.0 (pinned for <3.10) requires rich < 14, causing the next error.

suds-py3 = "^1.4.5.0"
toml = ">=0.10.2,<0.11.0"
typer = "^0.17.4"
tzdata = "^2025.2"
# urllib3: Version 2.x requires Python >=3.9, so we pin 1.26.x for 3.8.
urllib3 = [
    { version = "^2.4.0", python = ">=3.9" },
    { version = "^1.26.19", python = "3.8.*" }, # Pinning latest 1.x patch for security
]
# uvicorn: Version 0.34.0 dropped Python 3.8 support, so we pin 0.33.x for 3.8.
uvicorn = [
    { version = "^0.34.3", python = ">=3.9" },
    { version = "^0.33.0", python = "3.8.*" },
]

[tool.poetry.dependencies."backports.zoneinfo"] # known poetry quirk necessary when freezing, a la "poetry export -f requirements.txt --without-hashes > requirements.txt"
version = "^0.2.1"
python = "<3.9"
optional = false


#[tool.poetry.dependencies."backports.tarfile"]
## backports.tarfile is required due to a transitive dependency (likely jaraco.context's
## use of tarball functionality) which unconditionally imports the backport, even
## though standard Python 3.x includes the necessary functionality.
#version = "^1.2" # or appropriate version
#python = "<3.9" # Or whatever version makes the standard library tarfile available
#optional = false

[tool.poetry.extras] # pipx install pipeline-eds[windows]
windows = ["pyodbc","matplotlib"]
mpl = ["matplotlib"]

[tool.poetry.group.dev.dependencies]
# pytest: Version 8.x requires Python >=3.9, so we pin 7.x for 3.8.
pytest = [
    { version = "^8.4.1", python = ">=3.9" }, # Upgraded to latest version for 3.9+
    { version = "^7.4", python = "3.8.*" },
]
#pytest = "^7.4" # "^8.4.1" caps at >3.9
#pytest-cov = "^5.0" # ^6.2.1"
# pytest-cov: Version 6.x requires Python >=3.9, so we pin 5.x for 3.8.
pytest-cov = [
    { version = "^6.2.1", python = ">=3.9" }, # Upgraded to latest version for 3.9+
    { version = "^5.0", python = "3.8.*" },
]
pygal = "^3.0.5"
pyinstaller = "^6.16.0"

[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.plugins."scripts"]
controller = "pipeline.daemon.controller:main_cli"
