Skip to content

Commit

Permalink
Run pre-commit run -a
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrodmillman committed Sep 18, 2023
1 parent d531f66 commit bb1d188
Show file tree
Hide file tree
Showing 92 changed files with 480 additions and 488 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ omit =
*/pywt/data/create_dat.py
*.pxd
stringsource
plugins = Cython.Coverage
plugins = Cython.Coverage
164 changes: 81 additions & 83 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
- v1.**

jobs:

test_pywavelets_linux:
name: linux-cp${{ matrix.python-version }}-${{ matrix.OPTIONS_NAME }}
runs-on: ubuntu-latest
Expand All @@ -27,7 +26,7 @@ jobs:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
python-version: [3.9, '3.10', '3.11', '3.12']
python-version: [3.9, "3.10", "3.11", "3.12"]
MINIMUM_REQUIREMENTS: [0]
USE_SCIPY: [0]
USE_SDIST: [0]
Expand All @@ -48,7 +47,7 @@ jobs:
USE_SDIST: 1
OPTIONS_NAME: "install-from-sdist"
- platform_id: manylinux_x86_64
python-version: '3.12'
python-version: "3.12"
PIP_FLAGS: "--pre"
OPTIONS_NAME: "pre-releases"

Expand All @@ -64,32 +63,32 @@ jobs:

- name: Build package
env:
VERSION: ${{ matrix.python-version }}
MINIMUM_REQUIREMENTS: ${{ matrix.MINIMUM_REQUIREMENTS }}
PIP_FLAGS: ${{ matrix.PIP_FLAGS }}
USE_SDIST: ${{ matrix.USE_SDIST }}
USE_SCIPY: ${{ matrix.USE_SCIPY }}
REFGUIDE_CHECK: ${{ matrix.REFGUIDE_CHECK }}
VERSION: ${{ matrix.python-version }}
MINIMUM_REQUIREMENTS: ${{ matrix.MINIMUM_REQUIREMENTS }}
PIP_FLAGS: ${{ matrix.PIP_FLAGS }}
USE_SDIST: ${{ matrix.USE_SDIST }}
USE_SCIPY: ${{ matrix.USE_SCIPY }}
REFGUIDE_CHECK: ${{ matrix.REFGUIDE_CHECK }}
run: |
uname -a
df -h
ulimit -a
# ccache -s
which python
python --version
# sudo apt-get install libatlas-base-dev
pip install --upgrade pip build
# Set numpy version first, other packages link against it
if [ "${MINIMUM_REQUIREMENTS}" == "1" ]; then
pip install ${CYTHON_MIN}
pip install ${NUMPY_MIN}
if [ "${USE_SCIPY}" == "1" ]; then pip install ${SCIPY_MIN}; fi
else
pip install ${PIP_FLAGS} cython
pip install ${PIP_FLAGS} numpy
if [ "${USE_SCIPY}" == "1" ]; then pip install ${PIP_FLAGS} scipy; fi
fi
pip install ${PIP_FLAGS} matplotlib pytest
uname -a
df -h
ulimit -a
# ccache -s
which python
python --version
# sudo apt-get install libatlas-base-dev
pip install --upgrade pip build
# Set numpy version first, other packages link against it
if [ "${MINIMUM_REQUIREMENTS}" == "1" ]; then
pip install ${CYTHON_MIN}
pip install ${NUMPY_MIN}
if [ "${USE_SCIPY}" == "1" ]; then pip install ${SCIPY_MIN}; fi
else
pip install ${PIP_FLAGS} cython
pip install ${PIP_FLAGS} numpy
if [ "${USE_SCIPY}" == "1" ]; then pip install ${PIP_FLAGS} scipy; fi
fi
pip install ${PIP_FLAGS} matplotlib pytest
set -o pipefail
if [ "${USE_SDIST}" == "1" ]; then
Expand All @@ -104,22 +103,21 @@ jobs:
- name: Run tests
env:
USE_SDIST: ${{ matrix.USE_SDIST }}
REFGUIDE_CHECK: ${{ matrix.REFGUIDE_CHECK }}
USE_SDIST: ${{ matrix.USE_SDIST }}
REFGUIDE_CHECK: ${{ matrix.REFGUIDE_CHECK }}
run: |
set -o pipefail
# Move out of source directory to avoid finding local pywt
pushd demo
if [ "${USE_SDIST}" == "1" ]; then
pytest --pyargs pywt
python ../pywt/tests/test_doc.py
elif [ "${REFGUIDE_CHECK}" == "1" ]; then
python util/refguide_check.py --doctests
else
pytest --pyargs pywt
fi
popd
set -o pipefail
# Move out of source directory to avoid finding local pywt
pushd demo
if [ "${USE_SDIST}" == "1" ]; then
pytest --pyargs pywt
python ../pywt/tests/test_doc.py
elif [ "${REFGUIDE_CHECK}" == "1" ]; then
python util/refguide_check.py --doctests
else
pytest --pyargs pywt
fi
popd
test_pywavelets_macos:
name: macos-cp${{ matrix.python-version }}-${{ matrix.OPTIONS_NAME }}
Expand All @@ -136,18 +134,18 @@ jobs:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
python-version: [3.9, '3.12']
python-version: [3.9, "3.12"]
MINIMUM_REQUIREMENTS: [0]
USE_SCIPY: [0]
USE_SDIST: [0]
REFGUIDE_CHECK: [0]
PIP_FLAGS: [""]
OPTIONS_NAME: ["default"]
include:
- python-version: '3.9'
- python-version: "3.9"
MINIMUM_REQUIREMENTS: 1
OPTIONS_NAME: "osx-minimum-req"
- python-version: '3.12'
- python-version: "3.12"
PIP_FLAGS: "--pre"
OPTIONS_NAME: "pre-releases"

