From 8aaa9df47c47fb59ba816969641e063d0b495a7d Mon Sep 17 00:00:00 2001 From: Marcus Read Date: Wed, 31 Jan 2024 13:48:00 +0000 Subject: [PATCH] Updates dependencies Preemptively constrains numpy dependency to <2 in anticipation of breaking changes with the upcoming major release 2.0. (make changes to accommodate numpy 2.0 post its release, keep `exchange_calendars` working in the meantme). Removes `python-dateutil` from pyproject.toml dependencies (library is a dependency of `pandas`, not a direct dependency of `exchange_calendars`). Also, fixes #355 by removing superfluous kwarg from call in `ecal` to `pd.date_range`. --- .github/workflows/benchmark.yml | 2 +- etc/ecal | 17 ++++++----------- etc/requirements.txt | 12 +++++------- etc/requirements_dev.txt | 22 ++++++++++------------ etc/requirements_minpandas.txt | 21 ++++++++++----------- pyproject.toml | 3 +-- 6 files changed, 33 insertions(+), 44 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index b9573d67..580d0bea 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -23,7 +23,7 @@ jobs: run: | pytest etc/bench.py --benchmark-json output.json - name: Download previous benchmark data - uses: actions/cache@v3.3.3 + uses: actions/cache@v4.0.0 with: path: ./cache key: ${{ runner.os }}-benchmark diff --git a/etc/ecal b/etc/ecal index 7b402866..1f3e20c4 100755 --- a/etc/ecal +++ b/etc/ecal @@ -1,8 +1,12 @@ #!/usr/bin/env python from __future__ import print_function +import io import sys +import pandas as pd + + months = [ "January", "February", @@ -25,16 +29,7 @@ def error(msg): def _render_month(calendar, year, month, print_year): - import pandas as pd - - if sys.version_info[0] == 2: - import StringIO - - out = StringIO.StringIO() - else: - import io - - out = io.StringIO() + out = io.StringIO() start = "{year}-{month}".format(year=year, month=month) if month == 12: @@ -42,7 +37,7 @@ def _render_month(calendar, year, month, print_year): else: end = "{year}-{month}".format(year=year, month=month + 1) - days = pd.date_range(start, end, closed="left", tz='utc') + days = pd.date_range(start, end, tz="utc") title = months[month - 1] if print_year: diff --git a/etc/requirements.txt b/etc/requirements.txt index 563ded8f..f98e9bf3 100644 --- a/etc/requirements.txt +++ b/etc/requirements.txt @@ -6,23 +6,21 @@ # korean-lunar-calendar==0.3.1 # via exchange_calendars (pyproject.toml) -numpy==1.26.2 +numpy==1.26.3 # via # exchange_calendars (pyproject.toml) # pandas -pandas==2.1.4 +pandas==2.2.0 # via exchange_calendars (pyproject.toml) pyluach==2.2.0 # via exchange_calendars (pyproject.toml) python-dateutil==2.8.2 - # via - # exchange_calendars (pyproject.toml) - # pandas -pytz==2023.3.post1 + # via pandas +pytz==2023.4 # via pandas six==1.16.0 # via python-dateutil -toolz==0.12.0 +toolz==0.12.1 # via exchange_calendars (pyproject.toml) tzdata==2023.4 # via diff --git a/etc/requirements_dev.txt b/etc/requirements_dev.txt index 739619e5..036a20f9 100644 --- a/etc/requirements_dev.txt +++ b/etc/requirements_dev.txt @@ -21,9 +21,9 @@ exceptiongroup==1.2.0 # pytest execnet==2.0.2 # via pytest-xdist -flake8==6.1.0 +flake8==7.0.0 # via exchange_calendars (pyproject.toml) -hypothesis==6.92.2 +hypothesis==6.97.3 # via exchange_calendars (pyproject.toml) importlib-metadata==7.0.1 # via build @@ -33,7 +33,7 @@ korean-lunar-calendar==0.3.1 # via exchange_calendars (pyproject.toml) mccabe==0.7.0 # via flake8 -numpy==1.26.2 +numpy==1.26.3 # via # exchange_calendars (pyproject.toml) # pandas @@ -41,23 +41,23 @@ packaging==23.2 # via # build # pytest -pandas==2.1.4 +pandas==2.2.0 # via exchange_calendars (pyproject.toml) pip-tools==7.3.0 # via exchange_calendars (pyproject.toml) -pluggy==1.3.0 +pluggy==1.4.0 # via pytest py-cpuinfo==9.0.0 # via pytest-benchmark pycodestyle==2.11.1 # via flake8 -pyflakes==3.1.0 +pyflakes==3.2.0 # via flake8 pyluach==2.2.0 # via exchange_calendars (pyproject.toml) pyproject-hooks==1.0.0 # via build -pytest==7.4.4 +pytest==8.0.0 # via # exchange_calendars (pyproject.toml) # pytest-benchmark @@ -67,10 +67,8 @@ pytest-benchmark==4.0.0 pytest-xdist==3.5.0 # via exchange_calendars (pyproject.toml) python-dateutil==2.8.2 - # via - # exchange_calendars (pyproject.toml) - # pandas -pytz==2023.3.post1 + # via pandas +pytz==2023.4 # via pandas six==1.16.0 # via python-dateutil @@ -82,7 +80,7 @@ tomli==2.0.1 # pip-tools # pyproject-hooks # pytest -toolz==0.12.0 +toolz==0.12.1 # via exchange_calendars (pyproject.toml) tzdata==2023.4 # via diff --git a/etc/requirements_minpandas.txt b/etc/requirements_minpandas.txt index 5997b266..921e4352 100644 --- a/etc/requirements_minpandas.txt +++ b/etc/requirements_minpandas.txt @@ -7,6 +7,7 @@ # To upgrade with pandas==1.5 fixed run: # # pip-compile --upgrade --upgrade-package pandas==1.5 --extra=dev --output-file=etc/requirements_minpandas.txt pyproject.toml + # attrs==23.2.0 # via hypothesis @@ -25,9 +26,9 @@ exceptiongroup==1.2.0 # pytest execnet==2.0.2 # via pytest-xdist -flake8==6.1.0 +flake8==7.0.0 # via exchange_calendars (pyproject.toml) -hypothesis==6.92.2 +hypothesis==6.97.3 # via exchange_calendars (pyproject.toml) importlib-metadata==7.0.1 # via build @@ -37,7 +38,7 @@ korean-lunar-calendar==0.3.1 # via exchange_calendars (pyproject.toml) mccabe==0.7.0 # via flake8 -numpy==1.26.2 +numpy==1.26.3 # via # exchange_calendars (pyproject.toml) # pandas @@ -49,19 +50,19 @@ pandas==1.5.0 # via exchange_calendars (pyproject.toml) pip-tools==7.3.0 # via exchange_calendars (pyproject.toml) -pluggy==1.3.0 +pluggy==1.4.0 # via pytest py-cpuinfo==9.0.0 # via pytest-benchmark pycodestyle==2.11.1 # via flake8 -pyflakes==3.1.0 +pyflakes==3.2.0 # via flake8 pyluach==2.2.0 # via exchange_calendars (pyproject.toml) pyproject-hooks==1.0.0 # via build -pytest==7.4.4 +pytest==8.0.0 # via # exchange_calendars (pyproject.toml) # pytest-benchmark @@ -71,10 +72,8 @@ pytest-benchmark==4.0.0 pytest-xdist==3.5.0 # via exchange_calendars (pyproject.toml) python-dateutil==2.8.2 - # via - # exchange_calendars (pyproject.toml) - # pandas -pytz==2023.3.post1 + # via pandas +pytz==2023.4 # via pandas six==1.16.0 # via python-dateutil @@ -86,7 +85,7 @@ tomli==2.0.1 # pip-tools # pyproject-hooks # pytest -toolz==0.12.0 +toolz==0.12.1 # via exchange_calendars (pyproject.toml) tzdata==2023.4 # via exchange_calendars (pyproject.toml) diff --git a/pyproject.toml b/pyproject.toml index 612472af..d98121a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,10 +27,9 @@ classifiers = [ "Operating System :: OS Independent", ] dependencies = [ - "numpy", + "numpy<2", "pandas>=1.5", "pyluach", - "python-dateutil", "toolz", "tzdata", "korean_lunar_calendar",