Skip to content

Commit

Permalink
Merge pull request #5 from jorenham/dependency-updates
Browse files Browse the repository at this point in the history
update development dependencies
  • Loading branch information
jorenham authored Aug 19, 2024
2 parents fbe4884 + 2e08b55 commit 3839da5
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 65 deletions.
23 changes: 12 additions & 11 deletions exports/__init__.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
from __future__ import annotations

import contextlib
import inspect
import threading
import warnings
from collections.abc import Sequence
from typing import (
Any,
Callable,
Final,
Sequence,
cast,
overload,
TypeVar,
Union,
cast,
overload,
)


_T = TypeVar('_T', bound=Union[Callable[..., Any], type, object])
_V = TypeVar('_V')

Expand All @@ -25,11 +26,9 @@ def _identity(_obj: _V) -> _V:


@overload
def export(obj: str, *, threadsafe: bool = ...) -> Callable[[_T], _T]: ...
def export(__obj: str, *, threadsafe: bool = ...) -> Callable[[_T], _T]: ...
@overload
def export(obj: _T, *, threadsafe: bool = ...) -> _T: ...


def export(__obj: _T, *, threadsafe: bool = ...) -> _T: ...
def export(
obj: Union[_T, str],
*,
Expand Down Expand Up @@ -93,9 +92,11 @@ def export(

with _lock if threadsafe else contextlib.nullcontext():
if hasattr(module, '__all__'):
if not isinstance(module.__all__, list):
setattr(module, '__all__', list(module.__all__))
exports = list(cast(Sequence[str], module.__all__[:]))
all_list: Sequence[str] = module.__all__
if not isinstance(all_list, list):
all_list = list(all_list)
setattr(module,'__all__', all_list)
exports = list(all_list[:])
else:
setattr(module, '__all__', [])
exports = []
Expand Down
77 changes: 29 additions & 48 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,14 @@ authors = ["Joren Hammudoglu <jhammudoglu@gmail.com>"]
license = "MIT"
readme = "README.md"
repository = "https://github.com/jorenham/exports"
packages = [
{ include = "exports" }
]

[tool.poetry.dependencies]
python = "^3.8"

[tool.poetry.group.dev.dependencies]
pytest = "^7.4"
pyright = "^1.1"
codespell = "^2.2.6"
pytest = "^8.3.2"
pyright = "^1.1.376"
codespell = "^2.3.0"

[tool.pyright]
include = ["exports"]
Expand Down

0 comments on commit 3839da5

Please sign in to comment.