Expand All @@ -163,30 +161,30 @@ jobs:

- name: Build package
env:
VERSION: ${{ matrix.python-version }}
MINIMUM_REQUIREMENTS: ${{ matrix.MINIMUM_REQUIREMENTS }}
PIP_FLAGS: ${{ matrix.PIP_FLAGS }}
USE_SDIST: ${{ matrix.USE_SDIST }}
USE_SCIPY: ${{ matrix.USE_SCIPY }}
REFGUIDE_CHECK: ${{ matrix.REFGUIDE_CHECK }}
CC: /usr/bin/clang
CXX: /usr/bin/clang++
VERSION: ${{ matrix.python-version }}
MINIMUM_REQUIREMENTS: ${{ matrix.MINIMUM_REQUIREMENTS }}
PIP_FLAGS: ${{ matrix.PIP_FLAGS }}
USE_SDIST: ${{ matrix.USE_SDIST }}
USE_SCIPY: ${{ matrix.USE_SCIPY }}
REFGUIDE_CHECK: ${{ matrix.REFGUIDE_CHECK }}
CC: /usr/bin/clang
CXX: /usr/bin/clang++
run: |
uname -a
df -h
ulimit -a
which python
python --version
pip install --upgrade pip build
# Set numpy version first, other packages link against it
if [ "${MINIMUM_REQUIREMENTS}" == "1" ]; then
pip install ${CYTHON_MIN} ${NUMPY_MIN}
if [ "${USE_SCIPY}" == "1" ]; then pip install ${SCIPY_MIN}; fi
else
pip install ${PIP_FLAGS} cython numpy
if [ "${USE_SCIPY}" == "1" ]; then pip install ${PIP_FLAGS} scipy; fi
fi
pip install ${PIP_FLAGS} matplotlib pytest
uname -a
df -h
ulimit -a
which python
python --version
pip install --upgrade pip build
# Set numpy version first, other packages link against it
if [ "${MINIMUM_REQUIREMENTS}" == "1" ]; then
pip install ${CYTHON_MIN} ${NUMPY_MIN}
if [ "${USE_SCIPY}" == "1" ]; then pip install ${SCIPY_MIN}; fi
else
pip install ${PIP_FLAGS} cython numpy
if [ "${USE_SCIPY}" == "1" ]; then pip install ${PIP_FLAGS} scipy; fi
fi
pip install ${PIP_FLAGS} matplotlib pytest
set -o pipefail
if [ "${USE_SDIST}" == "1" ]; then
Expand All @@ -201,18 +199,18 @@ jobs:
- name: Run tests
env:
PIP_FLAGS: ${{ matrix.PIP_FLAGS }}
USE_SDIST: ${{ matrix.USE_SDIST }}
REFGUIDE_CHECK: ${{ matrix.REFGUIDE_CHECK }}
PIP_FLAGS: ${{ matrix.PIP_FLAGS }}
USE_SDIST: ${{ matrix.USE_SDIST }}
REFGUIDE_CHECK: ${{ matrix.REFGUIDE_CHECK }}
run: |
# Move out of source directory to avoid finding local pywt
pushd demo
if [ "${USE_SDIST}" == "1" ]; then
pytest --pyargs pywt
python ../pywt/tests/test_doc.py
elif [ "${REFGUIDE_CHECK}" == "1" ]; then
python util/refguide_check.py --doctests
else
pytest --pyargs pywt
fi
popd
# Move out of source directory to avoid finding local pywt
pushd demo
if [ "${USE_SDIST}" == "1" ]; then
pytest --pyargs pywt
python ../pywt/tests/test_doc.py
elif [ "${REFGUIDE_CHECK}" == "1" ]; then
python util/refguide_check.py --doctests
else
pytest --pyargs pywt
fi
popd
41 changes: 23 additions & 18 deletions .github/workflows/wheel_tests_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ name: Build Wheels and Release
on:
push:
tags:
- 'v*'
- 'buildwheels*'
- "v*"
- "buildwheels*"
env:
CIBW_BUILD_VERBOSITY: 2
# CIBW_BEFORE_BUILD: pip install cython
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest --pyargs pywt
CIBW_ENVIRONMENT: PIP_PREFER_BINARY=1


