mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-09 11:28:14 +08:00
Use typing_extensions
This commit is contained in:
@@ -25,12 +25,15 @@ jobs:
|
||||
- run: mypy .
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.6, 3.7, 3.8]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
- name: Setup Python${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.x'
|
||||
python-version: ${{ matrix.python-version }}
|
||||
architecture: x64
|
||||
- name: Install dependencies
|
||||
run: pip install --progress-bar off .
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
import json
|
||||
from typing import Any, Dict, List, TypedDict
|
||||
from typing import Any, Dict, List
|
||||
|
||||
from optuna.study import StudySummary
|
||||
from optuna.trial import FrozenTrial
|
||||
|
||||
try:
|
||||
from typing import TypedDict
|
||||
except:
|
||||
from typing_extensions import TypedDict
|
||||
|
||||
|
||||
Attribute = TypedDict(
|
||||
"Attribute",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import os
|
||||
import sys
|
||||
import types
|
||||
|
||||
from typing import List
|
||||
from setuptools import setup, find_packages
|
||||
from importlib.machinery import SourceFileLoader
|
||||
|
||||
@@ -22,6 +23,13 @@ def get_version() -> int:
|
||||
return getattr(target_module, "__version__")
|
||||
|
||||
|
||||
def get_install_requires() -> List[str]:
|
||||
deps = ["optuna", "bottle"]
|
||||
if sys.version_info[:2] < (3, 8):
|
||||
deps.append("typing-extensions")
|
||||
return deps
|
||||
|
||||
|
||||
setup(
|
||||
name="optuna-dashboard",
|
||||
version=get_version(),
|
||||
@@ -32,7 +40,7 @@ setup(
|
||||
author_email="m.shibata1020@gmail.com",
|
||||
url="https://github.com/c-bata/optuna-dashboard",
|
||||
packages=find_packages(),
|
||||
install_requires=["optuna", "bottle"],
|
||||
install_requires=get_install_requires(),
|
||||
extras_require={
|
||||
"lint": ["black", "flake8", "mypy"],
|
||||
"release": ["wheel", "twine"],
|
||||
|
||||
Reference in New Issue
Block a user