Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintenance, scipy update, and automated scipy update script #107

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions .flake8

This file was deleted.

16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: "pip"
target-branch: "main"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "06:00"
- package-ecosystem: "github-actions"
target-branch: "main"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "06:00"
39 changes: 39 additions & 0 deletions .github/workflows/dependabot_helper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Dependabot helper
on: pull_request

permissions:
pull-requests: write
issues: write
contents: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'numba/numba-scipy'
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.head_ref }}

- name: Scipy check
if: contains(steps.metadata.outputs.dependency-names, 'scipy')
shell: bash -l {0}
run: |
prev_version=${{ steps.metadata.outputs.previous-version }}
new_version=${{ steps.metadata.outputs.new-version }}
sed -i s/$prev_version/$new_version/g .github/workflows/test_and_deploy.yml buildscripts/conda_recipes/numba-scipy/meta.yaml
git config user.email "49699333+dependabot[bot]@users.noreply.github.com"
git config user.name "dependabot[bot]"
git add .github/workflows/test_and_deploy.yml buildscripts/conda_recipes/numba-scipy/meta.yaml
if [[ -n $(git status --porcelain) ]] ; then
git commit -m "Updated scipy in build scripts"
git push
fi
39 changes: 21 additions & 18 deletions .github/workflows/deploy_release.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
name: Deploy Release

on:
push:
tags:
- '*'
release:
types: [published]

permissions:
contents: read

jobs:
deploy_pypi:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Miniconda
uses: conda-incubator/[email protected]
- uses: actions/setup-python@v5
with:
auto-update-conda: true
auto-activate-base: false
activate-environment: test_env
python-version: |
3.9
3.10
3.11
3.12
cache: "pip"
- name: Install dependencies
shell: bash -l {0}
run: |
conda install -c numba python=3.8 numba>=0.45 'scipy>=0.16,<1.4' wheel
- name: Build PyPI artifacts
shell: bash -l {0}
run: |
python setup.py sdist bdist_wheel
python -m pip install --upgrade pip
pip install hatch
- name: Build package
run: hatch build
- name: Publish to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_SECRET }}
uses: pypa/gh-action-pypi-publish@release/v1
33 changes: 9 additions & 24 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
scipy-version: [">=1.4,<1.11.0"]
numpy-version: ["<1.22.0", ">=1.22.0"]
scipy-version: [">=1.4,<=1.14.1"]
numpy-version: [">=1.22.0"]
steps:
- name: Install glibc-tools
shell: bash -l {0}
Expand All @@ -40,12 +40,13 @@ jobs:
- name: Install dependencies
shell: bash -l {0}
run: |
conda install -c numba conda-build python=${{ env.MAIN_PYVER }} numba>=0.45 'scipy${{ matrix.scipy-version }}' 'numpy${{ matrix.numpy-version }}' flake8 pytest pip
conda install -c numba conda-build python=${{ env.MAIN_PYVER }} numba>=0.45 'scipy${{ matrix.scipy-version }}' 'numpy${{ matrix.numpy-version }}' ruff pytest pip
pip install --no-deps -e .
- name: Lint with flake8
- name: Lint
shell: bash -l {0}
run: |
flake8 numba_scipy
ruff check .
ruff format .
- name: Pytest
shell: bash -l {0}
run: |
Expand All @@ -70,26 +71,10 @@ jobs:
needs: build
strategy:
matrix:
scipy-version: [">=1.4,<1.11.0"]
pyver: [3.8, 3.9, "3.10", 3.11]
scipy-version: [">=1.4,<=1.14.1"]
pyver: [3.9, "3.10", 3.11, 3.12]
runs-on: [macos-latest, ubuntu-latest, windows-latest]
numpy-version: ["<1.22.0", ">=1.22.0"]
exclude:
- pyver: 3.11
numpy-version: "<1.22.0"
include:
- pyver: 3.8
scipy-version: ">=0.16,<1.4"
numpy-version: "<1.22.0"
runs-on: macos-latest
- pyver: 3.8
scipy-version: ">=0.16,<1.4"
numpy-version: "<1.22.0"
runs-on: ubuntu-latest
- pyver: 3.8
scipy-version: ">=0.16,<1.4"
numpy-version: "<1.22.0"
runs-on: windows-latest
numpy-version: [">=1.22.0"]

runs-on: ${{ matrix.runs-on }}
steps:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ htmlcov/
.vscode/
.ipynb_checkpoints/
__pycache__/

numba_scipy/_version.py
5 changes: 0 additions & 5 deletions MANIFEST.in

This file was deleted.

