From 6a6efafe50a531baded6e6cb633afe1a18dc2199 Mon Sep 17 00:00:00 2001 From: Zane Selvans Date: Sun, 6 Oct 2024 12:47:15 -0600 Subject: [PATCH] Update setup-micromamba and pre-commit hooks. --- .github/workflows/load-metrics.yml | 3 +-- .github/workflows/save_daily_metrics.yml | 3 +-- .github/workflows/tox-pytest.yml | 7 ++++--- .pre-commit-config.yaml | 16 ++++++++-------- environment.yml | 1 - pyproject.toml | 4 ++-- 6 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/load-metrics.yml b/.github/workflows/load-metrics.yml index 95b273c..aaeb3fa 100644 --- a/.github/workflows/load-metrics.yml +++ b/.github/workflows/load-metrics.yml @@ -28,14 +28,13 @@ jobs: create_credentials_file: true - name: Install Conda environment using mamba - uses: mamba-org/setup-micromamba@v1 + uses: mamba-org/setup-micromamba@v2 with: environment-file: environment.yml cache-environment: true condarc: | channels: - conda-forge - - defaults channel_priority: strict - name: Get GitHub Action runner's IP Address diff --git a/.github/workflows/save_daily_metrics.yml b/.github/workflows/save_daily_metrics.yml index 8d9d550..20cd003 100644 --- a/.github/workflows/save_daily_metrics.yml +++ b/.github/workflows/save_daily_metrics.yml @@ -18,14 +18,13 @@ jobs: fetch-depth: 2 - name: Set up conda environment for testing - uses: mamba-org/setup-micromamba@v1 + uses: mamba-org/setup-micromamba@v2 with: environment-file: environment.yml cache-environment: true condarc: | channels: - conda-forge - - defaults channel_priority: strict - name: Log conda environnment information diff --git a/.github/workflows/tox-pytest.yml b/.github/workflows/tox-pytest.yml index d6bcf79..d79a726 100644 --- a/.github/workflows/tox-pytest.yml +++ b/.github/workflows/tox-pytest.yml @@ -20,7 +20,7 @@ jobs: fetch-depth: 2 - name: Set up conda environment for testing - uses: mamba-org/setup-micromamba@v1 + uses: mamba-org/setup-micromamba@v2 with: environment-file: environment.yml cache-environment: true @@ -28,11 +28,12 @@ jobs: condarc: | channels: - conda-forge - - defaults channel_priority: strict - - name: Log conda environnment information + - name: Log VM and conda environnment information run: | + lscpu + free -h conda info conda list conda config --show-sources diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 614a42f..ca8b1c5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: # Other file formatting, plus common Git mistakes & text file standardization: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: check-added-large-files # Don't accidentally commit giant files. - id: check-merge-conflict # Watch for lingering merge markers. @@ -25,7 +25,7 @@ repos: # Formatters: hooks that re-write Python and RST files ##################################################################################### - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.8 + rev: v0.6.9 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] @@ -48,11 +48,11 @@ repos: - id: doc8 args: ["--config", "pyproject.toml"] - # Lint Dockerfiles for errors and to ensure best practices - - repo: https://github.com/AleksaC/hadolint-py - rev: v2.12.1b3 + # Check Github Actions + - repo: https://github.com/rhysd/actionlint + rev: v1.7.3 hooks: - - id: hadolint + - id: actionlint ######################################################################################## # Custom local hooks @@ -62,7 +62,7 @@ repos: # clear outputs from Jupyter notebooks - id: nb-output-clear name: nb-output-clear - stages: [commit] + stages: [pre-commit] language: system verbose: false pass_filenames: false @@ -71,7 +71,7 @@ repos: # Run the unit tests - id: unit-tests name: unit-tests - stages: [commit] + stages: [pre-commit] language: system verbose: false pass_filenames: false diff --git a/environment.yml b/environment.yml index 5545977..dd35dab 100644 --- a/environment.yml +++ b/environment.yml @@ -1,7 +1,6 @@ name: pudl-usage-metrics channels: - conda-forge - - defaults dependencies: # Used to set up the environment - pip>=21,<25 diff --git a/pyproject.toml b/pyproject.toml index a5f4258..d034032 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,7 +55,7 @@ docs = [ tests = [ "coverage>=5.3,<8", # Lets us track what code is being tested "doc8>=0.9,<1.2", # Ensures clean documentation formatting - "pre-commit>=3.7,<4", # Allow us to run pre-commit hooks in testing + "pre-commit>=4,<5", # Allow us to run pre-commit hooks in testing "pydocstyle>=5.1,<7", # Style guidelines for Python documentation "pytest>=8,<8.4", # Our testing framework "pytest-asyncio>=0.20,<0.25", # Test async functions @@ -177,4 +177,4 @@ max-complexity = 10 [tool.ruff.lint.flake8-quotes] docstring-quotes = "double" inline-quotes = "double" -multiline-quotes = "double" \ No newline at end of file +multiline-quotes = "double"