diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 4947bfcf..8b5118e0 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -73,4 +73,4 @@ jobs: path: dist/ merge-multiple: true - name: Publish package distributions to PyPI - uses: pypa/gh-action-pypi-publish@v1.12.4 \ No newline at end of file + uses: pypa/gh-action-pypi-publish@v1.13.0 \ No newline at end of file diff --git a/.github/workflows/test-pypi-release.yml b/.github/workflows/test-pypi-release.yml index 973cf22d..1f421aa1 100644 --- a/.github/workflows/test-pypi-release.yml +++ b/.github/workflows/test-pypi-release.yml @@ -43,7 +43,7 @@ jobs: path: dist/ merge-multiple: true - name: Publish package distributions to PyPI - uses: pypa/gh-action-pypi-publish@v1.12.4 + uses: pypa/gh-action-pypi-publish@v1.13.0 with: repository-url: https://test.pypi.org/legacy/ skip-existing: true \ No newline at end of file diff --git a/src/basilisp/lang/compiler/exception.py b/src/basilisp/lang/compiler/exception.py index 487d449e..ea0642ef 100644 --- a/src/basilisp/lang/compiler/exception.py +++ b/src/basilisp/lang/compiler/exception.py @@ -122,7 +122,7 @@ def format_compiler_exception( # pylint: disable=too-many-branches,unused-argum code.""" context_exc: Optional[BaseException] = e.__cause__ - lines = [os.linesep] + lines: list[str] = [os.linesep] if context_exc is not None: lines.append(f" exception: {type(context_exc)} from {type(e)}{os.linesep}") else: diff --git a/src/basilisp/lang/compiler/generator.py b/src/basilisp/lang/compiler/generator.py index 5c9ce203..7e9ee898 100644 --- a/src/basilisp/lang/compiler/generator.py +++ b/src/basilisp/lang/compiler/generator.py @@ -1598,7 +1598,7 @@ def _wrapped_do( ) -> GeneratedPyAST[T_pynode]: if isinstance(node, Do) and node.use_var_indirection: with ctx.with_var_indirection_override(): - return f(ctx, cast(T_node, node), *args, **kwargs) + return f(ctx, node, *args, **kwargs) else: with ctx.with_var_indirection_override(False): return f(ctx, node, *args, **kwargs) diff --git a/src/basilisp/lang/interfaces.py b/src/basilisp/lang/interfaces.py index 3c533d7d..c29ed9f0 100644 --- a/src/basilisp/lang/interfaces.py +++ b/src/basilisp/lang/interfaces.py @@ -549,11 +549,11 @@ def seq(self) -> "Optional[ISeq[T]]": # type: ignore[override] raise NotImplementedError() -T_tcoll_co = TypeVar("T_tcoll_co", bound="ITransientCollection", covariant=True) +T_tcoll = TypeVar("T_tcoll", bound="ITransientCollection") # Including ABC as a base seems to cause catastrophic meltdown. -class IEvolveableCollection(Generic[T_tcoll_co]): +class IEvolveableCollection(Generic[T_tcoll]): """``IEvolveableCollection`` types support creating transient variants of persistent data structures which can be modified efficiently and then returned back into persistent data structures once modification is complete. @@ -563,7 +563,7 @@ class IEvolveableCollection(Generic[T_tcoll_co]): :lpy:fn:`transient`""" @abstractmethod - def to_transient(self) -> T_tcoll_co: + def to_transient(self) -> T_tcoll: raise NotImplementedError() @@ -578,11 +578,11 @@ class ITransientCollection(Generic[T]): __slots__ = () @abstractmethod - def cons_transient(self: T_tcoll_co, *elems: T) -> "T_tcoll_co": + def cons_transient(self: T_tcoll, *elems: T) -> "T_tcoll": raise NotImplementedError() @abstractmethod - def to_persistent(self: T_tcoll_co) -> "IPersistentCollection[T]": + def to_persistent(self: T_tcoll) -> "IPersistentCollection[T]": raise NotImplementedError() @@ -720,6 +720,9 @@ def seq_equals(s1: Union["ISeq", ISequential], s2: Any) -> bool: return True +T_inner = TypeVar("T_inner") + + class ISeq(ILispObject, IPersistentCollection[T]): """``ISeq`` types represent a potentially infinite sequence of elements. @@ -733,7 +736,7 @@ class ISeq(ILispObject, IPersistentCollection[T]): __slots__ = () - class _SeqIter(Iterator[T]): + class _SeqIter(Iterator[T_inner]): """Stateful iterator for sequence types. This is primarily useful for avoiding blowing the stack on a long (or infinite) @@ -742,7 +745,7 @@ class _SeqIter(Iterator[T]): __slots__ = ("_cur",) - def __init__(self, seq: "ISeq[T]"): + def __init__(self, seq: "ISeq[T_inner]"): self._cur = seq def __next__(self): diff --git a/src/basilisp/lang/reader.py b/src/basilisp/lang/reader.py index 1a4692d3..0a815f20 100644 --- a/src/basilisp/lang/reader.py +++ b/src/basilisp/lang/reader.py @@ -162,7 +162,7 @@ def format_syntax_error( # pylint: disable=unused-argument context_exc: Optional[BaseException] = e.__cause__ - lines = [os.linesep] + lines: list[str] = [os.linesep] if context_exc is not None: lines.append(f" exception: {type(context_exc)} from {type(e)}{os.linesep}") else: