Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 30, 2024
1 parent 72d52e3 commit fb6ed43
Show file tree
Hide file tree
Showing 281 changed files with 1,014 additions and 1,387 deletions.
1 change: 1 addition & 0 deletions .ci-helpers/get_current_version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python

import sys

from setuptools_scm import version_from_scm

version = version_from_scm(".").tag.public
Expand Down
1 change: 1 addition & 0 deletions .ci-helpers/get_min_docstr_cov.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import os
import sys

from parse import *

input = sys.stdin.readline()
Expand Down
1 change: 1 addition & 0 deletions .ci-helpers/get_next_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import sys
from datetime import date

from setuptools_scm import version_from_scm
from setuptools_scm.version import guess_next_date_ver

Expand Down
2 changes: 1 addition & 1 deletion .ci-helpers/update_credits.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def generate_zenodo():
)

not_found_msg = """
Couldn"t retrieve the TARDIS software citation from Zenodo. Get it
Couldn"t retrieve the TARDIS software citation from Zenodo. Get it
directly from `this link <https://zenodo.org/record/{CONCEPT_DOI}>`_ .
"""

Expand Down
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ omit =

tardis/gui/*
tardis/stats/*

ignore_errors = True

[html]
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/setup_env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ runs:
run: wget -q https://raw.githubusercontent.com/tardis-sn/tardis/master/conda-${{ inputs.os-label }}.lock
if: matrix.pip == true
shell: bash

- name: Generate Cache Key
run: |
run: |
file_hash=$(cat conda-${{ inputs.os-label }}.lock | shasum -a 256 | cut -d' ' -f1)
echo "file_hash=$file_hash" >> "${GITHUB_OUTPUT}"
id: cache-environment-key
shell: bash

- uses: mamba-org/setup-micromamba@v1
with:
environment-file: conda-${{ inputs.os-label }}.lock
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/archive/update-refdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

- name: Setup environment
uses: ./.github/actions/setup_env
with:
with:
os-label: linux-64

- name: Install package
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
- labeled # benchmarks label required
workflow_dispatch:

env:
env:
DEPLOY_BRANCH: main

concurrency:
Expand Down Expand Up @@ -76,8 +76,8 @@ jobs:
if: github.event_name != 'pull_request_target'
run: |
git log -n 4 --pretty=format:"%H" >> tag_commits.txt
asv run -a repeat=1 -a rounds=1 HASHFILE:tag_commits.txt | tee asv-output.log
if grep -q failed asv-output.log; then
asv run -a repeat=1 -a rounds=1 HASHFILE:tag_commits.txt | tee asv-output.log
if grep -q failed asv-output.log; then
echo "Some benchmarks have failed!"
exit 1
fi
Expand Down Expand Up @@ -107,8 +107,8 @@ jobs:
run: |
echo $(git rev-parse HEAD) > commit_hashes.txt
echo $(git rev-parse master) >> commit_hashes.txt
asv run -a repeat=2 -a rounds=1 HASHFILE:commit_hashes.txt | tee asv-output-PR.log
if grep -q failed asv-output-PR.log; then
asv run -a repeat=2 -a rounds=1 HASHFILE:commit_hashes.txt | tee asv-output-PR.log
if grep -q failed asv-output-PR.log; then
echo "Some benchmarks have failed!"
exit 1
fi
Expand Down Expand Up @@ -195,7 +195,7 @@ jobs:
external_repository: tardis-sn/tardis-benchmarks
user_name: "TARDIS Bot"
user_email: "[email protected]"

- name: Find Comment
if: always() && github.event_name == 'pull_request_target'
uses: peter-evans/find-comment@v1
Expand All @@ -214,10 +214,10 @@ jobs:
edit-mode: replace
body: |
*\*beep\* \*bop\**
Hi human,
I ran benchmarks as you asked comparing master (${{ github.event.pull_request.base.sha }}) and the latest commit (${{ github.event.pull_request.head.sha }}).
Hi human,
I ran benchmarks as you asked comparing master (${{ github.event.pull_request.base.sha }}) and the latest commit (${{ github.event.pull_request.head.sha }}).
Here are the logs produced by ASV.
Results can also be downloaded as artifacts [**here**](${{ env.URL }}).
Results can also be downloaded as artifacts [**here**](${{ env.URL }}).
Significantly changed benchmarks:
<details>
Expand All @@ -234,7 +234,7 @@ jobs:
```diff
${{ steps.asv_pr_vs_master.outputs.content }}
```
</details>
If you want to see the graph of the results, you can check it [**here**](${{ env.URL_PAGES }})
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ jobs:

- name: Setup LFS
uses: ./.github/actions/setup_lfs

- name: Setup environment
uses: ./.github/actions/setup_env
with:
with:
os-label: linux-64

- name: Copy atom_data
Expand Down
28 changes: 13 additions & 15 deletions .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ jobs:

- name: Run Black
run: black --check tardis
ruff:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Download Lock File
run: wget -q https://raw.githubusercontent.com/tardis-sn/tardis/master/conda-linux-64.lock

- name: Generate Cache Key
run: |
run: |
file_hash=$(cat conda-linux-64.lock | shasum -a 256 | cut -d' ' -f1)
echo "file_hash=$file_hash" >> "${GITHUB_OUTPUT}"
id: cache-environment-key

- uses: mamba-org/setup-micromamba@v1
with:
environment-file: conda-linux-64.lock
Expand All @@ -55,23 +55,23 @@ jobs:
environment-name: tardis
cache-environment: true
cache-downloads: true

- name: Show statistics
run: ruff check --statistics --show-fixes . | tee ruff_stats.txt
id: ruff_stats

- name: Show entire output
run: ruff check . --output-format=full | tee ruff_full.txt
id: ruff_complete

- name: Find Comment
if: always() && github.event_name == 'pull_request_target'
uses: peter-evans/find-comment@v1
id: fc
with:
issue-number: ${{ github.event.number }}
body-includes: I ran ruff on the latest commit

- name: Post comment
if: github.event_name == 'pull_request_target'
uses: peter-evans/create-or-update-comment@v2
Expand All @@ -82,10 +82,10 @@ jobs:
edit-mode: replace
body: |
*\*beep\* \*bop\**
Hi human,
I ran ruff on the latest commit (${{ github.event.pull_request.head.sha }}).
Hi human,
I ran ruff on the latest commit (${{ github.event.pull_request.head.sha }}).
Here are the outputs produced.
Results can also be downloaded as artifacts [**here**](${{ env.URL }}).
Results can also be downloaded as artifacts [**here**](${{ env.URL }}).
Summarised output:
<details>
Expand All @@ -101,11 +101,11 @@ jobs:
```diff
${{ steps.ruff_complete.outputs.content }}
```
</details>
env:
URL: https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/actions/runs/${{ github.run_id }}?check_suite_focus=true

- name: Save results artifact
uses: actions/upload-artifact@v4
if: always()
Expand All @@ -114,5 +114,3 @@ jobs:
path: |
ruff_full.txt
ruff_stats.txt
2 changes: 1 addition & 1 deletion .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
These are the changes required after the latest TARDIS release.
> :warning: **Warning:**
> :warning: **Warning:**
>
> The `post_release` workflow waits for a webhook and then updates the citation files. If the file is not modified by this pull request, please check the latest release on [Zenodo's website](https://zenodo.org/record/592480), close this pull request, and [manually run the workflow](https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow).
>
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ jobs:
- name: Download Lock File
run: wget -q https://raw.githubusercontent.com/tardis-sn/tardis/master/conda-linux-64.lock
shell: bash

- name: Generate Cache Key
run: |
run: |
file_hash=$(cat conda-linux-64.lock | shasum -a 256 | cut -d' ' -f1)
echo "file_hash=$file_hash" >> "${GITHUB_OUTPUT}"
id: cache-environment-key
shell: bash

- uses: mamba-org/setup-micromamba@v1
with:
environment-file: conda-linux-64.lock
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
<br>
> :warning: **WARNING:**
> :warning: **WARNING:**
>
> This pull request should be auto-merged. **Do not merge manually if any check fails**.
>
Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:

compare_refdata:
uses: tardis-sn/tardis-refdata/.github/workflows/compare-refdata.yml@master

pip_tests:
uses: ./.github/workflows/tests.yml
with:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/stardis-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
defaults:
run:
shell: bash -l {0}

env:
CACHE_NUMBER: 0 # increase to reset cache manually

Expand All @@ -34,7 +34,7 @@ jobs:

name: ${{ matrix.label }}
runs-on: ${{ matrix.os }}
steps:
steps:
- uses: actions/checkout@v4
with:
repository: tardis-sn/stardis
Expand All @@ -46,29 +46,29 @@ jobs:
miniforge-version: latest
activate-environment: stardis
use-mamba: true

- name: Cache lockfile
uses: actions/cache@v4
with:
path: ${{ matrix.prefix }}
key: conda-${{ matrix.label }}-${{ hashFiles(format('conda-{0}.lock', matrix.label)) }}-${{ env.CACHE_NUMBER }}
id: cache-conda

- name: Update Conda Environment
id: update-env
run: |
mamba update -n stardis --file conda-${{ matrix.label }}.lock
if: steps.cache-conda.outputs.cache-hit != 'true'

- name: Install tardis
id: install-tardis
run: |
pip install git+https://github.com/tardis-sn/tardis.git@${{ github.sha }}
- name: Install stardis
id: install-stardis
run: |
pip install -e .[test]
- name: Run stardis tests
run: pytest
- name: Run stardis tests
run: pytest
Loading

0 comments on commit fb6ed43

Please sign in to comment.