From 8106784e432c7cc63163d27a88dc2e35084a7e23 Mon Sep 17 00:00:00 2001 From: blakeNaccarato Date: Mon, 7 Aug 2023 12:20:31 -0700 Subject: [PATCH] Decouple `pyproject.toml` and `requirements.txt`. Cross-package dependencies will be easier to maintain if the lower bound in `pyproject.toml` doesn't have to always track `requirements.txt`. --- .github/workflows/main.yml | 15 +- .github/workflows/publish.yml | 3 +- .github/workflows/sphinx.yml | 3 +- .pre-commit-config.yaml | 14 -- .tools/pyproject.toml | 130 ------------------ requirements.txt => .tools/requirements.txt | 6 +- .tools/requirements/requirements_both.txt | 3 - .tools/scripts/Copy-Template.ps1 | 1 - .tools/scripts/Invoke-Pyright.ps1 | 1 + .tools/scripts/compose_pyproject.py | 18 --- .vscode/tasks.json | 18 +-- params.yaml | 1 - pyproject.toml | 143 ++++++++++++++++++-- src/boilercv/models/paths.py | 1 - update.ps1 | 17 +-- 15 files changed, 152 insertions(+), 222 deletions(-) delete mode 100644 .tools/pyproject.toml rename requirements.txt => .tools/requirements.txt (70%) delete mode 100644 .tools/scripts/compose_pyproject.py diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 122b6746..58414be4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,27 +9,24 @@ jobs: pyright: runs-on: "ubuntu-latest" steps: - - uses: "blakeNaccarato/copier-python-workflow-setup@v0.1.0" + - uses: "blakeNaccarato/copier-python-workflow-setup@v0.2.0" with: python-version: "3.11" - - run: "pip install --no-deps --requirement .tools/requirements/requirements_nodeps.txt" - run: ".tools/scripts/Invoke-Pyright.ps1" shell: "pwsh" ruff: runs-on: "ubuntu-latest" steps: - - uses: "blakeNaccarato/copier-python-workflow-setup@v0.1.0" + - uses: "blakeNaccarato/copier-python-workflow-setup@v0.2.0" with: python-version: "3.11" - - run: "pip install --no-deps --requirement .tools/requirements/requirements_nodeps.txt" - run: "ruff --no-fix --format github ." pytest: runs-on: "ubuntu-latest" steps: - - uses: "blakeNaccarato/copier-python-workflow-setup@v0.1.0" + - uses: "blakeNaccarato/copier-python-workflow-setup@v0.2.0" with: python-version: "3.11" - - run: "pip install --no-deps --requirement .tools/requirements/requirements_nodeps.txt" - name: Install PySide6 system dependencies run: | # https://askubuntu.com/questions/900285/libegl-so-1-is-not-a-symbolic-link @@ -41,13 +38,15 @@ jobs: needs: ["pyright", "ruff", "pytest"] runs-on: "ubuntu-latest" steps: - - uses: "blakeNaccarato/copier-python-workflow-setup@v0.1.0" + - uses: "blakeNaccarato/copier-python-workflow-setup@v0.2.0" with: python-version: "3.11" install-project: false + - run: "copier update --defaults --vcs-ref $(git rev-parse HEAD:template)" + shell: "pwsh" - uses: "stefanzweifel/git-auto-commit-action@v4.16.0" with: - commit_message: "Bump project template and compose `pyproject.toml`." + commit_message: "Update project from template." # * ------------------------------------------------------------------------------ * # # * Changes below should persist in significant template updates. diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3f40fb3c..e2ab5d31 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,9 +10,10 @@ jobs: publish: runs-on: "ubuntu-latest" steps: - - uses: "blakeNaccarato/copier-python-workflow-setup@v0.1.0" + - uses: "blakeNaccarato/copier-python-workflow-setup@v0.2.0" with: python-version: "3.11" + install-project: false - run: "flit publish" env: FLIT_USERNAME: "__token__" diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml index f7ee1ab5..93cafdae 100644 --- a/.github/workflows/sphinx.yml +++ b/.github/workflows/sphinx.yml @@ -19,10 +19,9 @@ jobs: build: runs-on: "ubuntu-latest" steps: - - uses: "blakeNaccarato/copier-python-workflow-setup@v0.1.0" + - uses: "blakeNaccarato/copier-python-workflow-setup@v0.2.0" with: python-version: "3.11" - - run: "pip install --no-deps --requirement .tools/requirements/requirements_nodeps.txt" - run: "python -m sphinx -T -E docs _site" - uses: "actions/upload-pages-artifact@v1.0.8" deploy: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c5421458..25620b19 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,6 @@ ci: - "pre-repro" # - "hide-notebook-inputs" - "update-warning-filters" - - "compose-pyproject" # - "pyright" - "pytest-fast-only" # - "pytest-slow-only" @@ -57,17 +56,6 @@ repos: (?x)^( warning_filters.py )$ - - id: "compose-pyproject" - name: "compose-pyproject" - pass_filenames: false - language: "system" - entry: "pwsh -Command python .tools/scripts/compose_pyproject.py" - files: | - (?x)^( - pyproject.toml - |requirements.txt - |.tools/pyproject.toml - )$ # - id: "pyright" # name: "pyright" # pass_filenames: false @@ -78,7 +66,6 @@ repos: # src/.* # |tests/.* # |pyproject.toml - # |requirements.txt # |.tools/( # pyproject.toml # |requirements/.* @@ -99,7 +86,6 @@ repos: src/.* |tests/.* - |requirements.txt |.tools/( pyproject.toml |requirements/.* diff --git a/.tools/pyproject.toml b/.tools/pyproject.toml deleted file mode 100644 index 1d886acc..00000000 --- a/.tools/pyproject.toml +++ /dev/null @@ -1,130 +0,0 @@ -# * -------------------------------------------------------------------------------- * # -# * Changes below should persist in significant template updates. - -# * -------------------------------------------------------------------------------- * # -# * Changes below may be lost in significant template updates. - -[build-system] -requires = ["flit_core >=3.3,<4"] -build-backend = "flit_core.buildapi" - -[project] -name = "boilercv" -version = "0.0.1" -description = "Computer vision routines suitable for nucleate pool boiling bubble analysis." -readme = "README.md" -license = { file = "LICENSE" } -requires-python = ">=3.11" -classifiers = ["License :: OSI Approved :: MIT License"] -[[project.authors]] -name = "Blake Naccarato, Kwang Jin Kim" -email = "blake.naccarato@gmail.com" - -[project.urls] -Changes = "https://blakeNaccarato.github.io/boilercv/changelog.html" -Docs = "https://blakeNaccarato.github.io/boilercv" -Home = "https://github.com/blakeNaccarato/boilercv" -Tracker = "https://github.com/blakeNaccarato/boilercv/issues" - -[tool.ruff] -fix = true -select = ["ALL"] -src = ["src", "tests"] -target-version = "py311" -extend-exclude = [ - "template", - "typings", - ".github", - ".tools", - "C:/Users/Blake/AppData/Local/Programs/Python/Python311/Lib/**", -] -ignore = [ - # * ---------------------------------------------------------------------------- * # - # * Changes below should persist in significant template updates. - - # * ---------------------------------------------------------------------------- * # - # * Changes below may be lost in significant template updates. - - "ANN", # Don't require type annotations - "ARG005", # Allow unused lambda argument. For consistency across df pipelines. - "C408", # Allow dict calls - "COM", # Allow magic commas and magic missing commas - "D10", # Missing docstrings - "D20", # Don't reformat docstrings in these ways - "D213", # Multi-line docstring summary should start at the second line - "D402", # False positives for parens in first line - "DTZ", # Timezones are important, but only contextually necessary. - "E501", # Don't check line length. Black handles this. - "EM", # Don't check for exception message issues - "ERA", # False positives. Don't get rid of commented out code. - "FBT", # Allow boolean "traps" - "F841", # Don't check for or fix unused variables - "FLY002", # Allow different string representations - "G0", # Allow f-strings, etc. in Loguru logging - "INP001", # False positives. Checks for packages missing `__init__.py` - "ISC", # False positives. Implicit string concatenation is fine. - "PD013", # Allow `stack` instead of `melt`. They're not a direct swap. - "PD901", # Allow `df` variable name. We are all consenting adults here. - "PD011", # Allow use of `.values`. False positives. - "PGH003", # Until black stops wrapping special ignores, let's allow bare - "PIE804", # Allow dict unpack even if unnecessary, consisent for df.assign{**...} - "PLR0913", # Allow more than five function arguments - "PLR2004", # Allow magic values. This check is too sensitive - "PLW2901", # For loop variable - "RET", # Return checks are flaky, Sourcery does fine analysing these paths - "S301", # Don't warn about pickling. Allow me to shoot myself in the foot. - "TCH", # Type checking linter doesn't play nicely with pydantic - "TD", # Disable to-do validation. Too pedantic for now. - "TRY003", # Allow long exception messages - "W2", # Allow whitespace issues. Fixed automatically by black. - # * ---------------------------------------------------------------------------- * # - # * These Jupyter-specific ignores can't be per-file-ignores - # * https://nbqa.readthedocs.io/en/latest/known-limitations.html - "B018", # Allow "useless" expressions, which do suppress outputs in notebooks - "F821", # Allow undefined names, such as `display` - "S101", # Allow assert - "T201", # Allow print in notebooks -] -unfixable = [ - # * ---------------------------------------------------------------------------- * # - # * Changes below should persist in significant template updates. - - # * ---------------------------------------------------------------------------- * # - # * Changes below may be lost in significant template updates. - - "F601", # Don't fix duplicate mapping keys -] - -[tool.ruff.pydocstyle] -convention = "google" - -[tool.ruff.isort] -# * ---------------------------------------------------------------------------- * # -# * Changes below should persist in significant template updates. - -# * ---------------------------------------------------------------------------- * # -# * Changes below may be lost in significant template updates. -split-on-trailing-comma = false - -[tool.ruff.per-file-ignores] -"docs/**" = [ - "E402", # Need to allow imports below patches in docs notebooks -] -"tests/**" = [ - # * ---------------------------------------------------------------------------- * # - # * Changes below should persist in significant template updates. - - "N815", # Allow camelCase in cine metadata models, which map to C structures - - # * ---------------------------------------------------------------------------- * # - # * Changes below may be lost in significant template updates. - - "ARG001", # Allow unused arguments in tests - "S101", # Allow assert in tests -] - -[tool.ruff.flake8-bugbear] -extend-immutable-calls = ["typer.Argument", "typer.Option"] - -[tool.ruff.pep8-naming] -classmethod-decorators = ["pydantic.validator"] diff --git a/requirements.txt b/.tools/requirements.txt similarity index 70% rename from requirements.txt rename to .tools/requirements.txt index 9a745c05..52dd9038 100644 --- a/requirements.txt +++ b/.tools/requirements.txt @@ -27,7 +27,11 @@ sparklines==0.4.2 sympy==1.12 trackpy==0.6.1 xarray[accel,io,parallel]==2023.7.0 -# Numba only supports numpy<1.25 https://github.com/numba/numba/issues/8698 # ! Unpin numba once it supports numpy>=1.25 +# ? Numba only supports numpy<1.25 https://github.com/numba/numba/issues/8698 numba==0.57.1 numpy==1.24.4 +# ! Consider switching to pims instead +git+https://github.com/blakeNaccarato/boilercine@main +# ! Pin the merge commit in master once it is merged +git+https://github.com/1313e/CMasher@mpl_future_proofing diff --git a/.tools/requirements/requirements_both.txt b/.tools/requirements/requirements_both.txt index 0d98d760..74e2a6d1 100644 --- a/.tools/requirements/requirements_both.txt +++ b/.tools/requirements/requirements_both.txt @@ -1,9 +1,6 @@ # * -------------------------------------------------------------------------------- * # # * Changes below should persist in significant template updates. -git+https://github.com/blakeNaccarato/boilercine@main -git+https://github.com/blakeNaccarato/CMasher@fc5cb882562019f374aa5616ddf103730021a3ce - # * -------------------------------------------------------------------------------- * # # * Changes below may be lost in significant template updates. diff --git a/.tools/scripts/Copy-Template.ps1 b/.tools/scripts/Copy-Template.ps1 index ce8983bb..20d1f697 100644 --- a/.tools/scripts/Copy-Template.ps1 +++ b/.tools/scripts/Copy-Template.ps1 @@ -20,4 +20,3 @@ else { git submodule deinit template copier update $(if ($Defaults) { '--defaults' }) } -python '.tools/scripts/compose_pyproject.py' diff --git a/.tools/scripts/Invoke-Pyright.ps1 b/.tools/scripts/Invoke-Pyright.ps1 index 5387f031..a711f380 100644 --- a/.tools/scripts/Invoke-Pyright.ps1 +++ b/.tools/scripts/Invoke-Pyright.ps1 @@ -13,3 +13,4 @@ $NbqaPyrightExitCode = $LastExitCode if (($PyrightExitCode -ne 0) -or ($NbqaPyrightExitCode -ne 0)) { Exit $PyrightExitCode -or $NbqaPyrightExitCode } +git submodule deinit typings diff --git a/.tools/scripts/compose_pyproject.py b/.tools/scripts/compose_pyproject.py deleted file mode 100644 index d6193dc1..00000000 --- a/.tools/scripts/compose_pyproject.py +++ /dev/null @@ -1,18 +0,0 @@ -"""Bump `pyproject.toml` and `pre-commit.config` with dependency changes.""" - -from pathlib import Path - -import re -from pathlib import Path - -import toml - -# Bump `pyproject.toml` based on changes in `requirements.txt` -dependencies = [ - line.rstrip().replace("==", ">=") - for line in Path("requirements.txt").read_text(encoding="utf-8").splitlines() - if line and not line.startswith("#") -] -source = toml.loads((".tools" / Path("pyproject.toml")).read_text(encoding="utf-8")) -source["project"]["dependencies"] = dependencies -Path("pyproject.toml").write_text(encoding="utf-8", data=toml.dumps(source)) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index a1fcd423..ad9aade5 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -235,7 +235,7 @@ "label": "dvc: freeze", "type": "shell", "options": { "shell": { "executable": "pwsh", "args": ["-Command"] } }, - "command": "pip freeze --requirement requirements.txt --local --exclude-editable > repro.txt", + "command": "pip freeze --requirement .tools/requirements/requirements.txt --local --exclude-editable > repro.txt", "icon": { "id": "graph" }, "problemMatcher": [] }, @@ -263,14 +263,6 @@ // * -------------------------------------------------------------------------- * // // * PROJECT SETUP * // - { - "label": "setup: Compose pyproject.toml", - "type": "shell", - "options": { "shell": { "executable": "pwsh", "args": ["-Command"] } }, - "command": "python .tools/scripts/compose_pyproject.py", - "icon": { "id": "file-symlink-directory" }, - "problemMatcher": [] - }, { "label": "setup: Copy template", "type": "shell", @@ -282,7 +274,7 @@ { "label": "setup: Setup project", "type": "shell", - "options": { "shell": { "executable": "pwsh", "args": ["-Command"] } }, + "options": { "shell": { "executable": "pwsh" } }, "command": "setup.ps1", "icon": { "id": "file-symlink-directory" }, "problemMatcher": [] @@ -290,7 +282,7 @@ { "label": "setup: Update project", "type": "shell", - "options": { "shell": { "executable": "pwsh", "args": ["-Command"] } }, + "options": { "shell": { "executable": "pwsh" } }, "command": "update.ps1", "icon": { "id": "file-symlink-directory" }, // "runOptions": { @@ -301,7 +293,7 @@ { "label": "setup: Perform first-time setup", "type": "shell", - "options": { "shell": { "executable": "pwsh", "args": ["-Command"] } }, + "options": { "shell": { "executable": "pwsh" } }, "command": "first_time_setup.ps1", "icon": { "id": "file-symlink-directory" }, "problemMatcher": [] @@ -457,7 +449,7 @@ { "label": "task: Invoke pyright", "type": "shell", - "options": { "shell": { "executable": "pwsh", "args": ["-Command"] } }, + "options": { "shell": { "executable": "pwsh" } }, "command": ".tools/scripts/Invoke-Pyright.ps1", "icon": { "id": "type-hierarchy-sub" }, "problemMatcher": [] diff --git a/params.yaml b/params.yaml index fffb3710..c00a29e3 100644 --- a/params.yaml +++ b/params.yaml @@ -1,6 +1,5 @@ project_paths: project: . - requirements: requirements.txt dev_requirements: .tools/requirements package: src/boilercv stages: src/boilercv/stages diff --git a/pyproject.toml b/pyproject.toml index b32297c0..d77ddcf1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,11 @@ +# * -------------------------------------------------------------------------------- * # +# * Changes below should persist in significant template updates. + +# * -------------------------------------------------------------------------------- * # +# * Changes below may be lost in significant template updates. + [build-system] -requires = [ "flit_core >=3.3,<4",] +requires = ["flit_core >=3.9,<4"] build-backend = "flit_core.buildapi" [project] @@ -7,16 +13,45 @@ name = "boilercv" version = "0.0.1" description = "Computer vision routines suitable for nucleate pool boiling bubble analysis." readme = "README.md" +license = { file = "LICENSE" } requires-python = ">=3.11" -classifiers = [ "License :: OSI Approved :: MIT License",] -dependencies = [ "colorcet>=3.0.1", "dvc[gs]>=3.10.1", "imageio[pyav]>=2.31.1", "ipykernel>=6.25.0", "loguru>=0.7.0", "matplotlib>=3.7.2", "nbconvert>=7.7.3", "opencv-contrib-python>=4.8.0.74", "pandas[hdf5,performance]>=2.0.3", "pandera>=0.16.1", "pandocfilters>=1.5.0", "pillow>=10.0.0", "ploomber-engine>=0.0.30", "pyarrow>=12.0.1", "pydantic>=1.10.12", "pyjanitor>=0.25.0", "pyqtgraph>=0.13.3", "pyside6>=6.5.2", "pytz>=2023.3", "pyyaml>=6.0.1", "ruamel.yaml>=0.17.32", "scikit-image>=0.21.0", "scipy>=1.11.1", "seaborn>=0.12.2", "sparklines>=0.4.2", "sympy>=1.12", "trackpy>=0.6.1", "xarray[accel,io,parallel]>=2023.7.0", "numba>=0.57.1", "numpy>=1.24.4",] +classifiers = ["License :: OSI Approved :: MIT License"] +dependencies = [ + "colorcet>=3.0.1", + "dvc[gs]>=3.10.1", + "imageio[pyav]>=2.31.1", + "ipykernel>=6.25.0", + "loguru>=0.7.0", + "matplotlib>=3.7.2", + "nbconvert>=7.7.3", + "opencv-contrib-python>=4.8.0.74", + "pandas[hdf5,performance]>=2.0.3", + "pandera>=0.16.1", + "pandocfilters>=1.5.0", + "pillow>=10.0.0", + "ploomber-engine>=0.0.30", + "pyarrow>=12.0.1", + "pydantic>=1.10.12", + "pyjanitor>=0.25.0", + "pyqtgraph>=0.13.3", + "pyside6>=6.5.2", + "pytz>=2023.3", + "pyyaml>=6.0.1", + "ruamel.yaml>=0.17.32", + "scikit-image>=0.21.0", + "scipy>=1.11.1", + "seaborn>=0.12.2", + "sparklines>=0.4.2", + "sympy>=1.12", + "trackpy>=0.6.1", + "xarray[accel,io,parallel]>=2023.7.0", + "numba>=0.57.1", + "numpy>=1.24.4", +] [[project.authors]] name = "Blake Naccarato, Kwang Jin Kim" email = "blake.naccarato@gmail.com" -[project.license] -file = "LICENSE" - [project.urls] Changes = "https://blakeNaccarato.github.io/boilercv/changelog.html" Docs = "https://blakeNaccarato.github.io/boilercv" @@ -25,25 +60,103 @@ Tracker = "https://github.com/blakeNaccarato/boilercv/issues" [tool.ruff] fix = true -select = [ "ALL",] -src = [ "src", "tests",] +select = ["ALL"] +src = ["src", "tests"] target-version = "py311" -extend-exclude = [ "template", "typings", ".github", ".tools", "C:/Users/Blake/AppData/Local/Programs/Python/Python311/Lib/**",] -ignore = [ "ANN", "ARG005", "C408", "COM", "D10", "D20", "D213", "D402", "DTZ", "E501", "EM", "ERA", "FBT", "F841", "FLY002", "G0", "INP001", "ISC", "PD013", "PD901", "PD011", "PGH003", "PIE804", "PLR0913", "PLR2004", "PLW2901", "RET", "S301", "TCH", "TD", "TRY003", "W2", "B018", "F821", "S101", "T201",] -unfixable = [ "F601",] +extend-exclude = [ + "template", + "typings", + ".github", + ".tools", + "C:/Users/Blake/AppData/Local/Programs/Python/Python311/Lib/**", +] +ignore = [ + # * ---------------------------------------------------------------------------- * # + # * Changes below should persist in significant template updates. + + # * ---------------------------------------------------------------------------- * # + # * Changes below may be lost in significant template updates. + + "ANN", # Don't require type annotations + "ARG005", # Allow unused lambda argument. For consistency across df pipelines. + "C408", # Allow dict calls + "COM", # Allow magic commas and magic missing commas + "D10", # Missing docstrings + "D20", # Don't reformat docstrings in these ways + "D213", # Multi-line docstring summary should start at the second line + "D402", # False positives for parens in first line + "DTZ", # Timezones are important, but only contextually necessary. + "E501", # Don't check line length. Black handles this. + "EM", # Don't check for exception message issues + "ERA", # False positives. Don't get rid of commented out code. + "FBT", # Allow boolean "traps" + "F841", # Don't check for or fix unused variables + "FLY002", # Allow different string representations + "G0", # Allow f-strings, etc. in Loguru logging + "INP001", # False positives. Checks for packages missing `__init__.py` + "ISC", # False positives. Implicit string concatenation is fine. + "PD013", # Allow `stack` instead of `melt`. They're not a direct swap. + "PD901", # Allow `df` variable name. We are all consenting adults here. + "PD011", # Allow use of `.values`. False positives. + "PGH003", # Until black stops wrapping special ignores, let's allow bare + "PIE804", # Allow dict unpack even if unnecessary, consisent for df.assign{**...} + "PLR0913", # Allow more than five function arguments + "PLR2004", # Allow magic values. This check is too sensitive + "PLW2901", # For loop variable + "RET", # Return checks are flaky, Sourcery does fine analysing these paths + "S301", # Don't warn about pickling. Allow me to shoot myself in the foot. + "TCH", # Type checking linter doesn't play nicely with pydantic + "TD", # Disable to-do validation. Too pedantic for now. + "TRY003", # Allow long exception messages + "W2", # Allow whitespace issues. Fixed automatically by black. + # * ---------------------------------------------------------------------------- * # + # * These Jupyter-specific ignores can't be per-file-ignores + # * https://nbqa.readthedocs.io/en/latest/known-limitations.html + "B018", # Allow "useless" expressions, which do suppress outputs in notebooks + "F821", # Allow undefined names, such as `display` + "S101", # Allow assert + "T201", # Allow print in notebooks +] +unfixable = [ + # * ---------------------------------------------------------------------------- * # + # * Changes below should persist in significant template updates. + + # * ---------------------------------------------------------------------------- * # + # * Changes below may be lost in significant template updates. + + "F601", # Don't fix duplicate mapping keys +] [tool.ruff.pydocstyle] convention = "google" [tool.ruff.isort] +# * ---------------------------------------------------------------------------- * # +# * Changes below should persist in significant template updates. + +# * ---------------------------------------------------------------------------- * # +# * Changes below may be lost in significant template updates. split-on-trailing-comma = false [tool.ruff.per-file-ignores] -"docs/**" = [ "E402",] -"tests/**" = [ "N815", "ARG001", "S101",] +"docs/**" = [ + "E402", # Need to allow imports below patches in docs notebooks +] +"tests/**" = [ + # * ---------------------------------------------------------------------------- * # + # * Changes below should persist in significant template updates. + + "N815", # Allow camelCase in cine metadata models, which map to C structures + + # * ---------------------------------------------------------------------------- * # + # * Changes below may be lost in significant template updates. + + "ARG001", # Allow unused arguments in tests + "S101", # Allow assert in tests +] [tool.ruff.flake8-bugbear] -extend-immutable-calls = [ "typer.Argument", "typer.Option",] +extend-immutable-calls = ["typer.Argument", "typer.Option"] [tool.ruff.pep8-naming] -classmethod-decorators = [ "pydantic.validator",] +classmethod-decorators = ["pydantic.validator"] diff --git a/src/boilercv/models/paths.py b/src/boilercv/models/paths.py index 0e3462aa..2b7be797 100644 --- a/src/boilercv/models/paths.py +++ b/src/boilercv/models/paths.py @@ -19,7 +19,6 @@ class ProjectPaths(CreatePathsModel): project: DirectoryPath = PROJECT_DIR # ! REQUIREMENTS - requirements: FilePath = project / "requirements.txt" dev_requirements: DirectoryPath = project / ".tools/requirements" # ! PACKAGE diff --git a/update.ps1 b/update.ps1 index 0ee2504f..0ed10e60 100644 --- a/update.ps1 +++ b/update.ps1 @@ -15,15 +15,9 @@ else { } # Install dev requirements -python -m pip install --upgrade pip # Instructed to do this by pip -pip install --upgrade setuptools wheel # Must be done separately from above -pip install --upgrade --requirement '.tools/requirements/requirements_dev.txt' -# Need `toml` in dev requirements prior to bumping `pyproject.toml` -python '.tools/scripts/compose_pyproject.py' - -# Install the package and the lower bound of its requirements -pip install --no-deps --editable '.' -pip install --upgrade --requirement 'requirements.txt' +python -m pip install --upgrade pip setuptools wheel +pip install --no-deps --editable '.' --requirement '.tools/requirements/requirements_nodeps.txt' +pip install --upgrade --requirement '.tools/requirements/requirements_dev.txt' --requirement '.tools/requirements/requirements.txt' # Install all types of pre-commit hooks $h = '--hook-type' @@ -41,10 +35,5 @@ $AllHookTypes = @( ) pre-commit install --install-hooks @AllHookTypes -# Ensure type stubs are synchronized -git submodule update --init --merge typings - # * -------------------------------------------------------------------------------- * # # * Changes below should persist in significant template updates. - -pip install --no-deps --requirement '.tools/requirements/requirements_nodeps.txt'