Skip to content

Commit

Permalink
update python & django versions
Browse files Browse the repository at this point in the history
  • Loading branch information
sheppard committed Apr 1, 2024
1 parent 19de2ba commit d00992c
Show file tree
Hide file tree
Showing 8 changed files with 125 additions and 57 deletions.
53 changes: 30 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
Expand All @@ -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: |
Expand Down
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
]
Expand Down Expand Up @@ -58,4 +57,4 @@ include = ["rest_pandas*"]

[tool.setuptools_scm]
write_to = "packages/analyst/src/version.js"
write_to_template = 'export default "{version}";'
write_to_template = 'export default "{version}";'
51 changes: 42 additions & 9 deletions tests/files/multitimeseries.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@
<head>
<title>Multi Time Series</title>
<link rel="stylesheet" href="admin/css/base.css">
<link href="admin/css/dark_mode.css" rel="stylesheet">

<link rel="stylesheet" href="admin/css/dark_mode.css">
<script src="admin/js/theme.js" defer></script>

<link rel="stylesheet" href="admin/css/forms.css" type="text/css">


<link rel="stylesheet" type="text/css" href="admin/css/forms.css">


<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">


<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="admin/css/responsive.css">


Expand All @@ -21,38 +24,60 @@

<body class=""
data-admin-utc-offset="0">

<a href="#content-start" class="skip-to-content-link">Skip to main content</a>
<!-- Container -->
<div id="container">


<!-- Header -->

<div id="header">
<header id="header">
<div id="branding">

<h1 id="site-name"><a href="/admin">Django administration</a></h1>
<div id="site-name"><a href="/admin">Django administration</a></div>


<button class="theme-toggle">
<div class="visually-hidden theme-label-when-auto">Toggle theme (current theme: auto)</div>
<div class="visually-hidden theme-label-when-light">Toggle theme (current theme: light)</div>
<div class="visually-hidden theme-label-when-dark">Toggle theme (current theme: dark)</div>
<svg aria-hidden="true" class="theme-icon-when-auto">
<use xlink:href="#icon-auto" />
</svg>
<svg aria-hidden="true" class="theme-icon-when-dark">
<use xlink:href="#icon-moon" />
</svg>
<svg aria-hidden="true" class="theme-icon-when-light">
<use xlink:href="#icon-sun" />
</svg>
</button>



</div>




</div>
</header>

<!-- END Header -->

<nav aria-label="Breadcrumbs">

<div class="breadcrumbs">
<a href="/admin">Admin Home</a>
&rsaquo;
Multi Time Series
</div>

</nav>



<div class="main" id="main">

<div class="content">
<main id="content-start" class="content" tabindex="-1">



Expand Down Expand Up @@ -155,9 +180,17 @@ <h1 style="flex:1">Multi Time Series</h1>
</div>
<!-- END Content -->
<div id="footer"></div>
</div>
</main>
</div>
</div>
<!-- END Container -->

<!-- SVGs -->
<svg xmlns="http://www.w3.org/2000/svg" class="base-svgs">
<symbol viewBox="0 0 24 24" width="1rem" height="1rem" id="icon-auto"><path d="M0 0h24v24H0z" fill="currentColor"/><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2V4a8 8 0 1 0 0 16z"/></symbol>
<symbol viewBox="0 0 24 24" width="1rem" height="1rem" id="icon-moon"><path d="M0 0h24v24H0z" fill="currentColor"/><path d="M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2h.1A6.979 6.979 0 0 0 10 7zm-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938 7.999 7.999 0 0 0 4 12z"/></symbol>
<symbol viewBox="0 0 24 24" width="1rem" height="1rem" id="icon-sun"><path d="M0 0h24v24H0z" fill="currentColor"/><path d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-2a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05 3.515 4.93zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414-2.121-2.121zm2.121-14.85l1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z"/></symbol>
</svg>
<!-- END SVGs -->
</body>
</html>
51 changes: 42 additions & 9 deletions tests/files/timeseries.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@
<head>
<title>Time Series Custom</title>
<link rel="stylesheet" href="admin/css/base.css">
<link href="admin/css/dark_mode.css" rel="stylesheet">

<link rel="stylesheet" href="admin/css/dark_mode.css">
<script src="admin/js/theme.js" defer></script>

<link rel="stylesheet" href="admin/css/forms.css" type="text/css">


<link rel="stylesheet" type="text/css" href="admin/css/forms.css">


<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">


<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="admin/css/responsive.css">


Expand All @@ -21,38 +24,60 @@

<body class=""
data-admin-utc-offset="0">

<a href="#content-start" class="skip-to-content-link">Skip to main content</a>
<!-- Container -->
<div id="container">


<!-- Header -->

<div id="header">
<header id="header">
<div id="branding">

<h1 id="site-name"><a href="/admin">Django administration</a></h1>
<div id="site-name"><a href="/admin">Django administration</a></div>


<button class="theme-toggle">
<div class="visually-hidden theme-label-when-auto">Toggle theme (current theme: auto)</div>
<div class="visually-hidden theme-label-when-light">Toggle theme (current theme: light)</div>
<div class="visually-hidden theme-label-when-dark">Toggle theme (current theme: dark)</div>
<svg aria-hidden="true" class="theme-icon-when-auto">
<use xlink:href="#icon-auto" />
</svg>
<svg aria-hidden="true" class="theme-icon-when-dark">
<use xlink:href="#icon-moon" />
</svg>
<svg aria-hidden="true" class="theme-icon-when-light">
<use xlink:href="#icon-sun" />
</svg>
</button>



</div>




</div>
</header>

<!-- END Header -->

<nav aria-label="Breadcrumbs">

<div class="breadcrumbs">
<a href="/admin">Admin Home</a>
&rsaquo;
Time Series Custom
</div>

</nav>



<div class="main" id="main">

<div class="content">
<main id="content-start" class="content" tabindex="-1">



Expand Down Expand Up @@ -149,9 +174,17 @@ <h1 style="flex:1">Time Series Custom</h1>
</div>
<!-- END Content -->
<div id="footer"></div>
</div>
</main>
</div>
</div>
<!-- END Container -->

<!-- SVGs -->
<svg xmlns="http://www.w3.org/2000/svg" class="base-svgs">
<symbol viewBox="0 0 24 24" width="1rem" height="1rem" id="icon-auto"><path d="M0 0h24v24H0z" fill="currentColor"/><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2V4a8 8 0 1 0 0 16z"/></symbol>
<symbol viewBox="0 0 24 24" width="1rem" height="1rem" id="icon-moon"><path d="M0 0h24v24H0z" fill="currentColor"/><path d="M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2h.1A6.979 6.979 0 0 0 10 7zm-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938 7.999 7.999 0 0 0 4 12z"/></symbol>
<symbol viewBox="0 0 24 24" width="1rem" height="1rem" id="icon-sun"><path d="M0 0h24v24H0z" fill="currentColor"/><path d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-2a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05 3.515 4.93zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414-2.121-2.121zm2.121-14.85l1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z"/></symbol>
</svg>
<!-- END SVGs -->
</body>
</html>
2 changes: 1 addition & 1 deletion tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@

from django import VERSION # noqa

HAS_DJANGO_4 = VERSION[0] == 4
HAS_DJANGO_5 = VERSION[0] == 5
10 changes: 3 additions & 7 deletions tests/test_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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(
Expand All @@ -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
+ """
Expand Down
Loading

0 comments on commit d00992c

Please sign in to comment.