Skip to content

Commit

Permalink
Add tests for Python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Aug 2, 2023
1 parent cd33c55 commit 3cccc0c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python_version: ['3.8', '3.9', '3.10']
python_version: ['3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
fail-fast: false
matrix:
os: [macos-12]
python_version: ['3.8', '3.9', '3.10']
python_version: ['3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest]
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v2

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ classifiers = [
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
dependencies = [
"jupyter_client>=7.4.4,<9",
Expand Down
17 changes: 15 additions & 2 deletions voila/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import sys
import threading
import warnings
from enum import Enum
from functools import partial
from pathlib import Path
from typing import Awaitable, Dict, List
Expand All @@ -29,8 +28,22 @@
from ._version import __version__
from .static_file_handler import TemplateStaticFileHandler

try:
# Only exists in Python 3.11
from enum import StrEnum

class ENV_VARIABLE(str, Enum):

class StringEnum(StrEnum):
pass
except ImportError:
from enum import Enum


class StringEnum(str, Enum):
pass


class ENV_VARIABLE(StringEnum):
VOILA_PREHEAT = "VOILA_PREHEAT"
VOILA_KERNEL_ID = "VOILA_KERNEL_ID"
VOILA_BASE_URL = "VOILA_BASE_URL"
Expand Down
3 changes: 2 additions & 1 deletion voila/voila_kernel_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ def task_counter(tk):
# Start the work on the loop immediately, so it is ready when needed:
task = loop.create_task(
wait_before(
delay, self._initialize(notebook_name, None, **kwargs)
delay,
self._initialize(notebook_name, None, **kwargs),
)
)
pool.append(task)
Expand Down

0 comments on commit 3cccc0c

Please sign in to comment.