Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,15 @@ showcontent = false
directory = "removal"
name = "Removals and Deprecations"
showcontent = true


[tool.mypy]
files = "src"
mypy_path = "src"
namespace_packages = true

[[tool.mypy.overrides]]
module = [
"shellingham.nt" # Mypy complains that ctypes has no windll on non-Windows machines
]
ignore_errors = true
12 changes: 11 additions & 1 deletion src/shellingham/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import importlib
import os

Expand All @@ -6,7 +8,15 @@
__version__ = "1.5.4"


def detect_shell(pid=None, max_depth=10):
__all__ = [
"ShellDetectionFailure",
"detect_shell",
]


def detect_shell(
pid: int | None = None, max_depth: int = 10
) -> tuple[int, int]:
name = os.name
try:
impl = importlib.import_module(".{}".format(name), __name__)
Expand Down
Empty file added src/shellingham/py.typed
Empty file.
22 changes: 11 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
[tox]
envlist = py37, py38, py39, py310, py311, py312
envlist = py37, py38, py39, py310, py311, py312, test, typing

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312
3.7: py37, test, typing
3.8: py38, test
3.9: py39, test
3.10: py310, test
3.11: py311, test
3.12: py312, test, typing

[testenv]
allowlist_externals = pipenv
commands =
pipenv install --dev

[testenv:test]
deps =
pytest

[testenv:typing]
deps =
mypy
commands =
pytest
mypy