Skip to content

Commit

Permalink
Fix dependency specifications for recent uv, avoiding nested workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeNaccarato committed Jan 16, 2025
1 parent 59ff04d commit 9d552a4
Show file tree
Hide file tree
Showing 8 changed files with 576 additions and 617 deletions.
16 changes: 12 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ exclude: |
(?x)^(
\.copier-answers\.yml
|changelog/towncrier_template\.md\.jinja
|lock.*\.json
)$
ci:
skip:
Expand Down Expand Up @@ -96,9 +97,16 @@ repos:
docs/.*\.ipynb
)$
- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: "v4.6.0"
rev: "v5.0.0"
hooks:
- id: "check-illegal-windows-names"
- id: "check-merge-conflict"
- id: "destroyed-symlinks"
- id: "detect-private-key"
- id: "end-of-file-fixer"
- id: "mixed-line-ending"
- id: "trailing-whitespace"
args: [--markdown-linebreak-ext=md]
- id: "trailing-whitespace"
- repo: "https://github.com/iterative/dvc"
rev: "3.51.2"
Expand Down Expand Up @@ -130,11 +138,11 @@ repos:
- repo: "https://github.com/rbubley/mirrors-prettier"
rev: "v3.3.3"
hooks:
- id: "prettier"
- id: prettier
- repo: https://github.com/ComPWA/taplo-pre-commit
rev: "v0.9.3"
rev: v0.9.3
hooks:
- id: "taplo-format"
- id: taplo-format
- repo: "https://github.com/charliermarsh/ruff-pre-commit"
rev: "v0.5.1"
hooks:
Expand Down
2 changes: 1 addition & 1 deletion .uv-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.2
0.5.20
38 changes: 18 additions & 20 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
set shell := ['pwsh', '-Command']
set dotenv-load

dev := '. ./dev.ps1; '
pipeline := 'boilercv_pipeline'
devpy := 'dev'

dev:
. ./dev.ps1

boilercv-preview-write file $BOILERCV_PREVIEW='true' $BOILERCV_WRITE='true':
iuv python {{file}}
{{dev}} iuv python {{file}}
boilercv-debug-preview-write file $BOILERCV_DEBUG='true' $BOILERCV_PREVIEW='true' $BOILERCV_WRITE='true':
iuv python {{file}}
{{dev}} iuv python {{file}}
boilercv-preview preview $BOILERCV_PREVIEW='true':
python -m {{pipeline}}.previews.{{preview}}
{{dev}} python -m {{pipeline}}.previews.{{preview}}

update-binder:
(uv pip compile --config-file requirements/binder_uv.toml \
Expand All @@ -22,29 +20,29 @@ update-binder:
requirements/binder.in \
) -Replace 'opencv-python', 'opencv-python-headless' | Set-Content requirements.txt

dvc-dag: dev
(iuv dvc dag --md) -Replace 'mermaid', '{mermaid}' | Set-Content 'docs/_static/dag.md'
dvc-dag:
{{dev}} (iuv dvc dag --md) -Replace 'mermaid', '{mermaid}' | Set-Content 'docs/_static/dag.md' ;\
markdownlint-cli2 'docs/_static/dag.md'

generate-correlations file correlations: dev
iuv python {{file}} {{correlations}}
generate-correlation-docs: dev
iuv -m boilercv_pipeline.equations.make_docs
generate-correlations file correlations:
{{dev}} iuv python {{file}} {{correlations}}
generate-correlation-docs:
{{dev}} iuv -m boilercv_pipeline.equations.make_docs

hide-notebook-inputs: dev
iuv -m {{devpy}}.docs.patch_nbs
hide-notebook-inputs:
{{dev}} iuv -m {{devpy}}.docs.patch_nbs

pipeline-sync-dvc: dev
iuv -m {{pipeline}} sync-dvc
pipeline-sync-dvc:
{{dev}} iuv -m {{pipeline}} sync-dvc

remove-empty-data-folders:
Get-ChildItem -Path './data', 'docs/data' -Recurse -Directory | \
Where-Object { \
( Get-ChildItem -Path $_ -Recurse -File | Measure-Object ).Count -eq 0 \
} | Remove-Item -Recurse -Force

sync-contrib: dev
iuv -Sync -Update
sync-contrib:
{{dev}} iuv -Sync -Update

