Skip to content

Commit

Permalink
Modernize the build process (testing)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescAlted committed Jun 20, 2024
1 parent 9c8ec78 commit ec01ac9
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 47 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include MANIFEST.in
include MANIFEST.in VERSION

include *.rst *.txt *.cfg site.cfg.example

Expand Down
6 changes: 3 additions & 3 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ Releasing NumExpr

* Author: Robert A. McLeod, Francesc Alted
* Contact: [email protected]
* Date: 2023-12-11
* Date: 2024-06-20

Following are notes for releasing NumExpr.

Preliminaries
-------------

* Make sure that `RELEASE_NOTES.rst` and `ANNOUNCE.rst` are up-to-date with the latest news in the release.
* Ensure that the new version number in `setup.cfg` is correct.
* Ensure that the new version number in `VERSION` is correct.
* Do a commit and a push:

`git commit -a -m "Getting ready for release X.Y.Z"`
Expand Down Expand Up @@ -74,7 +74,7 @@ Announcing
Post-release actions
--------------------

* Add `.dev0` to the version number in `setup.cfg`, and bump the bugfix version
* Add `.dev0` to the version number in `VERSION`, and bump the bugfix version
number.
* Create new headers for adding new features in `RELEASE_NOTES.rst`
and add this place-holder:
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.10.1
2 changes: 0 additions & 2 deletions numexpr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
# cpuinfo imports were moved into the test submodule function that calls them
# to improve import times.

import os, os.path
import platform
from numexpr.expressions import E
from numexpr.necompiler import (NumExpr, disassemble, evaluate, re_evaluate,
validate)
Expand Down
46 changes: 44 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,48 @@
requires = [
"setuptools",
"wheel",
"numpy>=2.0.0rc1",
"numpy>=2.0.0",
]
build-backend = "setuptools.build_meta"
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
include = ["numexpr"]

[project]
name = "numexpr"
description = "Fast numerical expression evaluator for NumPy"
authors = [{name = "David M. Cooke, Francesc Alted, and others", email = "[email protected]"}]
maintainers = [{ name = "Blosc Development Team", email = "[email protected]"}]
classifiers = [
"Development Status :: 6 - Mature",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Topic :: Software Development :: Libraries :: Python Modules",
"Operating System :: Microsoft :: Windows",
"Operating System :: Unix",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
requires-python = ">=3.9"
# Follow guidelines from https://scientific-python.org/specs/spec-0000/
dependencies = [
"numpy>=1.23.0",
]
dynamic = ["version"]

[project.urls]
homepage = "https://github.com/pydata/numexpr"
documentation = "https://numexpr.readthedocs.io/en/latest/user_guide.html"
repository = "https://github.com/pydata/numexpr"

[tool.cibuildwheel]
skip = "cp36-* cp37-* pp37-* cp38-* pp* *-manylinux_i686 *_ppc64le *_s390x"
# Let's use a more recent version of the manylinux image for more modern compilers
manylinux-x86_64-image = "manylinux_2_28"
manylinux-aarch64-image = "manylinux_2_28"
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
numpy >= 1.19.3 # keep in sync with NPY_TARGET_VERSION (setup.py)
numpy >= 1.23.0 # keep in sync with NPY_TARGET_VERSION (setup.py)
32 changes: 0 additions & 32 deletions setup.cfg

This file was deleted.

15 changes: 9 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@
####################################################################

import os, os.path as op
from setuptools import setup, Extension
import platform
import configparser
import numpy as np
from setuptools import setup, Extension


with open('requirements.txt') as f:
requirements = f.read().splitlines()

version = open("VERSION").read().strip()
with open('numexpr/version.py', 'w') as fh:
cfg = configparser.ConfigParser()
cfg.read('setup.cfg')
fh.write('# THIS FILE IS GENERATED BY `SETUP.PY`\n')
fh.write("version = '%s'\n" % cfg['metadata']['version'])
# Create the version.py file
fh.write("# THIS FILE IS GENERATED BY `setup.py`\n")
fh.write(f"__version__ = '{version}'\n")
fh.write(f"version = '{version}'\n")
try:
fh.write("numpy_build_version = '%s'\n" % np.__version__)
except ImportError:
Expand All @@ -35,7 +37,7 @@
clibs = []
def_macros = [
# keep in sync with minimal runtime requirement (requirements.txt)
('NPY_TARGET_VERSION', 'NPY_1_19_API_VERSION')
('NPY_TARGET_VERSION', 'NPY_1_23_API_VERSION')
]
sources = ['numexpr/interpreter.cpp',
'numexpr/module.cpp',
Expand Down Expand Up @@ -98,6 +100,7 @@ def setup_package():
)

metadata = dict(
version=version,
install_requires=requirements,
libraries=clibs,
ext_modules=[
Expand Down

0 comments on commit ec01ac9

Please sign in to comment.