Skip to content

Commit 17efa92

Browse files
committed
devops: migrate to uv and nox
1 parent e6c4753 commit 17efa92

File tree

11 files changed

+1770
-93
lines changed

11 files changed

+1770
-93
lines changed

.github/workflows/ci-main-build-test-deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
strategy:
1414
matrix:
1515
python-version:
16-
- "3.8"
17-
- "3.9"
1816
- "3.10"
1917
- "3.11"
2018
- "3.12"
19+
- "3.13"
20+
- "3.14"
2121

2222
steps:
2323
- uses: actions/checkout@v4

Makefile

Lines changed: 54 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,95 @@
11
LINT_TARGET_DIRS := PyEMD doc example
2-
PYTHON := .venv/bin/python
32

3+
.PHONY: init sync test clean doc format lint-check freeze nox nox-lint
4+
.PHONY: perf perf-quick perf-scaling perf-splines perf-extrema perf-eemd perf-ceemdan perf-complexity perf-sifting perf-compare perf-list perf/build
5+
6+
# Development setup
47
init:
5-
python -m venv .venv
6-
.venv/bin/pip install -r requirements.txt
7-
.venv/bin/pip install -e .[dev]
8-
@echo "Run 'source .venv/bin/activate' to activate the virtual environment"
8+
uv sync --all-extras
9+
@echo "Development environment ready. Run 'source .venv/bin/activate' to activate."
10+
11+
sync:
12+
uv sync --all-extras
913

14+
# Testing
1015
test:
11-
$(PYTHON) -m PyEMD.tests.test_all
16+
uv run python -m PyEMD.tests.test_all
1217

13-
clean:
14-
find PyEMD -name __pycache__ -execdir rm -r {} +
18+
test-pytest:
19+
uv run pytest PyEMD/tests/
1520

16-
.PHONY: doc
17-
doc:
18-
cd doc && make html
21+
# Multi-version testing with nox
22+
nox:
23+
uv run nox -s tests
24+
25+
nox-lint:
26+
uv run nox -s lint
27+
28+
nox-all:
29+
uv run nox
1930

31+
# Code quality
2032
format:
21-
$(PYTHON) -m black $(LINT_TARGET_DIRS)
22-
$(PYTHON) -m isort PyEMD
33+
uv run black $(LINT_TARGET_DIRS)
34+
uv run isort PyEMD
2335

2436
lint-check:
25-
$(PYTHON) -m isort --check PyEMD
26-
$(PYTHON) -m black --check $(LINT_TARGET_DIRS)
37+
uv run isort --check PyEMD
38+
uv run black --check $(LINT_TARGET_DIRS)
39+
40+
# Documentation
41+
doc:
42+
cd doc && make html
43+
44+
# Cleanup
45+
clean:
46+
find PyEMD -name __pycache__ -execdir rm -r {} +
47+
rm -rf .venv
48+
49+
# Export requirements for pip users
50+
freeze:
51+
uv export --no-hashes --no-dev --no-emit-project -o requirements.txt
52+
uv export --no-hashes --only-dev --no-emit-project -o requirements-dev.txt
53+
@echo "Exported requirements.txt and requirements-dev.txt"
2754

2855
# Performance tests
2956
# Results saved to perf_test/results/<timestamp>/
3057

31-
.PHONY: perf perf-quick perf-scaling perf-splines perf-extrema perf-eemd perf-ceemdan perf-complexity perf-sifting
32-
3358
perf:
3459
@echo "Running full performance test suite..."
35-
$(PYTHON) perf_test/perf_test_comprehensive.py
60+
uv run python perf_test/perf_test_comprehensive.py
3661

3762
perf-quick:
3863
@echo "Running quick performance test suite..."
39-
$(PYTHON) perf_test/perf_test_comprehensive.py --quick
64+
uv run python perf_test/perf_test_comprehensive.py --quick
4065

4166
perf-scaling:
4267
@echo "Running EMD scaling test..."
43-
$(PYTHON) perf_test/perf_test_comprehensive.py --test scaling
68+
uv run python perf_test/perf_test_comprehensive.py --test scaling
4469

