From 1ae5ede01e504b21d2b72cdfa0ea4c3040c72373 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Mon, 17 Jun 2024 10:18:35 -0700 Subject: [PATCH 01/17] Require numpy<2.0 numpy 2.0 is breaking some things in the CI; will deal with it later. --- requirements/requirements.in | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements/requirements.in b/requirements/requirements.in index 3bf3426f..f2231789 100644 --- a/requirements/requirements.in +++ b/requirements/requirements.in @@ -58,6 +58,7 @@ mysqlclient # https://github.com/PyMySQL/mysqlclient # pandas for data summaries pandas +numpy<2.0.0 # for exporting django-tables2 tables to tsv. tablib From 9260fdef7025b679e310aba5c6dbf22f04664ced Mon Sep 17 00:00:00 2001 From: amstilp <3944584+amstilp@users.noreply.github.com> Date: Mon, 17 Jun 2024 17:20:33 +0000 Subject: [PATCH 02/17] Compile requirements files --- requirements/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index a2afeb97..f4743854 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -131,6 +131,7 @@ networkx==3.1 # pronto numpy==1.24.4 # via + # -r requirements/requirements.in # django-anvil-consortium-manager # pandas oauthlib==3.2.2 From 7b9fe1ec77c69b2f08b56726ba874f868a4b3386 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Mon, 17 Jun 2024 12:10:22 -0700 Subject: [PATCH 03/17] Also put a limit on the pandas version The latest version of pandas might also be causing issues when recompiling requirements files for python 3.12? --- requirements/requirements.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/requirements.in b/requirements/requirements.in index f2231789..71de51d1 100644 --- a/requirements/requirements.in +++ b/requirements/requirements.in @@ -57,8 +57,8 @@ pronto mysqlclient # https://github.com/PyMySQL/mysqlclient # pandas for data summaries -pandas -numpy<2.0.0 +pandas<2.1 +numpy<2.0 # for exporting django-tables2 tables to tsv. tablib From 14948fd584ab1b2aad1fbda6681713d0d2a3d394 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Mon, 17 Jun 2024 12:30:04 -0700 Subject: [PATCH 04/17] Pass verbose flag to pip-compile Can help debug issues. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5576381e..fd5a58c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,8 +82,8 @@ jobs: - name: Recompile pip files if requested if: matrix.pip-recompile run: | - pip-compile requirements/requirements.in - pip-compile requirements/test-requirements.in + pip-compile -v requirements/requirements.in + pip-compile -v requirements/test-requirements.in # Print out changes. git diff From 4b3e9fba9de7240d6b1c6dfa326df898703f6d5b Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Mon, 17 Jun 2024 13:25:51 -0700 Subject: [PATCH 05/17] Remove both numpy and pandas requirements temporarily This lets us see what pip-compile says with the -v flag. --- requirements/requirements.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/requirements/requirements.in b/requirements/requirements.in index 71de51d1..3bf3426f 100644 --- a/requirements/requirements.in +++ b/requirements/requirements.in @@ -57,8 +57,7 @@ pronto mysqlclient # https://github.com/PyMySQL/mysqlclient # pandas for data summaries -pandas<2.1 -numpy<2.0 +pandas # for exporting django-tables2 tables to tsv. tablib From bcd98c36ace0dd5893bfc75d737035bf553dd9b8 Mon Sep 17 00:00:00 2001 From: amstilp <3944584+amstilp@users.noreply.github.com> Date: Mon, 17 Jun 2024 20:27:00 +0000 Subject: [PATCH 06/17] Compile requirements files --- requirements/requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index f4743854..a2afeb97 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -131,7 +131,6 @@ networkx==3.1 # pronto numpy==1.24.4 # via - # -r requirements/requirements.in # django-anvil-consortium-manager # pandas oauthlib==3.2.2 From 9a6954ef94a9c4a6f16ee7c419218d00fcace8ed Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Mon, 17 Jun 2024 13:34:48 -0700 Subject: [PATCH 07/17] Add numpy<2.0 back to requriements file --- requirements/requirements.in | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements/requirements.in b/requirements/requirements.in index 3bf3426f..1fe37ecf 100644 --- a/requirements/requirements.in +++ b/requirements/requirements.in @@ -58,6 +58,7 @@ mysqlclient # https://github.com/PyMySQL/mysqlclient # pandas for data summaries pandas +numpy<2.0 # for exporting django-tables2 tables to tsv. tablib From c6b12abd00892c3f33b7340fd008c8f563a6b113 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Mon, 17 Jun 2024 13:51:55 -0700 Subject: [PATCH 08/17] Try just specifying pandas requirement Pandas 2.2.2 works with numpy 2.0 and previous versions. --- requirements/requirements.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/requirements/requirements.in b/requirements/requirements.in index 1fe37ecf..c52539bb 100644 --- a/requirements/requirements.in +++ b/requirements/requirements.in @@ -57,8 +57,7 @@ pronto mysqlclient # https://github.com/PyMySQL/mysqlclient # pandas for data summaries -pandas -numpy<2.0 +pandas>=2.2.2 # for exporting django-tables2 tables to tsv. tablib From cf12a8d0ce071f8785fd4ff3e92ec8baf57b689d Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Mon, 17 Jun 2024 14:24:34 -0700 Subject: [PATCH 09/17] Remove pandas pinned version requirement It doesn't work in python 3.8. --- requirements/requirements.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements.in b/requirements/requirements.in index c52539bb..3bf3426f 100644 --- a/requirements/requirements.in +++ b/requirements/requirements.in @@ -57,7 +57,7 @@ pronto mysqlclient # https://github.com/PyMySQL/mysqlclient # pandas for data summaries -pandas>=2.2.2 +pandas # for exporting django-tables2 tables to tsv. tablib From 96ae9852cec521043cd64ce2406fe2995642a736 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Mon, 17 Jun 2024 14:38:48 -0700 Subject: [PATCH 10/17] Specify more verbosity for pip-compile --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd5a58c1..357f30d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,8 +82,8 @@ jobs: - name: Recompile pip files if requested if: matrix.pip-recompile run: | - pip-compile -v requirements/requirements.in - pip-compile -v requirements/test-requirements.in + pip-compile -vvv requirements/requirements.in + pip-compile -vvv requirements/test-requirements.in # Print out changes. git diff From d23a90417b0cca63b135c1639e4cb3d3ce8feee7 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Mon, 17 Jun 2024 14:54:22 -0700 Subject: [PATCH 11/17] Try silencing any warning from a third-party package We can't control these warnings. We only want the warnings raised by our code to convert to errors. --- pytest.ini | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pytest.ini b/pytest.ini index 86a71d26..d620a6e6 100644 --- a/pytest.ini +++ b/pytest.ini @@ -2,10 +2,8 @@ addopts = --ds=config.settings.test --reuse-db -n auto python_files = tests.py test_*.py filterwarnings = - # Convert all warnings to errors. - error - # The most recent version of model_utils tries to use pkg_resources, which raises a warning. - ignore:pkg_resources is deprecated as an API.:DeprecationWarning:model_utils - # Warning raised by pkg_resources via model_utils. ?? - ignore:Deprecated call to `pkg_resources.declare_namespace:DeprecationWarning:pkg_resources - ignore:'pkgutil.find_loader' is deprecated and slated for removal in Python 3.14:DeprecationWarning + # Goal: ignore all third-party warnings but convert warnings from the acm/primed modules to errors. + "ignore", + "error:::anvil_consortium_manager", + "error:::primed", +] From 157ff82fb4d9409083a3143604c18190be501fb2 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Mon, 17 Jun 2024 15:10:30 -0700 Subject: [PATCH 12/17] Fix syntax errors in pytest config file --- pytest.ini | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pytest.ini b/pytest.ini index d620a6e6..e5cd3467 100644 --- a/pytest.ini +++ b/pytest.ini @@ -3,7 +3,6 @@ addopts = --ds=config.settings.test --reuse-db -n auto python_files = tests.py test_*.py filterwarnings = # Goal: ignore all third-party warnings but convert warnings from the acm/primed modules to errors. - "ignore", - "error:::anvil_consortium_manager", - "error:::primed", -] + ignore + error:::anvil_consortium_manager + error:::primed From 6a37070427fdcebae6af77eb32d7136b8e655b30 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Mon, 17 Jun 2024 15:24:24 -0700 Subject: [PATCH 13/17] Undo pytest config changes It wasn't working as hoped. --- pytest.ini | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pytest.ini b/pytest.ini index e5cd3467..86a71d26 100644 --- a/pytest.ini +++ b/pytest.ini @@ -2,7 +2,10 @@ addopts = --ds=config.settings.test --reuse-db -n auto python_files = tests.py test_*.py filterwarnings = - # Goal: ignore all third-party warnings but convert warnings from the acm/primed modules to errors. - ignore - error:::anvil_consortium_manager - error:::primed + # Convert all warnings to errors. + error + # The most recent version of model_utils tries to use pkg_resources, which raises a warning. + ignore:pkg_resources is deprecated as an API.:DeprecationWarning:model_utils + # Warning raised by pkg_resources via model_utils. ?? + ignore:Deprecated call to `pkg_resources.declare_namespace:DeprecationWarning:pkg_resources + ignore:'pkgutil.find_loader' is deprecated and slated for removal in Python 3.14:DeprecationWarning From 4a76ed5d3a271552024e27590203d8a2d0c32e1a Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Mon, 17 Jun 2024 15:29:04 -0700 Subject: [PATCH 14/17] Try using an environment marker in requirements file --- requirements/requirements.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/requirements/requirements.in b/requirements/requirements.in index 3bf3426f..c13e0aef 100644 --- a/requirements/requirements.in +++ b/requirements/requirements.in @@ -58,6 +58,8 @@ mysqlclient # https://github.com/PyMySQL/mysqlclient # pandas for data summaries pandas +numpy>1.24,<2.0 ; python_version < '3.12' + # for exporting django-tables2 tables to tsv. tablib From c286bd67f29b27e0a89927879036df997ccc4fc4 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Mon, 17 Jun 2024 15:39:12 -0700 Subject: [PATCH 15/17] Fix environment marker specification for numpy --- requirements/requirements.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements.in b/requirements/requirements.in index c13e0aef..e5f4dc35 100644 --- a/requirements/requirements.in +++ b/requirements/requirements.in @@ -58,7 +58,7 @@ mysqlclient # https://github.com/PyMySQL/mysqlclient # pandas for data summaries pandas -numpy>1.24,<2.0 ; python_version < '3.12' +numpy>1.24,<2.0 ; python_version == '3.12' # for exporting django-tables2 tables to tsv. From 20210258a24824ce1ba2e3b57acd1269a084be79 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Mon, 17 Jun 2024 15:46:34 -0700 Subject: [PATCH 16/17] Fix numpy version for python 3.12 --- requirements/requirements.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements.in b/requirements/requirements.in index e5f4dc35..619bf530 100644 --- a/requirements/requirements.in +++ b/requirements/requirements.in @@ -58,7 +58,7 @@ mysqlclient # https://github.com/PyMySQL/mysqlclient # pandas for data summaries pandas -numpy>1.24,<2.0 ; python_version == '3.12' +numpy>=1.25,<2.0 ; python_version == '3.12' # for exporting django-tables2 tables to tsv. From 59b1fe4c39b7ccab75c4f6168009fac89fb518b1 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Mon, 17 Jun 2024 16:04:33 -0700 Subject: [PATCH 17/17] Change verbosity back to single v for pip-compile --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 357f30d4..fd5a58c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,8 +82,8 @@ jobs: - name: Recompile pip files if requested if: matrix.pip-recompile run: | - pip-compile -vvv requirements/requirements.in - pip-compile -vvv requirements/test-requirements.in + pip-compile -v requirements/requirements.in + pip-compile -v requirements/test-requirements.in # Print out changes. git diff