Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 06 Apr 2026 17:55:51 +0000
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 57c1235513b9 - main - math/py-keras: update 3.1=?utf-8?Q?2.0 =E2=86=92?= 3.14.0
Message-ID:  <69d3f3a7.2260b.8d2f738@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=57c1235513b9043c56f7fa174726d8d4c6ff41fe

commit 57c1235513b9043c56f7fa174726d8d4c6ff41fe
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2026-04-06 16:24:32 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2026-04-06 17:55:47 +0000

    math/py-keras: update 3.12.0 → 3.14.0
---
 math/py-keras/Makefile                   | 21 ++++++++++-------
 math/py-keras/distinfo                   |  6 ++---
 math/py-keras/files/patch-pyproject.toml |  2 +-
 math/py-keras/files/test-simple-1.py     | 40 ++++++++++++++++++++++++++++++++
 math/py-keras/pkg-descr                  |  9 +++++--
 5 files changed, 64 insertions(+), 14 deletions(-)

diff --git a/math/py-keras/Makefile b/math/py-keras/Makefile
index f14617d74dfb..d88d2baf72c0 100644
--- a/math/py-keras/Makefile
+++ b/math/py-keras/Makefile
@@ -1,28 +1,28 @@
 PORTNAME=	keras
-DISTVERSION=	3.12.0
-PORTREVISION=	1
+DISTVERSION=	3.14.0
 CATEGORIES=	math python # machine-learning
 MASTER_SITES=	PYPI
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
 
 MAINTAINER=	yuri@FreeBSD.org
 COMMENT=	Multi-backend deep learning library for Python
-WWW=		https://keras.io/
+WWW=		https://keras.io/ \
+		https://github.com/keras-team/keras
 
 LICENSE=	APACHE20
 
 BUILD_DEPENDS=	${PY_SETUPTOOLS} \
 		${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR}
-RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}numpy1>=1.16:math/py-numpy1@${PY_FLAVOR} \
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}numpy1>0:math/py-numpy1@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}absl-py>0:devel/py-absl-py@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}h5py>0:science/py-h5py@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}ml-dtypes>0:math/py-ml-dtypes@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}namex>0:devel/py-namex@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}optree>0:devel/py-optree@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}packaging>0:devel/py-packaging@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}rich>0:textproc/py-rich@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}tensorflow>=2.12.0:science/py-tensorflow@${PY_FLAVOR}
-RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}scipy>=1.0:science/py-scipy@${PY_FLAVOR}
+		${PYTHON_PKGNAMEPREFIX}rich>0:textproc/py-rich@${PY_FLAVOR}
+RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}scipy>=1.0:science/py-scipy@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}tensorflow>0:science/py-tensorflow@${PY_FLAVOR}
 
 # Extra dependencies for optional backends (jax, torch)
 # openvino backend not available as FreeBSD port
@@ -30,8 +30,13 @@ EXTRA_DEPENDS=	${PYTHON_PKGNAMEPREFIX}jax>0:math/py-jax@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}pytorch>0:misc/py-pytorch@${PY_FLAVOR}
 
 USES=		python
-USE_PYTHON=	autoplist concurrent pep517
+USE_PYTHON=	pep517 concurrent autoplist
 
 NO_ARCH=	yes
 
+TEST_ENV=	${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
+
+test-simple:
+	${SETENV} ${TEST_ENV} ${PYTHON_CMD} ${FILESDIR}/test-simple-1.py
+
 .include <bsd.port.mk>
diff --git a/math/py-keras/distinfo b/math/py-keras/distinfo
index 71f79dad70e0..82113b540b66 100644
--- a/math/py-keras/distinfo
+++ b/math/py-keras/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1730473740
-SHA256 (keras-3.12.0.tar.gz) = 536e3f8385a05ae04e82e08715a1a59988578087e187b04cb0a6fad11743f07f
-SIZE (keras-3.12.0.tar.gz) = 1129187
+TIMESTAMP = 1775491282
+SHA256 (keras-3.14.0.tar.gz) = 86fcf8249a25264a566ac393c287c7ad657000e5e62615dcaad4b3472a17aeda
+SIZE (keras-3.14.0.tar.gz) = 1263098
diff --git a/math/py-keras/files/patch-pyproject.toml b/math/py-keras/files/patch-pyproject.toml
index 16e73477ceb8..66dceeb8110c 100644
--- a/math/py-keras/files/patch-pyproject.toml
+++ b/math/py-keras/files/patch-pyproject.toml
@@ -5,7 +5,7 @@
  requires-python = ">=3.10"
  license = {text = "Apache License 2.0"}
 -dynamic = ["version"]
-+version = "3.12.0"
++version = "3.14.0"
  classifiers = [
      "Development Status :: 4 - Beta",
      "Programming Language :: Python :: 3",
diff --git a/math/py-keras/files/test-simple-1.py b/math/py-keras/files/test-simple-1.py
new file mode 100644
index 000000000000..2f273a263e7c
--- /dev/null
+++ b/math/py-keras/files/test-simple-1.py
@@ -0,0 +1,40 @@
+from keras.models import Sequential
+from keras.layers import Dense
+import numpy as np
+
+# 1. Generate dummy data (replace with your actual data)
+# For binary classification, let's create a simple dataset
+X = np.random.rand(100, 5)  # 100 samples, 5 features
+y = (X.sum(axis=1) > 2.5).astype(int) # Binary labels based on feature sum
+
+# 2. Define the Keras Sequential model
+model = Sequential()
+
+# Add a Dense (fully connected) hidden layer
+# 12 nodes, 'relu' activation, input_shape specifies the number of features in your input
+model.add(Dense(12, input_shape=(5,), activation='relu'))
+
+# Add another Dense hidden layer
+model.add(Dense(8, activation='relu'))
+
+# Add the output layer
+# 1 node for binary classification, 'sigmoid' activation for probabilities
+model.add(Dense(1, activation='sigmoid'))
+
+# 3. Compile the Keras model
+# 'adam' optimizer is a good general-purpose optimizer
+# 'binary_crossentropy' is suitable for binary classification
+# 'accuracy' is a common metric to monitor during training
+model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])
+
+# 4. Train the model
+# epochs: number of times to iterate over the entire dataset
+# batch_size: number of samples per gradient update
+model.fit(X, y, epochs=50, batch_size=32, verbose=0) # verbose=0 suppresses training output
+
+# 5. Evaluate the model (optional)
+loss, accuracy = model.evaluate(X, y, verbose=0)
+print(f"Model Loss: {loss:.4f}, Accuracy: {accuracy:.4f}")
+
+# 6. Make predictions (optional)
+predictions = model.predict(X)
diff --git a/math/py-keras/pkg-descr b/math/py-keras/pkg-descr
index 6a2f8f1c0594..41e0b7ca519b 100644
--- a/math/py-keras/pkg-descr
+++ b/math/py-keras/pkg-descr
@@ -1,2 +1,7 @@
-Deep Learning library for Python. Convnets, recurrent neural networks, and
-more. Runs on Theano, TensorFlow, JAX, OpenVino.
+Keras is a high-level, multi-backend deep learning API that allows you
+to run the same code on JAX, PyTorch, or TensorFlow.
+
+It is designed for human beings, not machines. Keras follows best
+practices for reducing cognitive load: it offers consistent & simple
+APIs, it minimizes the number of user actions required for common use
+cases, and it provides clear & actionable error messages.


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69d3f3a7.2260b.8d2f738>