sync-local-dev-configs: dev
{{devpy}} sync-local-dev-configs
sync-local-dev-configs:
{{dev}} {{devpy}} sync-local-dev-configs
40 changes: 17 additions & 23 deletions packages/_dev/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,55 +7,49 @@ name = "dev"
version = "0.0.0"
description = "Dev"
dependencies = [
# ? Dev
"cyclopts>=2.9.3",
"dulwich>=0.22.1",
"pydantic-settings>=2.5.2",
"pydantic>=2.9.1",
"python-dotenv>=1.0.1",
# ? Docs
]
[project.scripts]
"dev" = "dev.tools.__main__:main"
[project.optional-dependencies]
docs = [
"devtools>=0.12.2",
"docutils>=0.21.2",
"geopandas>=0.14.3",
"ipython>=8.26.0",
"matplotlib>=3.7.2",
"more-itertools>=10.4.0",
"myst-parser>=3.0.1",
"nbformat>=5.10.4",
"numpydoc>=1.7.0",
"ruamel-yaml>=0.18.6",
"sphinx>=7.3.7",
# ? Other docs
"devtools>=0.12.2",
"geopandas>=0.14.3",
"ipykernel>=6.29.4",
"matplotlib>=3.7.2",
"numpy>=1.24.4",
"numpydoc>=1.7.0",
"pandas[hdf5,performance]>=2.2.2",
"ruamel-yaml>=0.18.6",
"seaborn>=0.13.2",
"shapely>=2.0.3",
"sphinx>=7.3.7",
"sympy>=1.12",
"trackpy>=0.6.2",
# ? Tests
"pytest-harvest>=1.10.5",
"pytest>=8.2.2",
]
[project.scripts]
"dev" = "dev.tools.__main__:main"
tests = ["pytest-harvest>=1.10.5", "pytest>=8.2.2"]