4570
perf-splines:
4671
@echo "Running spline comparison test..."
47-
$(PYTHON) perf_test/perf_test_comprehensive.py --test splines
72+
uv run python perf_test/perf_test_comprehensive.py --test splines
4873

4974
perf-extrema:
5075
@echo "Running extrema detection test..."
51-
$(PYTHON) perf_test/perf_test_comprehensive.py --test extrema
76+
uv run python perf_test/perf_test_comprehensive.py --test extrema
5277

5378
perf-eemd:
5479
@echo "Running EEMD parallel scaling test..."
55-
$(PYTHON) perf_test/perf_test_comprehensive.py --test eemd
80+
uv run python perf_test/perf_test_comprehensive.py --test eemd
5681

5782
perf-ceemdan:
5883
@echo "Running CEEMDAN performance test..."
59-
$(PYTHON) perf_test/perf_test_comprehensive.py --test ceemdan
84+
uv run python perf_test/perf_test_comprehensive.py --test ceemdan
6085

6186
perf-complexity:
6287
@echo "Running signal complexity test..."
63-
$(PYTHON) perf_test/perf_test_comprehensive.py --test complexity
88+
uv run python perf_test/perf_test_comprehensive.py --test complexity
6489

6590
perf-sifting:
6691
@echo "Running sifting parameters test..."
67-
$(PYTHON) perf_test/perf_test_comprehensive.py --test sifting
92+
uv run python perf_test/perf_test_comprehensive.py --test sifting
6893

