Skip to content

Commit

Permalink
Fix Github actions; imp -> importlib
Browse files Browse the repository at this point in the history
  • Loading branch information
OverLordGoldDragon committed Mar 27, 2024
1 parent 507293a commit 248ed30
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 57 deletions.
107 changes: 52 additions & 55 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,63 @@
name: ssqueezepy CI

on:
workflow_dispatch:
workflow_dispatch:

pull_request:
paths:
- "ssqueezepy/*"
- "tests/*"
- ".github/workflows/*"
- ".coveragerc"
- "requirements.txt"
- "requirements-dev.txt"
pull_request:
paths:
- "ssqueezepy/*"
- "tests/*"
- ".github/workflows/*"
- ".coveragerc"
- "requirements.txt"
- "requirements-dev.txt"

push:
branches:
- master
push:
branches:
- master

jobs:
build-conda:
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
runs-on: ubuntu-latest
build-conda:
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.7]
strategy:
matrix:
python-version: [3.10]

steps:
- uses: actions/checkout@v3

- name: Add Conda to path
run: echo $CONDA >> $GITHUB_PATH

- name: Install Conda environment with Micromamba
uses: mamba-org/provision-with-micromamba@main
with:
cache-downloads: true
cache-env: true
environment-file: environment.yaml
extra-specs: |
python=${{ matrix.python-version }}
- name: additional setup
shell: bash -l {0}
run: |
conda run python3 -m pip install --upgrade pip
conda run python3 -m pip install -r requirements.txt
conda run python3 -m pip install -r requirements-dev.txt
steps:
- uses: actions/checkout@v4

- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.5.8-0'
environment-file: environment.yaml
init-shell: bash
cache-environment: true
post-cleanup: 'all'

- name: additional setup
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt
- name: Set up ssqueezepy
run: conda run pip install -e .
- name: Set up ssqueezepy
run: pip install -e .

- name: Test
shell: bash -l {0}
run: >
conda run pycodestyle --max-line-length=85
--ignore=E221,E241,E225,E226,E402,E722,E741,E272,E266,E302,E731,E702,E201,E129,E203,E202,W503,W504
ssqueezepy
conda run pytest tests/ -s --cov=ssqueezepy --cov-report=xml
- name: codecov upload coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./
- name: Test
shell: bash -l {0}
run: >
pycodestyle --max-line-length=85
--ignore=E221,E241,E225,E226,E402,E722,E741,E272,E266,E302,E731,E702,E201,E129,E203,E202,W503,W504
ssqueezepy
pytest tests/ -s --cov=ssqueezepy --cov-report=xml
- name: codecov upload coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
### 0.6.5

#### FIXES
- CuPy deprecation fix (update methods to be compatible with latest CuPy)
- `imp` -> `importlib` (Python deprecation)
- Github Actions changes: use fully micromamba; actions v4; py 3.7 -> 3.10;

### 0.6.4

#### FEATURES
Expand Down
2 changes: 1 addition & 1 deletion environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies:
- pytest-cov
- pycodestyle
- pip
- python >=3.7
- python >=3.10
- numpy
- scipy
- matplotlib
Expand Down
2 changes: 1 addition & 1 deletion tests/z_all_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def wrap(fn):

#### Ensure cached imports reloaded ##########################################
from types import ModuleType
from imp import reload
from importlib import reload
import ssqueezepy


Expand Down

0 comments on commit 248ed30

Please sign in to comment.