jobs:
build_linux_x86_64_wheels:
name: Build python ${{ matrix.cibw_python }} ${{ matrix.cibw_arch }} wheels on ${{ matrix.os }}
Expand All @@ -21,16 +20,16 @@ jobs:
matrix:
os: [ubuntu-latest]
cibw_python: ["cp39-*", "cp310-*", "cp311-*", "cp312-*"]
cibw_manylinux: [ manylinux2014 ]
cibw_arch: [ "x86_64"]
cibw_manylinux: [manylinux2014]
cibw_arch: ["x86_64"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.9'
python-version: "3.9"
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel
Expand All @@ -56,15 +55,15 @@ jobs:
matrix:
os: [ubuntu-latest]
cibw_python: ["cp39-*", "cp310-*", "cp311-*", "cp312-*"]
cibw_manylinux: [ manylinux2014 ]
cibw_manylinux: [manylinux2014]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.9'
python-version: "3.9"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
Expand Down Expand Up @@ -92,7 +91,7 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest]
cibw_python: ["cp39-*", "cp310-*" , "cp311-*", "cp312-*"]
cibw_python: ["cp39-*", "cp310-*", "cp311-*", "cp312-*"]
cibw_arch: ["x86_64", "arm64"]
steps:
- uses: actions/checkout@v4
Expand All @@ -102,7 +101,7 @@ jobs:
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.9'
python-version: "3.9"

- name: Install cibuildwheel
run: |
Expand Down Expand Up @@ -149,21 +148,21 @@ jobs:
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.9'
python-version: "3.9"

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel
- name: Setup MSVC (32-bit)
if: matrix.cibw_arch == 'x86'
uses: bus1/cabuild/action/msdevshell@e22aba57d6e74891d059d66501b6b5aed8123c4d # v1
uses: bus1/cabuild/action/msdevshell@e22aba57d6e74891d059d66501b6b5aed8123c4d # v1
with:
architecture: x86

- name: Setup MSVC (64-bit)
if: matrix.cibw_arch == 'AMD64'
uses: bus1/cabuild/action/msdevshell@e22aba57d6e74891d059d66501b6b5aed8123c4d # v1
uses: bus1/cabuild/action/msdevshell@e22aba57d6e74891d059d66501b6b5aed8123c4d # v1
with:
architecture: x64

Expand All @@ -181,7 +180,13 @@ jobs:

deploy:
name: Release
needs: [build_linux_x86_64_wheels, build_linux_aarch64_wheels, build_macos_wheels, build_windows_wheels]
needs:
[
build_linux_x86_64_wheels,
build_linux_aarch64_wheels,
build_macos_wheels,
build_windows_wheels,
]
if: github.repository_owner == 'PyWavelets' && startsWith(github.ref, 'refs/tags/v') && always()
runs-on: ubuntu-latest
steps:
Expand All @@ -192,20 +197,20 @@ jobs:
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.9'
python-version: "3.9"

- name: Install Twine
run: |
python -m pip install --upgrade pip
pip install twine
pip install cython numpy
- uses: actions/download-artifact@v3
id: download
with:
name: wheels
path: ./dist

- name: Publish the source distribution on PyPI
run: |
PYWT_VERSION=$(git describe --tags)
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ environment:

# From https://mesonbuild.com/Continuous-Integration.html#appveyor-for-windows
install:
- "py -VV" # Also, `py --list`
- "py -VV" # Also, `py --list`
- "py -m pip install --upgrade pip build"
- "py -m pip install numpy --cache-dir c:\\tmp\\pip-cache"
- "py -m pip install --only-binary :all: Cython pytest matplotlib --cache-dir c:\\tmp\\pip-cache"
Expand Down
1 change: 0 additions & 1 deletion benchmarks/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,3 @@ Some things to consider:
- Preparing arrays etc. should generally be put in the ``setup`` method rather
than the ``time_`` methods, to avoid counting preparation time together with
the time of the benchmarked operation.

1 change: 0 additions & 1 deletion benchmarks/benchmarks/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

Loading

0 comments on commit bb1d188

Please sign in to comment.