py-simpy: New package (#43497)

* pypi build of py-simpy

* [py-simpy] toml explicitly called out

* py-simpy: New version

* py-setuptools-scm: Added new version

* py-setuptools-scm: add url_for_version

Because versions @:7 have an underscore (setuptools_scm) in the URL, and
newer versions have a dash (setuptools-scm).

* py-setuptools-scm: fix flake8 line too long

* py-simpy: Fix hash

---------

Co-authored-by: Sid Pendelberry <sid@rit.edu>
Co-authored-by: Jen Herting <jen@herting.cc>
This commit is contained in:
Alex Leute 2024-05-01 14:06:52 -04:00 committed by GitHub
parent 0d8900986d
commit 38c49d6b82
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 31 additions and 0 deletions

View file

@ -15,6 +15,7 @@ class PySetuptoolsScm(PythonPackage):
license("MIT")
version("8.0.4", sha256="b5f43ff6800669595193fd09891564ee9d1d7dcb196cab4b2506d53a2e1c95c7")
version("7.1.0", sha256="6c508345a771aad7d56ebff0e70628bf2b0ec7573762be9960214730de278f27")
version("7.0.5", sha256="031e13af771d6f892b941adb6ea04545bbf91ebc5ce68c78aaf3fff6e1fb4844")
version("7.0.3", sha256="cf8ab8e235bed840cd4559b658af0d8e8a70896a191bbc510ee914ec5325332d")
@ -36,6 +37,7 @@ class PySetuptoolsScm(PythonPackage):
depends_on("python@2.7:2.8,3.4:", type=("build", "run"))
depends_on("py-packaging@20.0:", when="@6.3:", type=("build", "run"))
depends_on("py-setuptools@61:", when="@8:", type=("build", "run"))
depends_on("py-setuptools@45:", when="@6:", type=("build", "run"))
depends_on("py-setuptools@42:", when="@5:", type=("build", "run"))
depends_on("py-setuptools@34.4:", type=("build", "run"))
@ -47,3 +49,11 @@ class PySetuptoolsScm(PythonPackage):
depends_on("py-importlib-metadata", when="@7: ^python@:3.7", type=("build", "run"))
depends_on("git", type=("build", "run"))
def url_for_version(self, version):
# setuptools_scm-7.1.0.tar.gz with an underscore became
# setuptools-scm-8.0.4.tar.gz with a dash
url = super().url_for_version(version)
if version >= Version(8):
return url.replace("_", "-")
return url

View file

@ -0,0 +1,21 @@
# 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 PySimpy(PythonPackage):
"""SimPy is a process-based discrete-event simulation framework based on standard Python."""
homepage = "https://simpy.readthedocs.io/"
pypi = "simpy/simpy-4.0.2.tar.gz"
version("4.1.1", sha256="06d0750a7884b11e0e8e20ce0bc7c6d4ed5f1743d456695340d13fdff95001a6")
version("4.0.2", sha256="6d8adc0229df6b02fb7e26dcd1338703b4f4f63f167a5ac2a7213cb80aba4484")
depends_on("py-setuptools@42:", type="build", when="@4.0.2")
depends_on("py-setuptools@64:", type="build", when="@4.1.1:")
depends_on("py-setuptools-scm@3.4:+toml", type="build", when="@4.0.2")
depends_on("py-setuptools-scm@8.0:+toml", type="build", when="@4.1.1:")