Skip to content

Commit e65c729

Browse files
committed
* Switch from setup.py to pyproject.toml
* Add numpy<2,pandas<2 test environment to build pipeline test matrix * Refactor build pipeline config file
1 parent f0b9f72 commit e65c729

File tree

6 files changed

+106
-168
lines changed

6 files changed

+106
-168
lines changed

.github/workflows/test.yml

+31-21
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,37 @@ jobs:
99
test:
1010
strategy:
1111
matrix:
12-
os: [ubuntu-latest]
13-
python: ['3.9', '3.10', '3.11', '3.12']
12+
os: [ ubuntu-latest ]
13+
python: [ "3.9", "3.10", "3.11", "3.12" ]
14+
numpy_version: [ "numpy-latest", "numpy<2" ]
1415
runs-on: ${{ matrix.os }}
1516

1617
steps:
17-
- uses: actions/checkout@v2
18-
- name: Set up Python ${{ matrix.python }}
19-
uses: actions/setup-python@v1
20-
with:
21-
python-version: ${{ matrix.python }}
22-
- uses: actions/cache@v3
23-
with:
24-
path: ~/.cache/pip
25-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/requirements-test.txt') }}
26-
restore-keys: |
27-
${{ runner.os }}-pip-
28-
- name: Install dependencies
29-
run: |
30-
python -m pip install --upgrade pip
31-
pip install -e .
32-
pip install -r requirements-test.txt
33-
- name: Test with pytest
34-
run: |
35-
pytest tests/
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
21+
- name: Set up Python ${{ matrix.python }}
22+
uses: actions/setup-python@v1
23+
with:
24+
python-version: ${{ matrix.python }}
25+
26+
- name: Use cache for pip dependencies
27+
uses: actions/cache@v3
28+
with:
29+
path: ~/.cache/pip
30+
key: ${{ runner.os }}-pip-${{ hashFiles("**/pyproject.toml") }}
31+
restore-keys: |
32+
${{ runner.os }}-pip-
33+
34+
- name: Install dependencies
35+
run: |
36+
python -m pip install --upgrade pip
37+
if [ "${{ matrix.numpy_version }}" = "numpy<2" ]; then
38+
pip install ".[test,test_numpy_pre2]"
39+
else
40+
pip install ".[test]"
41+
fi
42+
43+
- name: Test with pytest
44+
run: |
45+
pytest tests

CHANGES.rst

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ Version 1.0.34, Dec 2024
2020
* Remove unused test_gpu.twosigfigs function.
2121
* Refactor tests with Numpy() and Pandas() context managers to use single 'with' statement.
2222

23+
* Switch from setup.py to pyproject.toml
24+
* Add numpy<2,pandas<2 test environment to build pipeline test matrix
25+
2326
Version 1.0.33, Dec 2022
2427
------------------------
2528
* fix of get_sub_hist() when Bin histogram is filled only with nans.

pyproject.toml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "histogrammar"
7+
description = "Composable histogram primitives for distributed data reduction"
8+
keywords = [
9+
"pandas",
10+
"spark",
11+
"data-science",
12+
"data-analysis",
13+
"statistics",
14+
"python",
15+
"jupyter",
16+
"ipython"
17+
]
18+
readme = "README.rst"
19+
requires-python = ">=3.9"
20+
authors = [{ name = "Jim Pivarski (DIANA-HEP)", email = "[email protected]" }, { name = "Max Baak", email = "[email protected]" }]
21+
maintainers = [{ name = "Max Baak", email = "[email protected]" }]
22+
license = { type = "Apache Software License v2", file = "LICENSE" }
23+
dependencies = [
24+
"numpy",
25+
"tqdm",
26+
"joblib>=0.14.0"
27+
]
28+
classifiers = ["Development Status :: 5 - Production/Stable",
29+
"Environment :: Console",
30+
"Intended Audience :: Science/Research",
31+
"License :: OSI Approved :: Apache Software License",
32+
"Topic :: Scientific/Engineering :: Information Analysis",
33+
"Topic :: Scientific/Engineering :: Mathematics",
34+
"Topic :: Scientific/Engineering :: Physics",
35+
]
36+
dynamic = ["version"]
37+
38+
[project.optional-dependencies]
39+
test = [
40+
"ipykernel>=5.1.3",
41+
"jupyter_client>=5.2.3",
42+
"matplotlib",
43+
"pandas",
44+
"pre-commit>=2.9.0",
45+
"pytest-notebook>=0.6.1",
46+
"pytest>=4.0.2",
47+
]
48+
test_numpy_pre2 = [
49+
"numpy<2",
50+
"pandas<2",
51+
]
52+
53+
# files to be shipped with the installation, under: histogrammar/test_data and histogrammar/notebooks
54+
# after installation, these can be found with the functions in resources.py
55+
[tool.setuptools.package-data]
56+
histogrammar = [
57+
"test_data/*.csv.gz",
58+
"test_data/*.json*",
59+
"notebooks/*tutorial*.ipynb",
60+
]
61+
62+
[project.urls]
63+
repository = "https://github.com/histogrammar/histogrammar-python"
64+
65+
[tool.semantic_release]
66+
version_variable = [
67+
"histogrammar/version.py:version",
68+
]
69+
build_command = "pip install build && python -m build"
70+
71+
[tool.setuptools.dynamic]
72+
version = { attr = "histogrammar.version.version" }

requirements-test.txt

-7
This file was deleted.

requirements.txt

-3
This file was deleted.

setup.py

-137
This file was deleted.

0 commit comments

Comments
 (0)