From 0e38bda17c7de85706665b377ae71b7d9d2252d3 Mon Sep 17 00:00:00 2001 From: Arkadii Yakovets Date: Thu, 18 Jul 2024 11:34:35 -0700 Subject: [PATCH 1/3] Update CI/CD pip caching --- .github/workflows/ci-cd.yml | 8 ++++---- requirements/dev.txt | 25 ++++++++++--------------- requirements/docs.txt | 10 +++++----- requirements/runtime.txt | 5 +++-- requirements/tests.txt | 20 +++++++++++++------- tests/test_holiday_base.py | 2 ++ 6 files changed, 37 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 00eb8fdb2..6d1a82bd0 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -83,7 +83,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install --upgrade --requirement requirements/tests.txt + python -m pip install --requirement requirements/tests.txt python -m pip install . - name: Run tests @@ -113,8 +113,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install --upgrade build polib - pip install . + python -m pip install build polib + python -m pip install . - name: Build distribution run: | @@ -160,7 +160,7 @@ jobs: shell: bash run: | rm -rf holidays - python -m pip install --upgrade --requirement requirements/tests.txt + python -m pip install --requirement requirements/tests.txt python -m pip install `ls dist/*.whl` pytest --dist loadscope --numprocesses auto tests/countries tests/financial python -m pip uninstall -y holidays python-dateutil six diff --git a/requirements/dev.txt b/requirements/dev.txt index db6ce860d..d4cb9b828 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,17 +1,12 @@ -# Test environments. -pre-commit -ruff -tox +# Dev requirements. -# Localization. -lingva - -# Holidays pre-calculation. -convertdate -hijridate - -# Deployment. -build -gitpython -pygithub +build==1.2.1 +convertdate==2.4.0 +gitpython==3.1.43 +hijridate==2.5.0 +lingva==5.0.3 +pre-commit==3.7.1 +pygithub==2.3.0 +ruff==0.5.2 +tox==4.16.0 urllib3>=2.2.2 # not directly required, pinned by Snyk to avoid a vulnerability diff --git a/requirements/docs.txt b/requirements/docs.txt index f6342e766..22f04065f 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -1,5 +1,5 @@ -# pip requirements for building docs. -# Must include package `install_requires` entries. -python-dateutil -sphinx -sphinx_rtd_theme +# Documentaion requirements. + +python-dateutil==2.9.0.post0 +sphinx_rtd_theme==2.0.0 +sphinx==7.2.6 diff --git a/requirements/runtime.txt b/requirements/runtime.txt index 9e77a5103..15819236a 100644 --- a/requirements/runtime.txt +++ b/requirements/runtime.txt @@ -1,2 +1,3 @@ -# Package runtime requirements. -python-dateutil +# Runtime requirements. + +python-dateutil==2.9.0.post0 diff --git a/requirements/tests.txt b/requirements/tests.txt index 959b49836..2bc6be7d9 100644 --- a/requirements/tests.txt +++ b/requirements/tests.txt @@ -1,8 +1,14 @@ # Test requirements. -coverage -importlib-metadata -numpy -polib -pytest -pytest-cov -pytest-xdist + +coverage==7.5.0; implementation_name == 'pypy' +coverage==7.6.0; implementation_name != 'pypy' +importlib-metadata==7.1.0; implementation_name == 'pypy' +importlib-metadata==8.0.0; implementation_name != 'pypy' +numpy==1.24.4; python_version < '3.9' +numpy==2.0.0; python_version >= '3.9' +polib==1.2.0 +pytest-cov==5.0.0 +pytest-xdist==3.5.0; implementation_name == 'pypy' +pytest-xdist==3.6.1; implementation_name != 'pypy' +pytest==8.1.1; implementation_name == 'pypy' +pytest==8.2.2; implementation_name != 'pypy' diff --git a/tests/test_holiday_base.py b/tests/test_holiday_base.py index 03e3fd0ff..833dc63ca 100644 --- a/tests/test_holiday_base.py +++ b/tests/test_holiday_base.py @@ -217,7 +217,9 @@ def test_years(self): HolidayBase(years=range(2010, 2016)).years, {2010, 2011, 2012, 2013, 2014, 2015} ) self.assertSetEqual(HolidayBase(years=(2013, 2015, 2015)).years, {2013, 2015}) + self.assertSetEqual(HolidayBase(years=(2013.0, 2015.0, 2015.0)).years, {2013, 2015}) self.assertSetEqual(HolidayBase(years=2015).years, {2015}) + self.assertSetEqual(HolidayBase(years=2015.0).years, {2015}) class TestCategories(unittest.TestCase): From e8bddc022773b7b73847224ecc64f3cfd15fc526 Mon Sep 17 00:00:00 2001 From: Arkadii Yakovets Date: Thu, 18 Jul 2024 11:48:31 -0700 Subject: [PATCH 2/3] Update numpy constraints --- requirements/tests.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/tests.txt b/requirements/tests.txt index 2bc6be7d9..aef1607d0 100644 --- a/requirements/tests.txt +++ b/requirements/tests.txt @@ -4,8 +4,8 @@ coverage==7.5.0; implementation_name == 'pypy' coverage==7.6.0; implementation_name != 'pypy' importlib-metadata==7.1.0; implementation_name == 'pypy' importlib-metadata==8.0.0; implementation_name != 'pypy' -numpy==1.24.4; python_version < '3.9' -numpy==2.0.0; python_version >= '3.9' +numpy<2.0.0; implementation_name == 'pypy' +numpy==2.0.0; implementation_name != 'pypy' polib==1.2.0 pytest-cov==5.0.0 pytest-xdist==3.5.0; implementation_name == 'pypy' From 85fb5f191b2e711d3395d1fa9728cac9e62abff8 Mon Sep 17 00:00:00 2001 From: Arkadii Yakovets Date: Thu, 18 Jul 2024 11:56:45 -0700 Subject: [PATCH 3/3] Update numpy constraints --- requirements/tests.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/tests.txt b/requirements/tests.txt index aef1607d0..2bef871a0 100644 --- a/requirements/tests.txt +++ b/requirements/tests.txt @@ -4,8 +4,8 @@ coverage==7.5.0; implementation_name == 'pypy' coverage==7.6.0; implementation_name != 'pypy' importlib-metadata==7.1.0; implementation_name == 'pypy' importlib-metadata==8.0.0; implementation_name != 'pypy' -numpy<2.0.0; implementation_name == 'pypy' -numpy==2.0.0; implementation_name != 'pypy' +numpy<2.0.0; implementation_name == 'pypy' or python_version < '3.9' +numpy==2.0.0; implementation_name != 'pypy' and python_version >= '3.9' polib==1.2.0 pytest-cov==5.0.0 pytest-xdist==3.5.0; implementation_name == 'pypy'