-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython-typer.spec
More file actions
85 lines (74 loc) · 2.87 KB
/
python-typer.spec
File metadata and controls
85 lines (74 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
%define module typer
# disable tests on abf, passing locally.
%bcond tests 1
Name: python-typer
Version: 0.26.4
Release: 1
Summary: Typer, build great CLIs. Easy to code. Based on Python type hints
License: MIT
Group: Development/Python
URL: https://github.com/fastapi/typer
Source0: %{URL}/archive/%{version}/%{name}-%{version}.tar.gz
BuildSystem: python
BuildArch: noarch
BuildRequires: pkgconfig(python)
BuildRequires: python%{pyver}dist(annotated-doc)
BuildRequires: python%{pyver}dist(pdm-backend)
BuildRequires: python%{pyver}dist(pip)
BuildRequires: python%{pyver}dist(rich)
BuildRequires: python%{pyver}dist(shellingham)
BuildRequires: python%{pyver}dist(wheel)
%if %{with tests}
BuildRequires: procps-ng
BuildRequires: python%{pyver}dist(pytest)
BuildRequires: python%{pyver}dist(pytest-cov)
BuildRequires: python%{pyver}dist(pytest-xdist)
%endif
# python-typer binary name-conflict with ErLang TyPer application
Conflicts: erlang
# typer-slim is obsoleted upstream and is only a wrapper around typer,
# meaning we have no reason to have duplicated packages.
%rename python-typer-slim
%description
Typer is a library for building CLI applications that users will love using
and developers will love creating. Based on Python type hints.
It's also a command line tool to run scripts, automatically converting them
to CLI applications.
%prep -a
# LLM crap
rm -rf typer/.agents
%install -a
install -d '%{buildroot}%{_datadir}/bash-completion/completions' \
'%{buildroot}%{_datadir}/fish/vendor_completions.d' \
'%{buildroot}%{_datadir}/zsh/site-functions/'
export PYTHONPATH="%{buildroot}%{python_sitelib}"
export _TYPER_COMPLETE_TEST_DISABLE_SHELL_DETECTION=1
'%{buildroot}%{_bindir}/typer' --show-completion bash \
> '%{buildroot}%{_datadir}/bash-completion/completions/typer'
'%{buildroot}%{_bindir}/typer' --show-completion fish \
> '%{buildroot}%{_datadir}/fish/vendor_completions.d/typer.fish'
'%{buildroot}%{_bindir}/typer' --show-completion zsh \
> '%{buildroot}%{_datadir}/zsh/site-functions/_typer'
%if %{with tests}
%check
export CI=true
export PYTHONPATH="%{buildroot}%{python_sitelib}"
# Env variables taken from scripts/test.sh
export TERMINAL_WIDTH=3000
export _TYPER_FORCE_DISABLE_TERMINAL=1
export _TYPER_RUN_INSTALL_COMPLETION_TESTS=1
# These cannot find the typer package because the tests override PYTHONPATH.
ignore="${ignore-} --ignore=tests/test_tutorial/test_subcommands/test_tutorial001.py"
ignore="${ignore-} --ignore=tests/test_tutorial/test_subcommands/test_tutorial003.py"
# skip this test as it fails in isolated builds
skiptests+="not test_binary_stderr"
pytest -rs --no-cov ${ignore} -k "$skiptests"
%endif
%files
%doc README.md
%{_bindir}/typer
%{_datadir}/bash-completion/completions/%{module}
%{_datadir}/fish/vendor_completions.d/%{module}.fish
%{_datadir}/zsh/site-functions/_%{module}
%{python_sitelib}/%{module}
%{python_sitelib}/%{module}-%{version}.dist-info