6 changes: 3 additions & 3 deletions buildscripts/conda_recipes/numba-scipy/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ requirements:
host:
- python
- numba
- scipy<1.11.0
- scipy<=1.14.1
- setuptools
run:
- python
- numba
- scipy<1.11.0
- scipy<=1.14.1

test:
requires:
- scipy<1.11.0
- scipy<=1.14.1
- pytest
- setuptools
- faulthandler # [py27 and (not (armv6l or armv7l))]
Expand Down
19 changes: 1 addition & 18 deletions buildscripts/incremental/setup_conda_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ PIP_INSTALL="pip install -q"
source deactivate
# Display root environment (for debugging)
conda list
# Clean up any left-over from a previous build
# (note workaround for https://github.com/conda/conda/issues/2679:
# `conda env remove` issue)
conda remove --all -q -y -n $CONDA_ENV

# Create a base env
conda create -n $CONDA_ENV -q -y python=$PYTHON numpy=$NUMPY scipy=$SCIPY pip
Expand All @@ -36,20 +32,7 @@ set +v
source activate $CONDA_ENV
set -v

# 32bit linux needs the numba channel to get a conda package as the distro
# channels stopped shipping for 32bit linux packages, this branching is
# superfluous but sets up for adding later conditional package installation.
if [[ $(uname) == Linux ]]; then
if [[ "$CONDA_SUBDIR" == "linux-32" || "$BITS32" == "yes" ]] ; then
$CONDA_INSTALL -c numba numba
# Work around https://github.com/pytest-dev/pytest/issues/3280
$CONDA_INSTALL pytest attrs==19.1.0
else
$CONDA_INSTALL numba pytest
fi
elif [[ $(uname) == Darwin ]]; then
$CONDA_INSTALL numba pytest
fi
$CONDA_INSTALL numba pytest

# environment dump for debug
echo "-------------------------------------------------------------------------"
Expand Down
2 changes: 1 addition & 1 deletion docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ channels:
- numba

dependencies:
- python=3.7
- python=3.12
- pip
- setuptools
- numba
Expand Down
40 changes: 20 additions & 20 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import numba_scipy
except ImportError:
# Numba is run from its source checkout
sys.path.insert(0, os.path.abspath('../..'))
import numba
sys.path.insert(0, os.path.abspath("../.."))
import numba # noqa: F401
import numba_scipy


Expand All @@ -35,33 +35,33 @@

# -- Project information -----------------------------------------------------

project = u'numba-scipy'
copyright = u'2019, Anaconda, Inc.'
author = u'Anaconda, Inc.'
project = "numba-scipy"
copyright = "2019, Anaconda, Inc."
author = "Anaconda, Inc."

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
version = '.'.join(numba_scipy.__version__.split('.')[:2])
version = ".".join(numba_scipy.__version__.split(".")[:2])
# The full version, including alpha/beta/rc tags.
release = numba_scipy.__version__

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.intersphinx',
'sphinx.ext.autodoc',
"sphinx.ext.intersphinx",
"sphinx.ext.autodoc",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['../_templates']
templates_path = ["../_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand All @@ -75,13 +75,13 @@
# a list of builtin themes.
#
# pip install sphinx_bootstrap_theme
html_theme = 'bootstrap'
html_theme = "bootstrap"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
html_theme_options = {
'bootswatch_theme': "paper",
"bootswatch_theme": "paper",
}

# Add any paths that contain custom themes here, relative to this directory.
Expand All @@ -90,19 +90,19 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['../_static']
html_static_path = ["../_static"]


# -- Intersphinx -------------------------------------------------------------
# Configuration for intersphinx: refer to the Python standard library
# and the Numpy documentation.
intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
'numpy': ('http://docs.scipy.org/doc/numpy', None),
'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None),
'numba': ('http://numba.pydata.org/numba-doc/latest', None),
'llvmlite': ('http://llvmlite.pydata.org/en/latest/', None),
}
"python": ("https://docs.python.org/3", None),
"numpy": ("http://docs.scipy.org/doc/numpy", None),
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
"numba": ("https://numba.readthedocs.io/en/stable/index.html", None),
"llvmlite": ("http://llvmlite.pydata.org/en/latest/", None),
}


# numpydoc options
Expand All @@ -112,4 +112,4 @@


def setup(app):
app.add_stylesheet("numba-scipy-docs.css")
app.add_css_file("numba-scipy-docs.css")
8 changes: 4 additions & 4 deletions numba_scipy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

from . import _version
__version__ = _version.get_versions()['version']

__version__ = _version.version


def _init_extension():
'''Register SciPy functions with Numba.
"""Register SciPy functions with Numba.

This entry_point is called by Numba when it initializes.
'''
"""
from . import special, sparse
Loading