py-line-profiler: Add 4.1.2 and 3.5.1 with their deps (#43156)

Co-authored-by: sbulut <sbulut@3vgeomatics.com>
Co-authored-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
This commit is contained in:
Sinan 2024-03-23 10:16:48 -07:00 committed by GitHub
parent 159e9a20d1
commit cd5bef6780
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 37 additions and 2 deletions

View file

@ -0,0 +1,24 @@
--- spack-src/timers.c.orig 2024-03-12 23:42:29.017345816 -0700
+++ spack-src/timers.c 2024-03-12 23:43:55.329454579 -0700
@@ -32,9 +32,6 @@
#else /* !MS_WINDOWS */
-#ifndef HAVE_GETTIMEOFDAY
-#error "This module requires gettimeofday() on non-Windows platforms!"
-#endif
#if (defined(PYOS_OS2) && defined(PYCC_GCC))
#include <sys/time.h>
@@ -48,11 +45,7 @@
{
struct timeval tv;
PY_LONG_LONG ret;
-#ifdef GETTIMEOFDAY_NO_TZ
- gettimeofday(&tv);
-#else
gettimeofday(&tv, (struct timezone *)NULL);
-#endif
ret = tv.tv_sec;
ret = ret * 1000000 + tv.tv_usec;
return ret;

View file

@ -11,18 +11,29 @@
class PyLineProfiler(PythonPackage):
"""Line-by-line profiler."""
homepage = "https://github.com/rkern/line_profiler"
homepage = "https://github.com/pyutils/line_profiler"
pypi = "line_profiler/line_profiler-2.0.tar.gz"
license("PSF-2.0")
version("4.1.2", sha256="aa56578b0ff5a756fe180b3fda7bd67c27bbd478b3d0124612d8cf00e4a21df2")
version("3.5.1", sha256="77400208bfbd5d4341938a9a3a4fb5194f5af7fc23b2d496c913755f8310e8b8")
version("2.1.2", sha256="efa66e9e3045aa7cb1dd4bf0106e07dec9f80bc781a993fbaf8162a36c20af5c")
version("2.0", sha256="739f8ad0e4bcd0cb82e99afc09e00a0351234f6b3f0b1f7f0090a8a2fbbf8381")
# see pyproject.toml
depends_on("python@2.5:", type=("build", "run"))
depends_on("python@:3.10", type=("build", "run"), when="@:3")
depends_on("py-setuptools", type="build")
depends_on("py-cython", type="build")
depends_on("py-setuptools@68.2.2", type="build", when="@4.1.2:")
depends_on("py-cython@0.29.24:2", type="build", when="@:4.1.1")
depends_on("py-cython@3.0.3:", type="build", when="@4.1.2:")
depends_on("py-ipython@0.13:", type=("build", "run"))
depends_on("cmake", type="build", when="@3")
depends_on("py-ninja", type="build", when="@3")
depends_on("py-scikit-build@0.9.0:", type="build", when="@3")
patch("gettimeofday_py39.patch", when="@:2.1.2 ^python@3.9:")
# See https://github.com/rkern/line_profiler/issues/166
@run_before("install")