Skip to content

Commit

Permalink
Update minimal Python/numpy requirements
Browse files Browse the repository at this point in the history
Follows NEP29
  • Loading branch information
mstimberg committed Jun 22, 2023
1 parent 5dc465a commit 0f78511
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/publish_to_pypi.yml
Expand Up @@ -2,7 +2,21 @@ name: Build and publish to TestPyPI or PyPI
on: [push, pull_request]

jobs:
get_python_versions:
name: "Determine Python versions"
runs-on: ubuntu-latest
outputs:
min-python: ${{ steps.nep29.outputs.min-python }}
max-python: ${{ steps.nep29.outputs.max-python }}
steps:
- name: "calculate versions according to NEP29"
id: nep29
uses: mstimberg/github-calc-nep29@v0.5
with:
token: ${{ secrets.GITHUB_TOKEN }}

build:
needs: [get_python_versions]
name: Build 🎡 on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -22,7 +36,7 @@ jobs:
with:
output-dir: dist
env:
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7"
CIBW_PROJECT_REQUIRES_PYTHON: ">=${{ needs.get_python_versions.outputs.min-python }}"
CIBW_ARCHS_WINDOWS: auto64
CIBW_ARCHS_MACOS: x86_64 universal2
CIBW_TEST_SKIP: '*_arm64 *_universal2:arm64'
Expand All @@ -36,6 +50,7 @@ jobs:
path: dist

build-linux:
needs: [get_python_versions]
name: Build ${{ matrix.arch }} 🎡 and source 📦 on Linux
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -65,7 +80,7 @@ jobs:
with:
output-dir: dist
env:
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7"
CIBW_PROJECT_REQUIRES_PYTHON: ">=${{ needs.get_python_versions.outputs.min-python }}"
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_SKIP: 'pp* *-musllinux_*'
Expand Down
4 changes: 3 additions & 1 deletion docs_sphinx/introduction/release_notes.rst
Expand Up @@ -5,7 +5,9 @@ Brian 2.5.2
-----------
This new minor release fixes incompatibility issues with the latest numpy release, and a number of other issues.
To make it easier to contribute to Brian, we have now adopted a consistent code style and updated our infrastructure so
that the style gets enforced for all new code contributions (see :ref:`code_style` for details).
that the style gets enforced for all new code contributions (see :ref:`code_style` for details). Following
`NEP 29 <https://numpy.org/neps/nep-0029-deprecation_policy.html>`_, this release supports Python 3.9 & numpy 1.21 and
newer.

New features
~~~~~~~~~~~~
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Expand Up @@ -9,15 +9,15 @@ requires = [
build-backend = "setuptools.build_meta"

[tool.black]
target-version = ['py38']
target-version = ['py39']
include = '^/brian2/.*\.pyi?$'
extend-exclude = '^/brian2/_version.py$'
preview = true

[tool.isort]
atomic = true
profile = "black"
py_version = "38"
py_version = "39"
skip_gitignore = true
# NOTE: isort has no "include" option, only "skip".
extend_skip = ["brian2/_version.py"]
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Expand Up @@ -157,7 +157,7 @@ def build_extension(self, ext):
'brian2.random': ['randomkit/randomkit.c',
'randomkit/randomkit.h']
},
install_requires=['numpy>=1.17',
install_requires=['numpy>=1.21',
'cython>=0.29',
'sympy>=1.2',
'pyparsing',
Expand All @@ -169,6 +169,7 @@ def build_extension(self, ext):
setup_requires=['numpy>=1.10',
'setuptools>=24.2'
],
python_requires='>=3.9',
cmdclass=versioneer.get_cmdclass({'build_ext': optional_build_ext}),
provides=['brian2'],
extras_require={'test': ['pytest',
Expand Down Expand Up @@ -199,6 +200,5 @@ def build_extension(self, ext):
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering :: Bio-Informatics'
],
python_requires='>=3.7'
]
)

0 comments on commit 0f78511

Please sign in to comment.