From 60d0cd1f210fdd4475a03760e8516accb1d2b07d Mon Sep 17 00:00:00 2001 From: Miranda Mundt <55767766+mrmundt@users.noreply.github.com> Date: Sat, 23 Dec 2023 13:41:45 -0700 Subject: py-pyomo: Update spec for newest major series (#41271) * Add enum34, numdifftools, and updated pyomo packages * Syntax error * Apply black style * Trying to get around Python spec issue * All SHAs were somehow wrong * Change enum version * Change optional dependencies to be on run, not build * Add Pyomo 6.7.0 * Update SHA and version mismatch * Remove py-enum34 * Add three new packages to address comments * Fix linting errors; move casadi to py-casadi * Update license; add in dependency * Update setuptools version * Update class name to python class * Remove other boielerplate stuff * Update homepage addresses; update py-casadi --- .../repos/builtin/packages/py-casadi/package.py | 20 ++++ .../builtin/packages/py-numdifftools/package.py | 23 +++++ .../repos/builtin/packages/py-pyomo/package.py | 107 +++++++++++++++++++-- .../repos/builtin/packages/py-pywin32/package.py | 19 ++++ .../repos/builtin/packages/py-z3-solver/package.py | 20 ++++ 5 files changed, 180 insertions(+), 9 deletions(-) create mode 100644 var/spack/repos/builtin/packages/py-casadi/package.py create mode 100644 var/spack/repos/builtin/packages/py-numdifftools/package.py create mode 100644 var/spack/repos/builtin/packages/py-pywin32/package.py create mode 100644 var/spack/repos/builtin/packages/py-z3-solver/package.py diff --git a/var/spack/repos/builtin/packages/py-casadi/package.py b/var/spack/repos/builtin/packages/py-casadi/package.py new file mode 100644 index 0000000000..ed536fcb5f --- /dev/null +++ b/var/spack/repos/builtin/packages/py-casadi/package.py @@ -0,0 +1,20 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyCasadi(PythonPackage): + """CasADi -- framework for algorithmic differentiation and numeric optimization""" + + homepage = "https://web.casadi.org/" + pypi = "casadi/casadi-3.6.4.tar.gz" + + license("LGPL") + + version("3.6.4", sha256="affdca1a99c14580992cdf34d247754b7d851080b712c2922ad2e92442eeaa35") + + depends_on("py-setuptools", type="build") + depends_on("py-numpy", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-numdifftools/package.py b/var/spack/repos/builtin/packages/py-numdifftools/package.py new file mode 100644 index 0000000000..a6933edbcf --- /dev/null +++ b/var/spack/repos/builtin/packages/py-numdifftools/package.py @@ -0,0 +1,23 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +from spack.package import * + + +class PyNumdifftools(PythonPackage): + """Solves automatic numerical differentiation problems in one or more + variables.""" + + homepage = "https://github.com/pbrod/numdifftools" + pypi = "numdifftools/numdifftools-0.9.41.tar.gz" + + version("0.9.41", sha256="4ef705cd3c06211b3a4e9fd05ad622be916dcfda40732f0128805a2c4be389b4") + + depends_on("python@3.7:", type=("build", "run")) + + depends_on("py-setuptools@39.2:", type="build") + depends_on("py-numpy@1.9:", type=("build", "run")) + depends_on("py-scipy@0.8:", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-pyomo/package.py b/var/spack/repos/builtin/packages/py-pyomo/package.py index 2c688e9d07..98a15c6863 100644 --- a/var/spack/repos/builtin/packages/py-pyomo/package.py +++ b/var/spack/repos/builtin/packages/py-pyomo/package.py @@ -11,17 +11,106 @@ class PyPyomo(PythonPackage): diverse set of optimization capabilities for formulating and analyzing optimization models.""" - homepage = "https://github.com/Pyomo/pyomo" - url = "https://github.com/Pyomo/pyomo/archive/5.6.6.tar.gz" + homepage = "https://www.pyomo.org/" + pypi = "Pyomo/Pyomo-5.6.6.tar.gz" + git = "https://github.com/Pyomo/pyomo.git" - version("5.6.6", sha256="9330956b9fb244351ce76aaaf88688b5bdd03eebb122020cbee7b46e198a4110") + # Maintainer accurate as of 11/21/2023 + maintainers("mrmundt") - depends_on("python@2.7:2.9,3.4:", type=("build", "run")) + version("6.7.0", sha256="a245ec609ef2fd907269f0b8e0923f74d5bf868b2ec0e62bf2a30b3f253bd17b") + version("6.6.2", sha256="c8ad55213ff8b1a2c4e469110db8079722d5a6f364c6c46a42e2f750fc9e4d26") + version("6.6.1", sha256="3fb0aba7b0f4120e6ce0f242502c0e61478d61e326bc90b7dc392bbefd114b34") + version("6.6.0", sha256="8766c08041b8d91fbc5166d220c9e723fed6057d18be1178bae3b6583376c65e") + version("6.5.0", sha256="5a23e775bba9fdbad22698fa1a841e662482edc979f2dea41cc6c54b1bb4b968") + version("6.4.4", sha256="922dd8e6e3e421550acf884bd27f74cab2fe6552cdde36715d116b0c8345c367") + version("6.4.3", sha256="7f3f67f61a6e5c2dd9c4dd930356d3176bad1572f1abee780592e725d6445288") + version("6.4.2", sha256="6f5a867e77bdd6ac2ba0da5d4a251e38543ae05eba5a0c5cf8ab39e7fa8e1ea9") + version("6.4.1", sha256="a636a3a1c8314b8be85899cb6fac5d6a9a78fc75c6d58b74d3ec106ae5ed8f59") + version("6.4.0", sha256="b548825301b6bd4073a0620a8265d956153d53c12fca37cc7184fa54fce96222") + version("6.3.0", sha256="b4df6305438a2b6ec75bd2e1588b919feb97089ed179a944b334432723781f81") + version("6.2", sha256="89bc69a9a0afe10f5d229abe508b04ebbd3d2e213aa6c8ec2db2562798fa0400") + version("6.1.2", sha256="f2a58977c3c72e706aef7ab7d016bdf66df85df8ea5b25cc0ba387e2cef880bb") + version("6.1.1", sha256="32f378fda748ff299b4492b12b04ed1d8b11c857117fa0e5e6b609aa322fcade") + version("6.1", sha256="7d087b186a43b2ffd032bc4db87cdbcf2fdc187607211f3e6cdc0f54b6f516f4") + version("6.0.1", sha256="4b27bc917b12a6011e7eb3442a54619f0f42f1087d4defa14b903dd985fdbe7c") + version("6.0", sha256="3dbfb1c7a8ef76dfd99d82c211845cdba9bf31a179269b57b6b28ad635ae34f9") + version("5.7.3", sha256="2c4697107477a1b9cc9dad534d8f9c2dc6ee397c47ad44113e257732b83cfc8f") + version("5.7.2", sha256="f10ada18ade84b16225dc519ef1788dd6d5f22cb22d0ea44db64c96d14cb7bb0") + version("5.7.1", sha256="1228204d7eb4cdd217fed6323a7434de68e89a2aaa74085ea47f1b42fb64d8cd") + version("5.7", sha256="27e3a3c8411de9bc52e5e6aa88e9a0de0dd7369126bc905996e23057775905d7") + version("5.6.9", sha256="17bc3c15b405e3ba3a3b7cf9bf3867f6b8e57b611c8ecfdd43fd802587ee8bc6") + version("5.6.8", sha256="28cbe034b06a477053616a3ce5ef43149bfd7d025cac490c2a3dd006c388b60d") + version("5.6.7", sha256="fc97cc9d5a55c5185358ba65c1f9530c9af17e67a9aae7b36c3414f159030ae0") + version("5.6.6", sha256="813e14a604b9d3ac63bdd0880c07f5f4e1b8f0a8a10345f1b42bee762219c001") - depends_on("py-setuptools", type="build") - depends_on("py-cython", type="build") + variant("cython", default=False, description="Enable cythonization of Pyomo.") + variant("tests", default=False, description="Install testing dependencies.", when="@6.1:") + variant( + "docs", default=False, description="Install docs generation dependencies.", when="@6.1:" + ) + variant("optional", default=False, description="Install optional dependencies.", when="@6.1:") - depends_on("py-appdirs", type=("build", "run")) - depends_on("py-pyutilib@5.7.1:", type=("build", "run")) + # python_requires + depends_on("python@3.8:3.12", when="@6.7:", type=("build", "run")) + depends_on("python@3.7:3.11", when="@6.4:6.6", type=("build", "run")) + depends_on("python@3.6:3.10", when="@6.3", type=("build", "run")) + depends_on("python@3.6:3.9", when="@6.0:6.2", type=("build", "run")) + depends_on("python@2.7:2.8,3.4:3.9", when="@5.7", type=("build", "run")) + depends_on("python@2.7:2.8,3.4:3.8", when="@5.6", type=("build", "run")) + + # universally required + depends_on("py-setuptools@39.2:", type="build") depends_on("py-ply", type=("build", "run")) - depends_on("py-six@1.4:", type=("build", "run")) + + # required for pre-6 series + depends_on("py-pyutilib@6.0.0", when="@5", type=("build", "run")) + depends_on("py-six@1.4:", when="@5", type=("build", "run")) + depends_on("py-appdirs", when="@5.6:5.7.0", type=("build", "run")) + + # when cython is requested + depends_on("py-cython", when="+cython", type="build") + + # when tests is requested + depends_on("py-coverage", when="@6.1:+tests", type=("run")) + depends_on("py-nose", when="@6.1:6.2+tests", type=("run")) + depends_on("py-pytest", when="@6.3:+tests", type=("run")) + depends_on("py-pytest-parallel", when="@6.3:+tests", type=("run")) + depends_on("py-parameterized", when="@6.1:+tests", type=("run")) + depends_on("py-pybind11", when="@6.1:+tests", type=("run")) + + # when docs is requested + depends_on("py-sphinx@4:", when="@6.1:+docs", type=("run")) + depends_on("py-sphinx-copybutton", when="@6.1:+docs", type=("run")) + depends_on("py-sphinx-rtd-theme@0.5:", when="@6.1:+docs", type=("run")) + depends_on("py-sphinxcontrib-jsmath", when="@6.1:+docs", type=("run")) + depends_on("py-sphinxcontrib-napoleon", when="@6.1:+docs", type=("run")) + depends_on("py-numpy", when="@6.1:+docs", type=("run")) + depends_on("py-scipy", when="@6.4.2:+docs", type=("run")) + + # when optional is requested + depends_on("py-dill", when="@6.1:+optional", type=("run")) + depends_on("py-ipython", when="@6.1:+optional", type=("run")) + depends_on("py-matplotlib@3.6.2:", when="@6.1:+optional", type=("run")) + depends_on("py-networkx", when="@6.1:+optional", type=("run")) + depends_on("py-numpy", when="@6.1:+optional", type=("run")) + depends_on("py-openpyxl", when="@6.1:+optional", type=("run")) + depends_on("py-pint", when="@6.1:+optional", type=("run")) + depends_on("py-plotly", when="@6.6:+optional", type=("run")) + depends_on("py-python-louvain", when="@6.1:+optional", type=("run")) + depends_on("py-pyyaml", when="@6.1:+optional", type=("run")) + depends_on("py-scipy", when="@6.1:+optional", type=("run")) + depends_on("py-sympy", when="@6.1:+optional", type=("run")) + depends_on("py-xlrd", when="@6.1:+optional", type=("run")) + depends_on("py-z3-solver", when="@6.1:+optional", type=("run")) + depends_on("py-pywin32", when="@6.1:+optional platform=windows", type=("run")) + depends_on("py-casadi", when="@6.1:+optional", type=("run")) + depends_on("py-numdifftools", when="@6.1:+optional", type=("run")) + depends_on("py-pandas", when="@6.1:+optional", type=("run")) + depends_on("py-seaborn", when="@6.1:+optional", type=("run")) + + def global_options(self, spec, prefix): + options = [] + if "+cython" in self.spec: + options.append("--with-cython") + return options diff --git a/var/spack/repos/builtin/packages/py-pywin32/package.py b/var/spack/repos/builtin/packages/py-pywin32/package.py new file mode 100644 index 0000000000..5fd774128b --- /dev/null +++ b/var/spack/repos/builtin/packages/py-pywin32/package.py @@ -0,0 +1,19 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyPywin32(PythonPackage): + """Python for Window Extensions.""" + + homepage = "https://github.com/mhammond/pywin32" + url = "https://github.com/mhammond/pywin32/archive/refs/tags/b306.tar.gz" + + license("PSF-2.0") + + version("306", sha256="16e5ad3efbbf997080f67c3010bd4eb0067d499bbade9be1b240b7e85325c167") + + depends_on("py-setuptools", type="build") diff --git a/var/spack/repos/builtin/packages/py-z3-solver/package.py b/var/spack/repos/builtin/packages/py-z3-solver/package.py new file mode 100644 index 0000000000..59587b8857 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-z3-solver/package.py @@ -0,0 +1,20 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyZ3Solver(PythonPackage): + """Z3 is a theorem prover from Microsoft Research. It is licensed under the MIT license.""" + + homepage = "https://github.com/Z3Prover/z3" + pypi = "z3-solver/z3-solver-4.12.3.0.tar.gz" + + license("MIT") + + version("4.12.3.0", sha256="b6719daf9676711a8f1c708af0ea185578b0f22a3cb9bf9a55735e21691dc38d") + + depends_on("py-setuptools@46.4:", type="build") + depends_on("cmake", type="build") -- cgit v1.2.3-60-g2f50