From 2a19f2ae44741c046e88525305fe60227252ccfc Mon Sep 17 00:00:00 2001 From: Nick Altmann Date: Thu, 7 Nov 2024 20:30:43 +0000 Subject: [PATCH] Add `rateslib` to packages (#5146) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> --- packages/rateslib/meta.yaml | 23 +++++++++++++++++++++++ packages/rateslib/test_rateslib.py | 17 +++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 packages/rateslib/meta.yaml create mode 100644 packages/rateslib/test_rateslib.py diff --git a/packages/rateslib/meta.yaml b/packages/rateslib/meta.yaml new file mode 100644 index 00000000000..0df2e18ebf8 --- /dev/null +++ b/packages/rateslib/meta.yaml @@ -0,0 +1,23 @@ +package: + name: rateslib + version: 1.5.0 + top-level: + - rateslib +source: + url: https://files.pythonhosted.org/packages/02/d7/7695bb1b6a240ecfae77804d3fc242e30582fd83973f76dda03b23d921a6/rateslib-1.5.0.tar.gz + sha256: 7c7af2707f20974a70403689f84905757a4ed084e4c92229388d2fc30b331b04 +requirements: + run: + - numpy + - pandas + - matplotlib + executable: + - rustup +about: + home: https://github.com/attack68/rateslib + PyPI: https://pypi.org/project/rateslib + summary: A fixed income library for trading interest rates + license: CC-BY-NC-ND-4.0 +extra: + recipe-maintainers: + - NickAltmann diff --git a/packages/rateslib/test_rateslib.py b/packages/rateslib/test_rateslib.py new file mode 100644 index 00000000000..d352dd28177 --- /dev/null +++ b/packages/rateslib/test_rateslib.py @@ -0,0 +1,17 @@ +import pytest +from pytest_pyodide import run_in_pyodide + + +@pytest.mark.driver_timeout(60) +@run_in_pyodide(packages=["rateslib"]) +def test_add_tenor(selenium): + import datetime + + import rateslib as rl + + start_date = datetime.datetime(2024, 10, 29) + end_date = datetime.datetime(2024, 10, 31) + + test_date = rl.add_tenor(start_date, "2b", "F", "nyc") + + assert end_date == test_date