diff --git a/.github/workflows/core_code_checks.yml b/.github/workflows/core_code_checks.yml index 3c9195f2a5..86ff5ccca8 100644 --- a/.github/workflows/core_code_checks.yml +++ b/.github/workflows/core_code_checks.yml @@ -15,10 +15,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python 3.8.12 + - name: Set up Python 3.7.13 uses: actions/setup-python@v4 with: - python-version: '3.8.12' + python-version: '3.7.13' - uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} diff --git a/nerfstudio/data/datamanagers/base_datamanager.py b/nerfstudio/data/datamanagers/base_datamanager.py index 1e6b6669d2..a895fb7b80 100644 --- a/nerfstudio/data/datamanagers/base_datamanager.py +++ b/nerfstudio/data/datamanagers/base_datamanager.py @@ -20,7 +20,7 @@ from abc import abstractmethod from dataclasses import dataclass, field -from typing import Dict, List, Literal, Optional, Tuple, Type, Union +from typing import Dict, List, Optional, Tuple, Type, Union import torch import tyro @@ -29,6 +29,7 @@ from torch.nn import Parameter from torch.utils.data import Dataset from torch.utils.data.distributed import DistributedSampler +from typing_extensions import Literal from nerfstudio.cameras.camera_optimizers import CameraOptimizerConfig from nerfstudio.cameras.rays import RayBundle diff --git a/nerfstudio/engine/trainer.py b/nerfstudio/engine/trainer.py index 60f0a6dbeb..d35ebfeee4 100644 --- a/nerfstudio/engine/trainer.py +++ b/nerfstudio/engine/trainer.py @@ -21,11 +21,12 @@ import functools import os import time -from typing import Dict, List, Literal, Tuple +from typing import Dict, List, Tuple import torch from rich.console import Console from torch.cuda.amp.grad_scaler import GradScaler +from typing_extensions import Literal from nerfstudio.configs import base_config as cfg from nerfstudio.engine.callbacks import ( diff --git a/nerfstudio/pipelines/base_pipeline.py b/nerfstudio/pipelines/base_pipeline.py index 11930143b8..c0927c57aa 100644 --- a/nerfstudio/pipelines/base_pipeline.py +++ b/nerfstudio/pipelines/base_pipeline.py @@ -21,7 +21,7 @@ from abc import abstractmethod from dataclasses import dataclass, field from time import time -from typing import Any, Dict, List, Literal, Optional, Type, Union, cast +from typing import Any, Dict, List, Optional, Type, Union, cast import torch import torch.distributed as dist @@ -35,6 +35,7 @@ from torch import nn from torch.nn import Parameter from torch.nn.parallel import DistributedDataParallel as DDP +from typing_extensions import Literal from nerfstudio.configs import base_config as cfg from nerfstudio.data.datamanagers.base_datamanager import ( diff --git a/nerfstudio/pipelines/dynamic_batch.py b/nerfstudio/pipelines/dynamic_batch.py index b169dfd559..788f68e82c 100644 --- a/nerfstudio/pipelines/dynamic_batch.py +++ b/nerfstudio/pipelines/dynamic_batch.py @@ -17,9 +17,10 @@ """ from dataclasses import dataclass, field -from typing import Literal, Type +from typing import Type import torch +from typing_extensions import Literal from nerfstudio.data.datamanagers.base_datamanager import VanillaDataManager from nerfstudio.pipelines.base_pipeline import VanillaPipeline, VanillaPipelineConfig diff --git a/nerfstudio/utils/eval_utils.py b/nerfstudio/utils/eval_utils.py index 29a0dcada5..7401a916c4 100644 --- a/nerfstudio/utils/eval_utils.py +++ b/nerfstudio/utils/eval_utils.py @@ -20,11 +20,12 @@ import os import sys from pathlib import Path -from typing import Literal, Optional, Tuple +from typing import Optional, Tuple import torch import yaml from rich.console import Console +from typing_extensions import Literal from nerfstudio.configs import base_config as cfg from nerfstudio.pipelines.base_pipeline import Pipeline diff --git a/pyproject.toml b/pyproject.toml index 59a74727e7..52b5abfc59 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -146,5 +146,5 @@ reportMissingTypeStubs = false reportPrivateImportUsage = false reportUndefinedVariable = false -pythonVersion = "3.8" +pythonVersion = "3.7" pythonPlatform = "Linux"