@@ -36,72 +36,76 @@ dependencies = [
3636 # Core scientific computing
3737 " numpy >= 1.21.5, < 3" ,
3838 " pandas >= 2.0.0, < 3" ,
39+ " xarray >= 2024.2.0, < 2026.0" , # CalVer: allow through next calendar year
3940 # Optimization and data handling
40- " linopy >= 0.5.1, < 0.5. 6" , # Update and test regularly
41+ " linopy >= 0.5.1, < 0.6" , # Widened from patch pin to minor range
4142 " netcdf4 >= 1.6.1, < 2" ,
4243 # Utilities
43- " PyYAML >= 6.0.0, < 7" ,
44- " rich >= 13.0.0" ,
45- " tomli >= 2.0.1; python_version < '3.11'" , # Only needed with python 3.10 or earlier
44+ " pyyaml >= 6.0.0, < 7" ,
45+ " rich >= 13.0.0, < 15 " ,
46+ " tomli >= 2.0.1, < 3 ; python_version < '3.11'" , # Only needed with python 3.10 or earlier
4647 # Default solver
47- " highspy >= 1.5.3" ,
48+ " highspy >= 1.5.3, < 2 " ,
4849
4950 # Visualization
50- " matplotlib >= 3.5.2, < 4.0.0 " ,
51- " plotly >= 5.15.0, < 6.0.0 " ,
51+ " matplotlib >= 3.5.2, < 4" ,
52+ " plotly >= 5.15.0, < 7 " ,
5253]
5354
5455[project .optional-dependencies ]
5556# Interactive network visualization with enhanced color picker
56- network-viz = [
57- " dash >= 3.0.0" ,
58- " dash-cytoscape >= 1.0.0" ,
59- " dash-daq >= 0.6.0" ,
60- " networkx >= 3.0.0" ,
61- " werkzeug >= 3.0.0" ,
57+ network_viz = [
58+ " dash >= 3.0.0, < 4" ,
59+ " dash-cytoscape >= 1.0.0, < 2" ,
60+ " dash-daq >= 0.6.0, < 1" ,
61+ " networkx >= 3.0.0, < 4" ,
62+ " werkzeug >= 3.0.0, < 4" ,
63+ " flask >= 3.0.0, < 4" , # Explicit Flask cap to prevent transitive major bumps
6264]
6365
6466# Full feature set (everything except dev tools)
6567full = [
66- " pyvis == 0.3.1" , # Visualizing FlowSystem Network
67- " tsam >= 2.3.1, < 3.0.0" , # Time series aggregation
68- " scipy >= 1.15.1, < 2.0.0" , # Used by tsam. Prior versions have conflict with highspy. See https://github.com/scipy/scipy/issues/22257
69- " gurobipy >= 10.0.0" ,
70- " dash >= 3.0.0" , # Visualizing FlowSystem Network as app
71- " dash-cytoscape >= 1.0.0" , # Visualizing FlowSystem Network as app
72- " dash-daq >= 0.6.0" , # Visualizing FlowSystem Network as app
73- " networkx >= 3.0.0" , # Visualizing FlowSystem Network as app
74- " werkzeug >= 3.0.0" , # Visualizing FlowSystem Network as app
68+ " pyvis==0.3.2" , # Visualizing FlowSystem Network
69+ " tsam >= 2.3.1, < 3" , # Time series aggregation
70+ " scipy >= 1.15.1, < 2" , # Used by tsam. Prior versions have conflict with highspy. See https://github.com/scipy/scipy/issues/22257
71+ " gurobipy >= 10.0.0, < 13" ,
72+ " dash >= 3.0.0, < 4" , # Visualizing FlowSystem Network as app
73+ " dash-cytoscape >= 1.0.0, < 2" , # Visualizing FlowSystem Network as app
74+ " dash-daq >= 0.6.0, < 1" , # Visualizing FlowSystem Network as app
75+ " networkx >= 3.0.0, < 4" , # Visualizing FlowSystem Network as app
76+ " werkzeug >= 3.0.0, < 4" , # Visualizing FlowSystem Network as app
77+ " flask >= 3.0.0, < 4" , # Explicit Flask cap to prevent transitive major bumps
7578]
7679
7780# Development tools and testing
7881dev = [
79- " pytest >= 7.0.0" ,
80- " ruff >= 0.9.0" ,
81- " pre-commit >= 4.0.0" ,
82- " pyvis == 0.3.1" , # Visualizing FlowSystem
83- " tsam >= 2.3.1, < 3.0.0" , # Time series aggregation
84- " scipy >= 1.15.1, < 2.0.0" , # Used by tsam. Prior versions have conflict with highspy. See https://github.com/scipy/scipy/issues/22257
85- " gurobipy >= 10.0.0" ,
86- " dash >= 3.0.0" ,
87- " dash-cytoscape >= 1.0.0" ,
88- " dash-daq >= 0.6.0" ,
89- " networkx >= 3.0.0" ,
90- " werkzeug >= 3.0.0" ,
82+ " pytest==8.4.2" ,
83+ " nbformat==5.10.4" ,
84+ " ruff==0.13.0" ,
85+ " pre-commit==4.3.0" ,
86+ " pyvis==0.3.2" ,
87+ " tsam==2.3.1" ,
88+ " scipy==1.15.1" ,
89+ " gurobipy==12.0.3" ,
90+ " dash==3.0.0" ,
91+ " dash-cytoscape==1.0.2" ,
92+ " dash-daq==0.6.0" ,
93+ " networkx==3.0.0" ,
94+ " werkzeug==3.0.0" ,
9195]
9296
9397# Documentation building
9498docs = [
95- " mkdocs-material >= 9.0.0, < 10 " ,
96- " mkdocstrings-python >= 1.0.0 " ,
97- " mkdocs-table-reader-plugin >= 2.0 .0" ,
98- " mkdocs-gen-files >= 0.4 .0" ,
99- " mkdocs-include-markdown-plugin >= 6.0.0 " ,
100- " mkdocs-literate-nav >= 0.6.0 " ,
101- " markdown-include >= 0.8.0 " ,
102- " pymdown-extensions >= 10.0.0 " ,
103- " pygments >= 2.14.0 " ,
104- " mike >= 2.0.0 " ,
99+ " mkdocs-material==9.6.19 " ,
100+ " mkdocstrings-python==1.18.2 " ,
101+ " mkdocs-table-reader-plugin==3.1 .0" ,
102+ " mkdocs-gen-files==0.5 .0" ,
103+ " mkdocs-include-markdown-plugin==7.1.7 " ,
104+ " mkdocs-literate-nav== 0.6.2 " ,
105+ " markdown-include== 0.8.1 " ,
106+ " pymdown-extensions== 10.16.1 " ,
107+ " pygments==2.19.2 " ,
108+ " mike==2.1.3 " ,
105109]
106110
107111[project .urls ]
@@ -120,6 +124,7 @@ exclude = ["tests", "docs", "examples", "examples.*", "Tutorials", ".git", ".vsc
120124version_scheme = " post-release"
121125
122126[tool .ruff ]
127+ target-version = " py310" # Adjust to your minimum version
123128# Files or directories to exclude (e.g., virtual environments, cache, build artifacts)
124129exclude = [
125130 " venv" , # Virtual environments
@@ -133,10 +138,26 @@ exclude = [
133138line-length = 120
134139
135140[tool .ruff .lint ]
136- select = [" E" , " F" , " W" , " I" , " B" , " N" ] # Enable linting rules by category (e.g., error, warnings, unused imports)
141+ select = [
142+ # Core Python issues
143+ " E" , # pycodestyle errors (PEP 8 violations)
144+ " F" , # Pyflakes (undefined names, unused imports, etc.)
145+ " W" , # pycodestyle warnings (whitespace, line length, etc.)
146+
147+ # Code organization
148+ " I" , # isort (import sorting and organization)
149+ " B" , # flake8-bugbear (likely bugs and design problems)
150+ " N" , # pep8-naming (naming convention violations)
151+
152+ # Modern Python upgrades
153+ " UP" , # pyupgrade (modernize syntax for target Python version)
154+ " FA" , # flake8-future-annotations (enforce `from __future__ import annotations`)
155+ " TCH" , # flake8-type-checking (optimize imports for type checking)
156+ ]
137157ignore = [ # Ignore specific rules
138- " E501" , # Ignore line-length checks (use Black for formatting)
139158 " F401" , # Allow unused imports in some cases (use __all__)
159+ " UP038" ,
160+ " E501" # ignore long lines
140161]
141162extend-fixable = [" B" ] # Enable fix for flake8-bugbear (`B`), on top of any rules specified by `fixable`.
142163
@@ -151,6 +172,9 @@ quote-style = "single"
151172indent-style = " space"
152173docstring-code-format = true
153174
175+ [tool .ruff .lint .pyupgrade ]
176+ keep-runtime-typing = false # Allow pyupgrade to drop runtime typing; prefer postponed annotations
177+
154178[tool .bandit ]
155179skips = [" B101" , " B506" ] # assert_used and yaml_load
156180exclude_dirs = [" tests/" ]
0 commit comments