diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dc23d94..76fe012 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,36 +10,41 @@ jobs: TEST_VARIANT: ${{ matrix.variant }} strategy: matrix: - python-version: ["3.11", "3.10", "3.9", "3.8"] - django-version: [4.1.7] - drf-version: [3.14.0] - pandas-version: [1.5.3] + python-version: ["3.12", "3.11", "3.10"] + django-version: [5.0.3] + drf-version: [3.15.1] + pandas-version: [2.2.1] variant: [''] include: - - python-version: "3.11" - django-version: 4.1.7 - drf-version: 3.14.0 - pandas-version: 1.5.3 + - python-version: "3.12" + django-version: 5.0.3 + drf-version: 3.15.1 + pandas-version: 2.2.1 variant: matplotlib - - python-version: "3.11" - django-version: 4.1.7 + - python-version: "3.12" + django-version: 5.0.3 + drf-version: 3.15.1 + pandas-version: 2.2.1 + variant: django-pandas + - python-version: "3.9" + django-version: 4.2.11 drf-version: 3.14.0 pandas-version: 1.5.3 - variant: django-pandas - - python-version: "3.11" - django-version: 3.2.14 - drf-version: 3.13.1 + variant: '' + - python-version: "3.8" + django-version: 4.2.11 + drf-version: 3.14.0 pandas-version: 1.5.3 variant: '' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip + python -m pip install --upgrade pip setuptools python -m pip install build python -m pip install flake8 wheel python -m pip install django==${{ matrix.django-version }} @@ -69,22 +74,22 @@ jobs: PACKAGE: ${{ matrix.package }} strategy: matrix: - python-version: ["3.11"] - node-version: [18] + python-version: ["3.12"] + node-version: [20] package: - pandas - chart - analyst steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Node ${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -97,11 +102,13 @@ jobs: run: | cd packages/$PACKAGE npm run test - - uses: smartsquaregmbh/delete-old-packages@v0.4.0 + - uses: smartsquaregmbh/delete-old-packages@v0.8.0 if: github.event_name == 'push' with: - keep: 5 + type: npm + organization: wq names: ${{ matrix.package }} + keep: 5 - name: Publish to Github Packages if: github.event_name == 'push' run: | diff --git a/pyproject.toml b/pyproject.toml index ec212a1..52d7860 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ authors = [ ] description = "Serves up pandas dataframes via the Django REST Framework for client-side visualizations." readme = "README.md" -requires-python = ">=3.7" +requires-python = ">=3.8" license = {text = "MIT"} classifiers = [ "Development Status :: 5 - Production/Stable", @@ -20,17 +20,16 @@ classifiers = [ "Natural Language :: English", "Programming Language :: JavaScript", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Framework :: Django", - "Framework :: Django :: 3.2", "Framework :: Django :: 4.0", "Framework :: Django :: 4.1", "Framework :: Django :: 4.2", + "Framework :: Django :: 5.0", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Scientific/Engineering :: Visualization", ] @@ -58,4 +57,4 @@ include = ["rest_pandas*"] [tool.setuptools_scm] write_to = "packages/analyst/src/version.js" -write_to_template = 'export default "{version}";' \ No newline at end of file +write_to_template = 'export default "{version}";' diff --git a/tests/files/multitimeseries.html b/tests/files/multitimeseries.html index 38a2a30..319c9da 100644 --- a/tests/files/multitimeseries.html +++ b/tests/files/multitimeseries.html @@ -4,15 +4,18 @@ Multi Time Series - + + - + - + + + @@ -21,38 +24,60 @@ - +Skip to main content
- + + +
-
+
@@ -155,9 +180,17 @@

Multi Time Series

-
+
+ + + + + + + + diff --git a/tests/files/timeseries.html b/tests/files/timeseries.html index 7f85364..cdaed18 100644 --- a/tests/files/timeseries.html +++ b/tests/files/timeseries.html @@ -4,15 +4,18 @@ Time Series Custom - + + - + - + + + @@ -21,38 +24,60 @@ - +Skip to main content
- + + +
-
+
@@ -149,9 +174,17 @@

Time Series Custom

-
+
+ + + + + + + + diff --git a/tests/settings.py b/tests/settings.py index 115df4b..cc993ed 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -54,4 +54,4 @@ from django import VERSION # noqa -HAS_DJANGO_4 = VERSION[0] == 4 +HAS_DJANGO_5 = VERSION[0] == 5 diff --git a/tests/test_multi.py b/tests/test_multi.py index 72f15b2..84d2ffb 100644 --- a/tests/test_multi.py +++ b/tests/test_multi.py @@ -5,7 +5,7 @@ from rest_pandas.test import parse_csv from django.core.exceptions import ImproperlyConfigured import os -from .settings import HAS_MATPLOTLIB, HAS_DJANGO_4 +from .settings import HAS_MATPLOTLIB, HAS_DJANGO_5 import pandas @@ -62,7 +62,7 @@ def test_multi_series(self): self.assertEqual(d0["date"], "2015-01-05") self.assertEqual(d0["value"], 0.3) - @unittest.skipUnless(HAS_DJANGO_4, "requires django 4") + @unittest.skipUnless(HAS_DJANGO_5, "requires django 5") def test_multi_series_html(self): response = self.client.get("/multitimeseries.html") expected = open( @@ -74,11 +74,7 @@ def test_multi_series_html(self): def test_multi_scatter(self): response = self.client.get("/multiscatter.csv") - if pandas.__version__ == "0.20.3": - # FIXME: Remove when dropping Python 3.4 support - header = "date,test1-value,test2-value" - else: - header = ",test1-value,test2-value\ndate,," + header = ",test1-value,test2-value\ndate,," self.assertEqual( header + """ diff --git a/tests/test_views.py b/tests/test_views.py index fa39167..32da0c0 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -5,7 +5,7 @@ import json import datetime import os -from .settings import HAS_DJANGO_PANDAS, HAS_DJANGO_4 +from .settings import HAS_DJANGO_PANDAS, HAS_DJANGO_5 class PandasTestCase(APITestCase): @@ -78,7 +78,7 @@ def test_view_json_kwargs(self): self.assertEqual(len(data.values()), 5) self.assertEqual(data["1"]["value"], 0.5) - @unittest.skipUnless(HAS_DJANGO_4, "requires django 4") + @unittest.skipUnless(HAS_DJANGO_5, "requires django 5") def test_view_html(self): response = self.client.get("/timeseries?test=1") expected = open( diff --git a/tests/testapp/views.py b/tests/testapp/views.py index 5ad7b63..f871bdf 100644 --- a/tests/testapp/views.py +++ b/tests/testapp/views.py @@ -95,7 +95,7 @@ class TimeSeriesCustomCSVView(PandasView): ] def transform_dataframe(self, df): - df["date"] = df["date"].astype("datetime64") + df["date"] = df["date"].astype("datetime64[ns]") return df