diff --git a/pyproject.toml b/pyproject.toml index 2386ef12..67cd0b43 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ dev = [ "coverage>=7.6.1,<8.0", # style/linting "ruff>=0.6.3,<1.0", - "mypy>=1.13,<1.18", + "mypy>=1.13,<1.20", "pandas-stubs>2.0,<3.0", # doc building "sphinx>=8.0,<8.2", diff --git a/python/rateslib/data/fixings.py b/python/rateslib/data/fixings.py index 0cfed727..eaa3bd29 100644 --- a/python/rateslib/data/fixings.py +++ b/python/rateslib/data/fixings.py @@ -2431,7 +2431,7 @@ def _maybe_get_rate_series_from_curve( return rate_series -def _leg_fixings_to_list(rate_fixings: LegFixings, n_periods: int) -> list[PeriodFixings]: # type: ignore[type-var] +def _leg_fixings_to_list(rate_fixings: LegFixings, n_periods: int) -> list[PeriodFixings]: """Perform a conversion of 'LegRateFixings' into a list of PeriodFixings.""" if isinstance(rate_fixings, NoInput): # NoInput is converted to a list of NoInputs diff --git a/python/rateslib/instruments/bonds/float_rate_note.py b/python/rateslib/instruments/bonds/float_rate_note.py index 755c6f87..b9abc992 100644 --- a/python/rateslib/instruments/bonds/float_rate_note.py +++ b/python/rateslib/instruments/bonds/float_rate_note.py @@ -191,7 +191,7 @@ def __init__( # rate params float_spread: DualTypes_ = NoInput(0), spread_compound_method: str_ = NoInput(0), - rate_fixings: LegFixings = NoInput(0), # type: ignore[type-var] + rate_fixings: LegFixings = NoInput(0), fixing_method: str_ = NoInput(0), method_param: int_ = NoInput(0), fixing_frequency: Frequency | str_ = NoInput(0), diff --git a/python/rateslib/instruments/bonds/index_fixed_rate_bond.py b/python/rateslib/instruments/bonds/index_fixed_rate_bond.py index fd052ffd..bb27eff2 100644 --- a/python/rateslib/instruments/bonds/index_fixed_rate_bond.py +++ b/python/rateslib/instruments/bonds/index_fixed_rate_bond.py @@ -198,7 +198,7 @@ def __init__( index_base: DualTypes_ = NoInput(0), index_lag: int_ = NoInput(0), index_method: IndexMethod | str_ = NoInput(0), - index_fixings: LegFixings = NoInput(0), # type: ignore[type-var] + index_fixings: LegFixings = NoInput(0), # rate parameters fixed_rate: DualTypes_ = NoInput(0), # meta parameters diff --git a/python/rateslib/instruments/fra.py b/python/rateslib/instruments/fra.py index 9004eda9..2df09761 100644 --- a/python/rateslib/instruments/fra.py +++ b/python/rateslib/instruments/fra.py @@ -309,7 +309,7 @@ def __init__( notional: DualTypes_ = NoInput(0), # rate parameters fixed_rate: DualTypes_ = NoInput(0), - leg2_rate_fixings: FixingsRates_ = NoInput(0), # type: ignore[type-var] + leg2_rate_fixings: FixingsRates_ = NoInput(0), leg2_method_param: int_ = NoInput(0), leg2_fixing_frequency: Frequency | str_ = NoInput(0), leg2_fixing_series: FloatRateSeries | str_ = NoInput(0), diff --git a/python/rateslib/instruments/iirs.py b/python/rateslib/instruments/iirs.py index 6b507595..7a7e1b71 100644 --- a/python/rateslib/instruments/iirs.py +++ b/python/rateslib/instruments/iirs.py @@ -308,12 +308,12 @@ def __init__( index_base: DualTypes_ = NoInput(0), index_lag: int_ = NoInput(0), index_method: IndexMethod | str_ = NoInput(0), - index_fixings: LegFixings = NoInput(0), # type: ignore[type-var] + index_fixings: LegFixings = NoInput(0), # rate params fixed_rate: DualTypes_ = NoInput(0), leg2_float_spread: DualTypes_ = NoInput(0), leg2_spread_compound_method: str_ = NoInput(0), - leg2_rate_fixings: FixingsRates_ = NoInput(0), # type: ignore[type-var] + leg2_rate_fixings: FixingsRates_ = NoInput(0), leg2_fixing_method: str_ = NoInput(0), leg2_method_param: int_ = NoInput(0), # meta params diff --git a/python/rateslib/instruments/irs.py b/python/rateslib/instruments/irs.py index 5280280f..1414b914 100644 --- a/python/rateslib/instruments/irs.py +++ b/python/rateslib/instruments/irs.py @@ -294,7 +294,7 @@ def __init__( fixed_rate: DualTypes_ = NoInput(0), leg2_float_spread: DualTypes_ = NoInput(0), leg2_spread_compound_method: str_ = NoInput(0), - leg2_rate_fixings: FixingsRates_ = NoInput(0), # type: ignore[type-var] + leg2_rate_fixings: FixingsRates_ = NoInput(0), leg2_fixing_method: str_ = NoInput(0), leg2_method_param: int_ = NoInput(0), leg2_fixing_frequency: Frequency | str_ = NoInput(0), diff --git a/python/rateslib/instruments/ndf.py b/python/rateslib/instruments/ndf.py index 828e0981..2a5279b6 100644 --- a/python/rateslib/instruments/ndf.py +++ b/python/rateslib/instruments/ndf.py @@ -223,7 +223,7 @@ def __init__( eom: bool_ = NoInput(0), # rate fx_rate: DualTypes_ = NoInput(0), - fx_fixings: PeriodFixings = NoInput(0), # type: ignore[type-var] + fx_fixings: PeriodFixings = NoInput(0), leg2_fx_fixings: PeriodFixings = NoInput(0), reversed: bool = False, # noqa: A002 leg2_reversed: bool = False, diff --git a/python/rateslib/instruments/sbs.py b/python/rateslib/instruments/sbs.py index 15d65168..368c2dae 100644 --- a/python/rateslib/instruments/sbs.py +++ b/python/rateslib/instruments/sbs.py @@ -306,7 +306,7 @@ def __init__( # rate parameters float_spread: DualTypes_ = NoInput(0), spread_compound_method: str_ = NoInput(0), - rate_fixings: LegFixings = NoInput(0), # type: ignore[type-var] + rate_fixings: LegFixings = NoInput(0), fixing_method: str_ = NoInput(0), method_param: int_ = NoInput(0), fixing_frequency: Frequency | str_ = NoInput(0), diff --git a/python/rateslib/instruments/stir_future.py b/python/rateslib/instruments/stir_future.py index 7b95e6a0..7a2d0579 100644 --- a/python/rateslib/instruments/stir_future.py +++ b/python/rateslib/instruments/stir_future.py @@ -314,7 +314,7 @@ def __init__( price: DualTypes_ = NoInput(0), leg2_float_spread: DualTypes_ = NoInput(0), leg2_spread_compound_method: str_ = NoInput(0), - leg2_rate_fixings: FixingsRates_ = NoInput(0), # type: ignore[type-var] + leg2_rate_fixings: FixingsRates_ = NoInput(0), leg2_fixing_method: str_ = NoInput(0), leg2_method_param: int_ = NoInput(0), leg2_fixing_frequency: Frequency | str_ = NoInput(0), diff --git a/python/rateslib/instruments/xcs.py b/python/rateslib/instruments/xcs.py index aa431e18..9f65746b 100644 --- a/python/rateslib/instruments/xcs.py +++ b/python/rateslib/instruments/xcs.py @@ -454,12 +454,12 @@ def __init__( fixed_rate: DualTypes_ = NoInput(0), float_spread: DualTypes_ = NoInput(0), spread_compound_method: str_ = NoInput(0), - rate_fixings: FixingsRates_ = NoInput(0), # type: ignore[type-var] + rate_fixings: FixingsRates_ = NoInput(0), fixing_method: str_ = NoInput(0), method_param: int_ = NoInput(0), fixing_frequency: Frequency | str_ = NoInput(0), fixing_series: FloatRateSeries | str_ = NoInput(0), - fx_fixings: LegFixings = NoInput(0), # type: ignore[type-var] + fx_fixings: LegFixings = NoInput(0), leg2_fixed: bool = False, leg2_mtm: bool = False, leg2_fixed_rate: DualTypes_ = NoInput(0), diff --git a/python/rateslib/instruments/zcis.py b/python/rateslib/instruments/zcis.py index c0091c32..33fe73fc 100644 --- a/python/rateslib/instruments/zcis.py +++ b/python/rateslib/instruments/zcis.py @@ -238,7 +238,7 @@ def __init__( leg2_index_base: DualTypes_ = NoInput(0), leg2_index_lag: int_ = NoInput(0), leg2_index_method: IndexMethod | str_ = NoInput(0), - leg2_index_fixings: LegFixings = NoInput(0), # type: ignore[type-var] + leg2_index_fixings: LegFixings = NoInput(0), # meta parameters curves: CurvesT_ = NoInput(0), spec: str_ = NoInput(0), diff --git a/python/rateslib/instruments/zcs.py b/python/rateslib/instruments/zcs.py index 678bb5bc..752946b0 100644 --- a/python/rateslib/instruments/zcs.py +++ b/python/rateslib/instruments/zcs.py @@ -311,7 +311,7 @@ def __init__( fixed_rate: DualTypes_ = NoInput(0), leg2_float_spread: DualTypes_ = NoInput(0), leg2_spread_compound_method: str_ = NoInput(0), - leg2_rate_fixings: FixingsRates_ = NoInput(0), # type: ignore[type-var] + leg2_rate_fixings: FixingsRates_ = NoInput(0), leg2_fixing_method: str_ = NoInput(0), leg2_method_param: int_ = NoInput(0), leg2_fixing_frequency: Frequency | str_ = NoInput(0), diff --git a/python/rateslib/legs/fixed.py b/python/rateslib/legs/fixed.py index 3e699ee1..c1954f76 100644 --- a/python/rateslib/legs/fixed.py +++ b/python/rateslib/legs/fixed.py @@ -503,7 +503,7 @@ def __init__( currency: str_ = NoInput(0), # non-deliverable pair: str_ = NoInput(0), - fx_fixings: LegFixings = NoInput(0), # type: ignore[type-var] + fx_fixings: LegFixings = NoInput(0), mtm: bool = False, # period convention: str_ = NoInput(0), diff --git a/python/rateslib/legs/float.py b/python/rateslib/legs/float.py index f8a252a2..f21fc979 100644 --- a/python/rateslib/legs/float.py +++ b/python/rateslib/legs/float.py @@ -250,7 +250,7 @@ def __init__( currency: str_ = NoInput(0), # non-deliverable pair: str_ = NoInput(0), - fx_fixings: LegFixings = NoInput(0), # type: ignore[type-var] + fx_fixings: LegFixings = NoInput(0), mtm: bool = False, # period convention: str_ = NoInput(0), diff --git a/python/rateslib/periods/parameters/rate.py b/python/rateslib/periods/parameters/rate.py index 80ce26fb..ff09125d 100644 --- a/python/rateslib/periods/parameters/rate.py +++ b/python/rateslib/periods/parameters/rate.py @@ -47,7 +47,7 @@ def _init_FloatRateParams( _float_spread: DualTypes_, - _rate_fixings: PeriodFixings, # type: ignore[type-var] + _rate_fixings: PeriodFixings, _fixing_method: FloatFixingMethod | str_, _method_param: int_, _spread_compound_method: SpreadCompoundMethod | str_, diff --git a/requirements.txt b/requirements.txt index 8d10fd1e..466435cd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,7 +18,7 @@ nbsphinx>=0.9.5,<1.0 pickleshare>=0.7.5,<1.0 ruff>=0.11.0,<1.0 # for code linting -mypy>=1.16.0,<1.18 # for type checking +mypy>=1.16.0,<1.20 # for type checking pandas-stubs>=2.0,<3.0 jupyterlab>=4.0,<5.0