[tool.fawltydeps]
deps = ["packages/_dev/pyproject.toml"]
code = ["packages/_dev", "docs", "tests"]
ignore_undeclared = [
# ? This project
"boilercv",
# TODO
"pycine @ git+https://github.com/ottomatic-io/pycine@815cfca06cafc50745a43b2cd0168982225c6dca",
# ? Workspaces
"dev",
"boilercv_pipeline",
"boilercv",
"boilercine",
"boilercore",
"context_models",
# ? Path-sourced deps
"boilercv_pipeline",
"cachier",
"context_models",
"dev",
]
[tool.fawltydeps.custom_mapping]
ipykernel = ["IPython"]
ruamel-yaml = ["ruamel"]
15 changes: 5 additions & 10 deletions packages/pipeline/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies = [
"cyclopts>=2.6.1",
"dvc>=3.55.2",
"imageio[pyav]>=2.34.1",
"ipykernel>=6.29.4",
"ipython>=8.26.0",
"loguru>=0.7.0",
"matplotlib>=3.7.2",
"more-itertools>=10.4.0",
Expand Down Expand Up @@ -51,21 +51,16 @@ cv = ["opencv-python>=4.10.0.84"]
deps = ["packages/pipeline/pyproject.toml"]
code = ["packages/pipeline/boilercv_pipeline"]
ignore_undeclared = [
# ? This project
"boilercv",
# TODO
"pycine @ git+https://github.com/ottomatic-io/pycine@815cfca06cafc50745a43b2cd0168982225c6dca",
# ? Workspaces
"dev",
"boilercv_pipeline",
"boilercv",
"boilercine",
"boilercore",
"context_models",
# ? Path-sourced deps
"boilercv_pipeline",
"cachier",
"context_models",
"dev",
]
ignore_unused = [
"pyarrow", # Used in `boilercv_pipeline.__init__`
]
[tool.fawltydeps.custom_mapping]
ipykernel = ["IPython"]
87 changes: 46 additions & 41 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
[build-system]
requires = ["flit_core==3.9.0"]
requires = ["flit-core==3.9.0"]
build-backend = "flit_core.buildapi"

[project]
name = "boilercv"
authors = [
{ name = "Blake Naccarato", email = "[email protected]" },
{ name = "Kwang Jin Kim" },
]
version = "2024.1.3"
description = "Computer vision routines suitable for nucleate pool boiling bubble analysis"
readme = "README.md"
Expand All @@ -18,7 +22,6 @@ classifiers = [
# "Programming Language :: Python :: 3.14", # ? Not yet beta (https://peps.python.org/pep-0745)
]
dependencies = [
# TODO
"context-models>=0.0.1",
"matplotlib>=3.7.2",
"numpy>=1.24.4",
Expand All @@ -33,58 +36,50 @@ dependencies = [
"netcdf4>=1.6.5",
"netcdf4!=1.7.1.post1 ; sys_platform == 'linux'",
]
[project.optional-dependencies]
# * Minimal CV flavor needed, but allow `boilercv` to coexist with different flavors
cv = ["opencv-python>=4.10.0.84"]
[project.urls]
Changes = "https://softboiler.github.io/boilercv/changelog.html"
Docs = "https://softboiler.github.io/boilercv"
Home = "https://github.com/softboiler/boilercv"
Tracker = "https://github.com/softboiler/boilercv/issues"
[[project.authors]]
name = "Blake Naccarato, Kwang Jin Kim"
email = "[email protected]"

[tool.uv]
override-dependencies = ["cachier @ ${PROJECT_ROOT}/packages/cachier"]
constraint-dependencies = [
# ? Security
"fiona>=1.10.1",
"setuptools>=70.0.0",
# ? https://nvd.nist.gov/vuln/detail/CVE-2024-37891
# ? via sphinx
"urllib3>=2.2.2",
[project.optional-dependencies]
# * Minimal CV flavor needed, but allow `boilercv` to coexist with different flavors
cv = ["opencv-python>=4.10.0.84"]
[dependency-groups]
all = [
{ include-group = "packages" },
{ include-group = "dev" },
{ include-group = "docs" },
{ include-group = "tests" },
]
dev-dependencies = [
# TODO
"pycine @ git+https://github.com/ottomatic-io/pycine@815cfca06cafc50745a43b2cd0168982225c6dca",
# ? Workspaces
packages = [
"boilercine",
"boilercore",
"boilercv_pipeline",
"context_models",
"dev",
# ? Path-sourced deps
"boilercv-pipeline",
"dev[docs,tests]",
"cachier",
# ? Dev
"context-models",
]
dev = [
# TODO
"pycine @ git+https://github.com/ottomatic-io/pycine@815cfca06cafc50745a43b2cd0168982225c6dca",
"debugpy>=1.8.2",
"dvc[gs]>=3.55.2",
"fawltydeps>=0.16.0",
"ipython>=8.26.0",
"ipykernel>=6.29.4",
"pandas-stubs~=2.2.2",
"pipdeptree>=2.23.0",
"pipx>=1.6.0",
"pre-commit>=3.7.1",
"pre-commit>=4.0.1",
"pyright>=1.1.371",
"ruff>=0.5.1",
"rust-just>=1.36.0",
"snakeviz>=2.2.0",
"sourcery>=1.21.0",
"towncrier>=23.11.0",
# ? Docs
]
docs = [
"linkify-it-py>=2.0.3",
"myst-nb>=1.1.1",
"myst-parser>=3.0.1",
"sphinx-autobuild>=2024.4.16",
"sphinx-autodoc2>=0.5.0",
"sphinx-book-theme>=1.1.3",
Expand All @@ -95,30 +90,40 @@ dev-dependencies = [
"sphinxcontrib-bibtex>=2.6.2",
"sphinxcontrib-mermaid>=0.9.2",
"sphinxcontrib-towncrier>=0.4.0a0",
# ? Tests
]
tests = [
"pytest-cov>=5.0.0",
"pytest-custom-exit-code>=0.3.0",
"pytest-github-actions-annotate-failures>=0.2.0",
"pytest-plt>=1.1.1",
"pytest-xdist[psutil,setproctitle]>=3.6.1",
]

[tool.uv]
default-groups = ["all"]
constraint-dependencies = [
# ? Security
"fiona>=1.10.1",
"setuptools>=70.0.0",
# ? https://nvd.nist.gov/vuln/detail/CVE-2024-37891
# ? via sphinx
"urllib3>=2.2.2",
]
override-dependencies = ["cachier @ ${PROJECT_ROOT}/packages/cachier"]
[tool.uv.pip]
python-version = "3.11"
all-extras = true
[tool.uv.workspace]
members = ["packages/*"]
exclude = ["packages/cachier"]
[tool.uv.sources]
boilercine = { path = "packages/boilercine", editable = true }
dev = { path = "packages/_dev", editable = true }
boilercore = { path = "packages/boilercore", editable = true }
boilercv-pipeline = { path = "packages/pipeline", editable = true }
cachier = { path = "packages/cachier", editable = true }
dev = { workspace = true }
boilercine = { workspace = true }
boilercore = { workspace = true }
boilercv_pipeline = { workspace = true }
context_models = { workspace = true }
context-models = { path = "packages/context_models", editable = true }

[tool.coverage.run]
branch = true
source = ["boilercv", "boilercv_pipeline", "dev", "tests"]
source = ["dev", "boilercv-pipeline", "boilercv", "tests"]

[tool.dev.env]
COVERAGE_CORE = "sysmon"
Expand Down
Loading

0 comments on commit 9d552a4

Please sign in to comment.