Skip to content

Commit

Permalink
Update setup-micromamba and pre-commit hooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
zaneselvans committed Oct 6, 2024
1 parent e54126d commit 6a6efaf
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 18 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/load-metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/save_daily_metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/tox-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,20 @@ 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
cache-environment-key: environment-${{ hashFiles('pyproject.toml') }}
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
Expand Down
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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]
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: pudl-usage-metrics
channels:
- conda-forge
- defaults
dependencies:
# Used to set up the environment
- pip>=21,<25
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -177,4 +177,4 @@ max-complexity = 10
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
inline-quotes = "double"
multiline-quotes = "double"
multiline-quotes = "double"

0 comments on commit 6a6efaf

Please sign in to comment.