Skip to content

Commit

Permalink
Fix: Import "Self" with python < 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
klieret committed Nov 18, 2024
1 parent 7b338a3 commit b98c6e9
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/swerex/deployment/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import subprocess
import time
import uuid
from typing import Any, Self
from typing import Any

from typing_extensions import Self

from swerex import PACKAGE_NAME, REMOTE_EXECUTABLE_NAME
from swerex.deployment.abstract import AbstractDeployment
Expand Down
4 changes: 3 additions & 1 deletion src/swerex/deployment/dummy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import logging
from typing import Any, Self
from typing import Any

from typing_extensions import Self

from swerex.deployment.abstract import AbstractDeployment
from swerex.deployment.config import DummyDeploymentConfig
Expand Down
3 changes: 2 additions & 1 deletion src/swerex/deployment/fargate.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import logging
import time
import uuid
from typing import Any, Self
from typing import Any

import boto3
from typing_extensions import Self

from swerex import PACKAGE_NAME, REMOTE_EXECUTABLE_NAME
from swerex.deployment.abstract import AbstractDeployment
Expand Down
4 changes: 3 additions & 1 deletion src/swerex/deployment/local.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import logging
from typing import Any, Self
from typing import Any

from typing_extensions import Self

from swerex.deployment.abstract import AbstractDeployment
from swerex.deployment.config import LocalDeploymentConfig
Expand Down
3 changes: 2 additions & 1 deletion src/swerex/deployment/modal.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
import time
import uuid
from pathlib import Path, PurePath
from typing import Any, Self
from typing import Any

import boto3
import modal
from botocore.exceptions import NoCredentialsError
from typing_extensions import Self

from swerex import PACKAGE_NAME, REMOTE_EXECUTABLE_NAME
from swerex.deployment.abstract import AbstractDeployment
Expand Down
4 changes: 3 additions & 1 deletion src/swerex/deployment/remote.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import logging
from typing import Any, Self
from typing import Any

from typing_extensions import Self

from swerex.deployment.abstract import AbstractDeployment
from swerex.deployment.config import RemoteDeploymentConfig
Expand Down
4 changes: 3 additions & 1 deletion src/swerex/runtime/dummy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import logging
from typing import Any, Self
from typing import Any

from typing_extensions import Self

from swerex.runtime.abstract import (
AbstractRuntime,
Expand Down
3 changes: 2 additions & 1 deletion src/swerex/runtime/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
import time
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Any, Self
from typing import Any

import bashlex
import bashlex.ast
import bashlex.errors
import pexpect
from typing_extensions import Self

from swerex.exceptions import (
BashIncorrectSyntaxError,
Expand Down
3 changes: 2 additions & 1 deletion src/swerex/runtime/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
import tempfile
import traceback
from pathlib import Path
from typing import Any, Self
from typing import Any

import requests
from pydantic import BaseModel
from typing_extensions import Self

from swerex.exceptions import SweRexception
from swerex.runtime.abstract import (
Expand Down

0 comments on commit b98c6e9

Please sign in to comment.