Update plotspectra.py #3776
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Test and lint | |
on: | |
push: | |
merge_group: | |
schedule: | |
- cron: '0 10 * * 2' | |
#pull_request: | |
workflow_dispatch: | |
repository_dispatch: | |
types: [trigger_checks] | |
jobs: | |
lint: | |
name: Format, lint, and type check | |
runs-on: macos-15 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
- name: Cache rust build | |
uses: actions/cache@v4 | |
with: | |
path: rust/target/ | |
key: pytest-rust-target-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-${{ github.run_id }} | |
restore-keys: | | |
pytest-rust-target-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}- | |
pytest-rust-target-${{ runner.os }}- | |
- name: Install artistools | |
run: | | |
python3 -m pip install uv | |
python3 -m uv pip install --system --upgrade pylint mypy | |
python3 -m uv pip install --compile-bytecode --editable . | |
- name: Run Ruff | |
if: always() | |
uses: astral-sh/ruff-action@v2 | |
with: | |
version: 0.8.2 | |
args: "check --exit-non-zero-on-fix --no-fix" | |
- name: Run Ruff Format | |
if: always() | |
uses: astral-sh/ruff-action@v2 | |
with: | |
version: 0.8.2 | |
args: "format --check" | |
- name: Run pyright | |
if: always() | |
uses: jakebailey/pyright-action@v2 | |
- name: Run mypy | |
if: always() | |
run: mypy --install-types --non-interactive | |
- name: Run pylint | |
if: always() | |
run: pylint --output-format=github artistools | |
pre-commit: | |
runs-on: macos-15 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
- name: Cache rust build | |
uses: actions/cache@v4 | |
with: | |
path: rust/target/ | |
key: pytest-rust-target-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-${{ github.run_id }} | |
restore-keys: | | |
pytest-rust-target-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}- | |
pytest-rust-target-${{ runner.os }}- | |
- name: Install artistools | |
run: | | |
python3 -m pip install uv | |
python3 -m uv pip install --compile-bytecode --editable . | |
- uses: pre-commit/[email protected] | |
superlinter: | |
name: Super linter | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
# Full git history is needed to get a proper list of changed files within `super-linter` | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
- name: Lint Code Base | |
uses: github/super-linter/slim@v7 | |
env: | |
LINTER_RULES_PATH: ./ | |
LOG_LEVEL: WARN | |
VALIDATE_JSON_PRETTIER: false | |
VALIDATE_GITHUB_ACTIONS: false | |
VALIDATE_GITLEAKS: false | |
VALIDATE_JSCPD: false | |
VALIDATE_PYTHON_BLACK: false | |
VALIDATE_CHECKOV: false | |
VALIDATE_MARKDOWN_PRETTIER: false | |
VALIDATE_PYTHON_FLAKE8: false | |
VALIDATE_PYTHON_ISORT: false | |
VALIDATE_PYTHON_PYINK: false | |
VALIDATE_PYTHON_PYLINT: false | |
VALIDATE_PYTHON_MYPY: false | |
VALIDATE_PYTHON_RUFF: false | |
VALIDATE_YAML_PRETTIER: false | |
YAML_ERROR_ON_WARNING: false | |
DEFAULT_BRANCH: main | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
pytest: | |
timeout-minutes: 30 | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-15, ubuntu-24.04] | |
python-version: ['3.10', '3.11', '3.12', '3.13'] | |
env: | |
OS: ${{ matrix.os }} | |
PYTHON: ${{ matrix.python-version }} | |
name: pytest ${{ matrix.os }} python ${{ matrix.python-version }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
check-latest: true | |
- name: Show python version | |
run: python3 --version --version && which python3 | |
- name: Cache rust build | |
uses: actions/cache@v4 | |
with: | |
path: rust/target/ | |
key: pytest-rust-target-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-${{ github.run_id }} | |
restore-keys: | | |
pytest-rust-target-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}- | |
pytest-rust-target-${{ runner.os }}- | |
- name: Install artistools | |
run: | | |
python3 -m pip install uv | |
python3 -m uv pip install --compile-bytecode --editable . | |
- name: Cache test data | |
uses: actions/cache@v4 | |
with: | |
enableCrossOsArchive: true | |
path: tests/data/*.tar.xz | |
key: testdata20231114 | |
- name: Download/extract test data | |
working-directory: tests/data/ | |
run: source ./setuptestdata.sh | |
- name: Check artistools command line tool | |
run: | | |
artistools --help | |
artistools completions | |
- name: Test with pytest | |
run: | | |
pytest --cov=./ --cov-report=xml | |
- name: Report coverage | |
run: | | |
coverage report | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage.xml | |
# directory: ./coverage/reports/ | |
flags: unittests | |
env_vars: OS,PYTHON | |
name: codecov-umbrella | |
fail_ci_if_error: false | |
# path_to_write_report: ./coverage/codecov_report.txt | |
verbose: true | |
- name: Upload output files | |
uses: actions/upload-artifact@v4 | |
with: | |
name: testoutput-${{ matrix.os }}-py${{ matrix.python-version }} | |
path: tests/output/ |