Skip to content

Commit 21abbeb

Browse files
committed
remove stdin support
1 parent 0d4a091 commit 21abbeb

2 files changed

Lines changed: 5 additions & 14 deletions

File tree

licensecheck/io/cli.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from enum import Enum
88
from pathlib import Path
99
from sys import exit as sysexit
10-
from sys import stdin, stdout
10+
from sys import stdout
1111

1212
from configurator import Config
1313
from configurator.node import ConfigNode
@@ -44,7 +44,7 @@ def cli() -> None: # pragma: no cover
4444
parser.add_argument(
4545
"--requirements-paths",
4646
"-r",
47-
help="Filenames to read from (omit for stdin if piping, else pyproject.toml)",
47+
help="Filenames to read from (default=pyproject.toml)",
4848
nargs="+",
4949
)
5050
parser.add_argument(
@@ -116,16 +116,8 @@ def cli() -> None: # pragma: no cover
116116
)
117117
args = vars(parser.parse_args())
118118

119-
stdin_path = Path("__stdin__")
120119
if not args.get("requirements_paths"):
121-
if stdin.isatty():
122-
args["requirements_paths"] = ["pyproject.toml"]
123-
else:
124-
lines = stdin.readlines()
125-
if lines:
126-
stdin_path.write_text("\n".join(lines), encoding="utf-8")
127-
else:
128-
args["requirements_paths"] = ["pyproject.toml"]
120+
args["requirements_paths"] = ["pyproject.toml"]
129121

130122
config: ConfigNode = Config()
131123

@@ -145,7 +137,6 @@ def cli() -> None: # pragma: no cover
145137
licensecheckConf: LC_Config = LC_Config.model_validate({**scopedData.data, **args})
146138

147139
ec = main(licensecheckConf)
148-
stdin_path.unlink(missing_ok=True)
149140

150141
sysexit(ec.value)
151142

@@ -155,7 +146,7 @@ def main(licensecheckConf: LC_Config) -> ExitCode:
155146
exitCode = ExitCode.SUCCESS
156147

157148
# File
158-
requirements_paths = licensecheckConf.requirements_paths or {"__stdin__"}
149+
requirements_paths = licensecheckConf.requirements_paths
159150
output_file = (
160151
stdout
161152
if licensecheckConf.file == ""

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "licensecheck"
3-
version = "2026.0.7"
3+
version = "2026.0.8"
44
description = "Output the licenses used by dependencies and check if these are compatible with the project license"
55
authors = [{ name = "FredHappyface" }]
66
requires-python = ">=3.12"

0 commit comments

Comments
 (0)