From defbb9eb3a797b9010172910f628368dd0100b9c Mon Sep 17 00:00:00 2001 From: Pierre Chapuis Date: Tue, 5 Mar 2024 19:12:42 +0100 Subject: [PATCH] update deps and use ruff in Rye to format --- .github/workflows/ci.yml | 8 +- CONTRIBUTING.md | 5 +- pyproject.toml | 2 - requirements.lock | 266 ++++++++++++++++++++++++++++++++++----- 4 files changed, 240 insertions(+), 41 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 55cac48..24436f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,13 +44,13 @@ jobs: if: steps.changes.outputs.sources == 'true' run: rye sync --all-features - - name: ruff format + - name: rye fmt if: steps.changes.outputs.sources == 'true' - run: rye run ruff format --check . + run: rye fmt --check - - name: ruff check + - name: rye lint if: steps.changes.outputs.sources == 'true' - run: rye run ruff check . + run: rye lint - name: typecheck if: steps.changes.outputs.sources == 'true' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ffcb7b8..95acdeb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,10 +23,11 @@ Once Rye is installed, you can clone the repository and run `rye sync` to instal ## Linting -We use [ruff](https://docs.astral.sh/ruff/) to lint our code. You can lint your code by running. +We use the standard integration of [ruff](https://docs.astral.sh/ruff/) in Rye to lint and format our code. You can lint your code by running: ```bash -rye run lint +rye fmt +rye lint --fix ``` We also enforce strict type checking with [pyright](https://github.com/microsoft/pyright). You can run the type checker with: diff --git a/pyproject.toml b/pyproject.toml index cb33fb7..aa9b9f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,7 +69,6 @@ build-backend = "hatchling.build" managed = true dev-dependencies = [ "pyright==1.1.349", - "ruff>=0.2.0", "docformatter>=1.7.5", "pytest>=8.0.0", "coverage>=7.4.1", @@ -81,7 +80,6 @@ dev-dependencies = [ allow-direct-references = true [tool.rye.scripts] -lint = { chain = ["ruff format .", "ruff --fix ."] } serve-docs = "mkdocs serve" test-cov = "coverage run -m pytest" # Work around for "Couldn't parse" errors due to e.g. opencv-python: diff --git a/requirements.lock b/requirements.lock index a8099f7..8ba5a0d 100644 --- a/requirements.lock +++ b/requirements.lock @@ -9,111 +9,311 @@ -e file:. aiohttp==3.9.3 + # via datasets + # via fsspec aiosignal==1.3.1 + # via aiohttp annotated-types==0.6.0 + # via pydantic appdirs==1.4.4 + # via wandb async-timeout==4.0.3 + # via aiohttp attrs==23.2.0 + # via aiohttp babel==2.14.0 + # via mkdocs-material bitsandbytes==0.42.0 -black==24.1.1 + # via refiners +black==24.2.0 + # via refiners certifi==2024.2.2 + # via requests + # via sentry-sdk charset-normalizer==3.3.2 + # via requests click==8.1.7 + # via black + # via mkdocs + # via mkdocstrings + # via wandb colorama==0.4.6 -datasets==2.16.1 -diffusers==0.26.1 -dill==0.3.7 + # via griffe + # via mkdocs-material +datasets==2.18.0 + # via refiners +diffusers==0.26.3 + # via refiners +dill==0.3.8 + # via datasets + # via multiprocess docker-pycreds==0.4.0 + # via wandb filelock==3.13.1 + # via datasets + # via diffusers + # via huggingface-hub + # via torch + # via transformers + # via triton frozenlist==1.4.1 -fsspec==2023.10.0 + # via aiohttp + # via aiosignal +fsspec==2024.2.0 + # via datasets + # via huggingface-hub + # via torch ghp-import==2.1.0 + # via mkdocs gitdb==4.0.11 -gitpython==3.1.41 -griffe==0.40.0 -huggingface-hub==0.20.3 + # via gitpython +gitpython==3.1.42 + # via wandb +griffe==0.41.3 + # via mkdocstrings-python +huggingface-hub==0.21.3 + # via datasets + # via diffusers + # via tokenizers + # via transformers idna==3.6 + # via requests + # via yarl importlib-metadata==7.0.1 + # via diffusers invisible-watermark==0.2.0 + # via refiners jaxtyping==0.2.25 + # via refiners jinja2==3.1.3 + # via mkdocs + # via mkdocs-material + # via mkdocstrings + # via torch loguru==0.7.2 + # via refiners markdown==3.5.2 -markupsafe==2.1.4 + # via mkdocs + # via mkdocs-autorefs + # via mkdocs-material + # via mkdocstrings + # via pymdown-extensions +markupsafe==2.1.5 + # via jinja2 + # via mkdocs + # via mkdocs-autorefs + # via mkdocstrings mergedeep==1.3.4 + # via mkdocs mkdocs==1.5.3 -mkdocs-autorefs==0.5.0 + # via mkdocs-autorefs + # via mkdocs-literate-nav + # via mkdocs-material + # via mkdocstrings +mkdocs-autorefs==1.0.1 + # via mkdocstrings mkdocs-literate-nav==0.6.1 -mkdocs-material==9.5.6 + # via refiners +mkdocs-material==9.5.12 + # via refiners mkdocs-material-extensions==1.3.1 -mkdocstrings==0.24.0 + # via mkdocs-material +mkdocstrings==0.24.1 + # via mkdocstrings-python + # via refiners mkdocstrings-python==1.8.0 + # via mkdocstrings mpmath==1.3.0 + # via sympy multidict==6.0.5 -multiprocess==0.70.15 + # via aiohttp + # via yarl +multiprocess==0.70.16 + # via datasets mypy-extensions==1.0.0 + # via black networkx==3.2.1 -numpy==1.26.3 + # via torch +numpy==1.26.4 + # via datasets + # via diffusers + # via invisible-watermark + # via jaxtyping + # via opencv-python + # via pandas + # via pyarrow + # via pywavelets + # via scipy + # via torchvision + # via transformers nvidia-cublas-cu12==12.1.3.1 + # via nvidia-cudnn-cu12 + # via nvidia-cusolver-cu12 + # via torch nvidia-cuda-cupti-cu12==12.1.105 + # via torch nvidia-cuda-nvrtc-cu12==12.1.105 + # via torch nvidia-cuda-runtime-cu12==12.1.105 + # via torch nvidia-cudnn-cu12==8.9.2.26 + # via torch nvidia-cufft-cu12==11.0.2.54 + # via torch nvidia-curand-cu12==10.3.2.106 + # via torch nvidia-cusolver-cu12==11.4.5.107 + # via torch nvidia-cusparse-cu12==12.1.0.106 + # via nvidia-cusolver-cu12 + # via torch nvidia-nccl-cu12==2.19.3 + # via torch nvidia-nvjitlink-cu12==12.3.101 + # via nvidia-cusolver-cu12 + # via nvidia-cusparse-cu12 nvidia-nvtx-cu12==12.1.105 + # via torch opencv-python==4.9.0.80 + # via invisible-watermark packaging==23.2 + # via black + # via datasets + # via huggingface-hub + # via mkdocs + # via refiners + # via transformers paginate==0.5.6 -pandas==2.2.0 + # via mkdocs-material +pandas==2.2.1 + # via datasets pathspec==0.12.1 + # via black + # via mkdocs pillow==10.2.0 + # via diffusers + # via invisible-watermark + # via refiners + # via torchvision piq==0.8.0 + # via refiners platformdirs==4.2.0 + # via black + # via mkdocs + # via mkdocstrings prodigyopt==1.0 -protobuf==4.25.2 + # via refiners +protobuf==4.25.3 + # via wandb psutil==5.9.8 + # via wandb pyarrow==15.0.0 + # via datasets pyarrow-hotfix==0.6 -pydantic==2.6.0 -pydantic-core==2.16.1 + # via datasets +pydantic==2.6.3 + # via refiners +pydantic-core==2.16.3 + # via pydantic pygments==2.17.2 -pymdown-extensions==10.7 -python-dateutil==2.8.2 + # via mkdocs-material +pymdown-extensions==10.7.1 + # via mkdocs-material + # via mkdocstrings +python-dateutil==2.9.0.post0 + # via ghp-import + # via pandas pytz==2024.1 + # via pandas pywavelets==1.5.0 + # via invisible-watermark pyyaml==6.0.1 + # via datasets + # via huggingface-hub + # via mkdocs + # via pymdown-extensions + # via pyyaml-env-tag + # via transformers + # via wandb pyyaml-env-tag==0.1 + # via mkdocs regex==2023.12.25 + # via diffusers + # via mkdocs-material + # via transformers requests==2.31.0 + # via datasets + # via diffusers + # via huggingface-hub + # via mkdocs-material + # via refiners + # via transformers + # via wandb safetensors==0.4.2 + # via diffusers + # via refiners + # via transformers scipy==1.12.0 + # via bitsandbytes segment-anything-py==1.0 -sentry-sdk==1.40.0 + # via refiners +sentry-sdk==1.40.6 + # via wandb setproctitle==1.3.3 + # via wandb +setuptools==69.1.1 + # via wandb six==1.16.0 + # via docker-pycreds + # via python-dateutil smmap==5.0.1 + # via gitdb sympy==1.12 -tokenizers==0.15.1 + # via torch +tokenizers==0.15.2 + # via transformers tomli==2.0.1 -torch==2.2.0 -torchvision==0.17.0 -tqdm==4.66.1 -transformers==4.37.2 + # via black + # via refiners +torch==2.2.1 + # via invisible-watermark + # via refiners + # via segment-anything-py + # via torchvision +torchvision==0.17.1 + # via piq + # via refiners + # via segment-anything-py +tqdm==4.66.2 + # via datasets + # via huggingface-hub + # via refiners + # via transformers +transformers==4.38.2 + # via refiners triton==2.2.0 + # via torch typeguard==2.13.3 -typing-extensions==4.9.0 -tzdata==2023.4 -urllib3==2.2.0 -wandb==0.16.2 -watchdog==3.0.0 + # via jaxtyping +typing-extensions==4.10.0 + # via black + # via huggingface-hub + # via jaxtyping + # via pydantic + # via pydantic-core + # via torch +tzdata==2024.1 + # via pandas +urllib3==2.2.1 + # via requests + # via sentry-sdk +wandb==0.16.3 + # via refiners +watchdog==4.0.0 + # via mkdocs xxhash==3.4.1 + # via datasets yarl==1.9.4 + # via aiohttp zipp==3.17.0 -# The following packages are considered to be unsafe in a requirements file: -setuptools==69.0.3 + # via importlib-metadata