6994
perf-compare:
7095
@if [ $$(ls -d perf_test/results/*/ 2>/dev/null | wc -l) -lt 2 ]; then \
@@ -77,7 +102,7 @@ perf-compare:
77102
echo " Baseline: $$BASELINE"; \
78103
echo " Comparison: $$COMPARISON"; \
79104
echo ""; \
80-
$(PYTHON) perf_test/compare_results.py "$$BASELINE" "$$COMPARISON"
105+
uv run python perf_test/compare_results.py "$$BASELINE" "$$COMPARISON"
81106

82107
perf-list:
83108
@echo "Available performance test targets:"
@@ -93,9 +118,9 @@ perf-list:
93118
@echo ""
94119
@echo "Comparison:"
95120
@echo " make perf-compare - Compare two most recent results"
96-
@echo " $(PYTHON) perf_test/compare_results.py <baseline> <comparison>"
121+
@echo " uv run python perf_test/compare_results.py <baseline> <comparison>"
97122
@echo ""
98123
@echo "Results saved to: perf_test/results/<timestamp>_<test>/"
99124

100125
perf/build:
101-
docker build -t pyemd-perf -f perf_test/Dockerfile .
126+
docker build -t pyemd-perf -f perf_test/Dockerfile .

PyEMD/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import logging
22

3-
__version__ = "1.8.1"
3+
__version__ = "1.9.0"
44
logger = logging.getLogger("pyemd")
55

66
from PyEMD.CEEMDAN import CEEMDAN # noqa

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ Python implementation of the Empirical Mode
1818
Decomposition (EMD). The package contains multiple EMD variations and
1919
intends to deliver more in time.
2020

21+
### Recent changes
22+
23+
- \[2025-11 v1.9\] Migrate to `uv` and `nox` for builds and tests
24+
- \[2025-11 v1.8\] Performance boost of 18% to the core EMD
25+
2126
### EMD variations
2227

2328
- Ensemble EMD (EEMD),

noxfile.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import nox
2+
3+
# Use uv for faster dependency installation and Python version management
4+
nox.options.default_venv_backend = "uv"
5+
6+
# Test against all currently supported Python versions (3.10+)
7+
PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13"]
8+
9+
10+
@nox.session(python=PYTHON_VERSIONS)
11+
def tests(session: nox.Session) -> None:
12+
"""Run the test suite across Python versions."""
13+
session.install(".[test]")
14+
session.run("python", "-m", "PyEMD.tests.test_all")
15+
16+
17+
@nox.session(python=PYTHON_VERSIONS)
18+
def tests_pytest(session: nox.Session) -> None:
19+
"""Run the test suite with pytest across Python versions."""
20+
session.install(".[test]")
21+
session.run("pytest", "PyEMD/tests/", "-v")
22+
23+
24+
@nox.session(python=PYTHON_VERSIONS[-1]) # Latest Python only
25+
def lint(session: nox.Session) -> None:
26+
"""Run linting checks."""
27+
session.install(".[dev]")
28+
session.run("isort", "--check", "PyEMD")
29+
session.run("black", "--check", "PyEMD", "doc", "example")
30+
31+
32+
@nox.session(python=PYTHON_VERSIONS[-1]) # Latest Python only
33+
def typecheck(session: nox.Session) -> None:
34+
"""Run type checking (if mypy is added later)."""
35+
session.install(".", "mypy")
36+
session.run("mypy", "PyEMD", "--ignore-missing-imports")

pyproject.toml

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,59 @@
11
[build-system]
2-
requires = [
3-
"setuptools>=58",
4-
"wheel",
2+
requires = ["setuptools>=61", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "EMD-signal"
7+
dynamic = ["version"]
8+
description = "Implementation of the Empirical Mode Decomposition (EMD) and its variations"
9+
readme = "README.md"
10+
license = "Apache-2.0"
11+
authors = [{ name = "Dawid Laszuk", email = "[email protected]" }]
12+
keywords = ["signal", "decomposition", "data", "analysis"]
13+
classifiers = [
14+
"Intended Audience :: Information Technology",
15+
"Intended Audience :: Science/Research",
16+
"Topic :: Scientific/Engineering",
17+
"Topic :: Scientific/Engineering :: Information Analysis",
18+
"Topic :: Scientific/Engineering :: Mathematics",
19+
]
20+
requires-python = ">=3.9"
21+
dependencies = [
22+
"numpy>=1.12",
23+
"scipy>=0.19",
24+
"pathos>=0.2.1",
25+
"tqdm>=4.64.0,<5.0",
26+
]
27+
28+
[project.optional-dependencies]
29+
doc = [
30+
"sphinx",
31+
"sphinx_rtd_theme",
32+
"numpydoc",
33+
]
34+
jit = [
35+
"numba>=0.62.0; python_version>='3.10'",
36+
]
37+
dev = [
38+
"pycodestyle==2.11.*",
39+
"black==25.11.*",
40+
"isort==5.12.*",
41+
"nox",
542
]
43+
test = [
44+
"pytest",
45+
"codecov",
46+
]
47+
48+
[project.urls]
49+
Homepage = "https://github.com/laszukdawid/PyEMD"
50+
Repository = "https://github.com/laszukdawid/PyEMD"
51+
52+
[tool.setuptools.dynamic]
53+
version = { attr = "PyEMD.__version__" }
54+
55+
[tool.setuptools.packages.find]
56+
include = ["PyEMD*"]
657

758
[tool.black]
859
line-length = 120
@@ -12,4 +63,8 @@ line_length = 120
1263
profile = "black"
1364

1465
[tool.ruff]
15-
line-length = 120
66+
line-length = 120
67+
68+
[tool.pycodestyle]
69+
max-line-length = 120
70+
ignore = ["E203", "W503", "W605"]

requirements-dev.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This file was autogenerated by uv via the following command:
2+
# uv export --no-hashes --only-dev --no-emit-project -o requirements-dev.txt

requirements-extra.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

requirements.txt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
numpy>=1.12
2-
scipy>=0.19
3-
pathos>=0.2.1
4-
tqdm>=4.64.0,<5.0
1+
# This file was autogenerated by uv via the following command:
2+
# uv export --no-hashes --no-dev --no-emit-project -o requirements.txt
3+
colorama==0.4.6 ; sys_platform == 'win32'
4+
dill==0.4.0
5+
multiprocess==0.70.18
6+
numpy==2.2.6 ; python_full_version < '3.11'
7+
numpy==2.3.5 ; python_full_version >= '3.11'
8+
pathos==0.3.4
9+
pox==0.3.6
10+
ppft==1.7.7
11+
scipy==1.15.3 ; python_full_version < '3.11'
12+
scipy==1.16.3 ; python_full_version >= '3.11'
13+
tqdm==4.67.1

setup.cfg

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)