Skip to content
Merged
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
6 changes: 5 additions & 1 deletion linters/ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ ignore = [
[lint.isort]
# Import sorting configuration.
split-on-trailing-comma = false
known-first-party = ["src"]
known-first-party = ["shpyx"]
combine-as-imports = true

[lint.pydocstyle]
Expand All @@ -117,6 +117,10 @@ classmethod-decorators = ["classmethod", "pydantic.field_validator"]
# Ignore list of builtin names.
builtins-ignorelist = ["id"]

[lint.flake8-tidy-imports]
# Enforce absolute imports (TID252 only bans parent-relative by default).
ban-relative-imports = "all"

# Per file ignores.
[lint.per-file-ignores]
"tests/*" = [
Expand Down
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ requires = ["hatchling"]

[project]
name = "shpyx"
version = "0.0.35"
version = "0.0.36"
description = "Run shell commands in Python"
authors = [{name = "Yossi Rozantsev"}]
license = {text = "MIT"}
Expand Down Expand Up @@ -34,8 +34,5 @@ homepage = "https://github.com/Apakottur/shpyx"
repository = "https://github.com/Apakottur/shpyx"
documentation = "https://github.com/Apakottur/shpyx"

[tool.hatch.build.targets.wheel]
packages = ["shpyx"]

[tool.uv]
package = true
12 changes: 0 additions & 12 deletions src/__init__.py

This file was deleted.

12 changes: 12 additions & 0 deletions src/shpyx/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from shpyx.errors import ShpyxInternalError, ShpyxOSNotSupportedError, ShpyxVerificationError
from shpyx.result import ShellCmdResult
from shpyx.runner import Runner, run

__all__ = [
"Runner",
"ShellCmdResult",
"ShpyxInternalError",
"ShpyxOSNotSupportedError",
"ShpyxVerificationError",
"run",
]
2 changes: 1 addition & 1 deletion src/errors.py → src/shpyx/errors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from src.result import ShellCmdResult
from shpyx.result import ShellCmdResult


class ShpyxError(Exception):
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/runner.py → src/shpyx/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from collections.abc import Callable
from typing import TYPE_CHECKING

from src.errors import ShpyxInternalError, ShpyxOSNotSupportedError, ShpyxVerificationError
from src.result import ShellCmdResult
from shpyx.errors import ShpyxInternalError, ShpyxOSNotSupportedError, ShpyxVerificationError
from shpyx.result import ShellCmdResult

if TYPE_CHECKING:
from pathlib import Path
Expand Down
2 changes: 1 addition & 1 deletion tests/fake_proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ def patch_fake_proc(
stderr_chunks: list[bytes],
) -> None:
proc = _FakeProc(stdout_chunks, stderr_chunks or [])
mocker.patch("src.runner.subprocess.Popen", return_value=proc)
mocker.patch("shpyx.runner.subprocess.Popen", return_value=proc)
2 changes: 1 addition & 1 deletion tests/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ addopts =
# Coverage configuration
--cov-branch
--cov-config=tests/pytest.ini
--cov=src
--cov=shpyx
--cov-report=term-missing:skip-covered
--cov-fail-under=100
--no-cov-on-fail
Expand Down
4 changes: 2 additions & 2 deletions tests/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import pytest
import pytest_mock

import src as shpyx
import shpyx

# Platform OS.
_SYSTEM = platform.system()
Expand Down Expand Up @@ -196,7 +196,7 @@ def _popen(*args: Any, **kwargs: Any) -> Any:
p.stderr = None
return p

mocker.patch("src.runner.subprocess.Popen", _popen)
mocker.patch("shpyx.runner.subprocess.Popen", _popen)

with pytest.raises(shpyx.ShpyxInternalError) as exc:
shpyx.run("echo 1")
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

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

Loading