]>
Commit | Line | Data |
---|---|---|
7dc2f964 | 1 | # |
781cfd24 | 2 | # Conditional build: |
c088d166 | 3 | %bcond_with tests # unit tests (testing by python2 fails) |
781cfd24 | 4 | %bcond_without python2 # CPython 2.x module |
c088d166 | 5 | %bcond_with python3 # CPython 3.x module (for Python < 3.5) |
781cfd24 AM |
6 | |
7 | %define module typing | |
8 | %define egg_name typing | |
9 | %define pypi_name typing | |
10 | Summary: Type Hints for Python | |
c088d166 | 11 | Summary(pl.UTF-8): Podpowiedzi typów dla Pythona |
781cfd24 | 12 | Name: python-%{pypi_name} |
30efb1ed | 13 | Version: 3.7.4.1 |
ae01644e | 14 | Release: 2 |
30efb1ed | 15 | License: PSF v2 |
781cfd24 | 16 | Group: Libraries/Python |
c088d166 JB |
17 | #Source0Download: https://pypi.org/simple/typing/ |
18 | Source0: https://files.pythonhosted.org/packages/source/t/typing/%{pypi_name}-%{version}.tar.gz | |
30efb1ed | 19 | # Source0-md5: 0a1ebd4af65b4769e33459004eb20345 |
c088d166 | 20 | URL: https://pypi.org/project/typing/ |
781cfd24 AM |
21 | BuildRequires: rpm-pythonprov |
22 | BuildRequires: rpmbuild(macros) >= 1.714 | |
23 | %if %{with python2} | |
c088d166 | 24 | BuildRequires: python-modules >= 1:2.7 |
781cfd24 AM |
25 | BuildRequires: python-setuptools |
26 | %endif | |
27 | %if %{with python3} | |
30efb1ed | 28 | BuildRequires: python3-modules >= 1:3.4 |
c088d166 | 29 | BuildRequires: python3-modules < 1:3.5 |
781cfd24 AM |
30 | BuildRequires: python3-setuptools |
31 | %endif | |
c088d166 | 32 | Requires: python-modules >= 1:2.7 |
781cfd24 AM |
33 | BuildArch: noarch |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
36 | %description | |
781cfd24 AM |
37 | Typing defines a standard notation for Python function and variable |
38 | type annotations. The notation can be used for documenting code in a | |
39 | concise, standard format, and it has been designed to also be used by | |
40 | static and runtime type checkers, static analyzers, IDEs and other | |
41 | tools. | |
42 | ||
c088d166 JB |
43 | %description -l pl.UTF-8 |
44 | Typing definiuje standardową notację opisów typów funkcji i zmiennych | |
45 | w Pythonie. Notacja może być używana do dokumentowania kodu w | |
46 | zwięzłym, standardowym formacie; została zaprojektowana także z myślą | |
47 | o używaniu przez narzędzia do statycznego i dynamicznego sprawdzania | |
48 | typów, analizatory statyczne, IDE i inne narzędzia. | |
49 | ||
50 | %package -n python3-%{pypi_name} | |
781cfd24 | 51 | Summary: Type Hints for Python |
c088d166 | 52 | Summary(pl.UTF-8): Podpowiedzi typów dla Pythona |
781cfd24 | 53 | Group: Libraries/Python |
30efb1ed | 54 | Requires: python3-modules >= 1:3.5 |
781cfd24 | 55 | |
c088d166 | 56 | %description -n python3-%{pypi_name} |
781cfd24 AM |
57 | Typing defines a standard notation for Python function and variable |
58 | type annotations. The notation can be used for documenting code in a | |
59 | concise, standard format, and it has been designed to also be used by | |
60 | static and runtime type checkers, static analyzers, IDEs and other | |
61 | tools. | |
62 | ||
c088d166 JB |
63 | %description -n python3-%{pypi_name} -l pl.UTF-8 |
64 | Typing definiuje standardową notację opisów typów funkcji i zmiennych | |
65 | w Pythonie. Notacja może być używana do dokumentowania kodu w | |
66 | zwięzłym, standardowym formacie; została zaprojektowana także z myślą | |
67 | o używaniu przez narzędzia do statycznego i dynamicznego sprawdzania | |
68 | typów, analizatory statyczne, IDE i inne narzędzia. | |
69 | ||
781cfd24 AM |
70 | %prep |
71 | %setup -q -n %{pypi_name}-%{version} | |
72 | ||
73 | %build | |
74 | %if %{with python2} | |
c088d166 JB |
75 | %py_build |
76 | ||
77 | %if %{with tests} | |
78 | PYTHONPATH=$(pwd)/src \ | |
79 | %{__python} -m unittest discover -s src | |
80 | %endif | |
781cfd24 AM |
81 | %endif |
82 | ||
83 | %if %{with python3} | |
c088d166 JB |
84 | %py3_build |
85 | ||
86 | %if %{with tests} | |
87 | PYTHONPATH=$(pwd)/src \ | |
88 | %{__python3} -m unittest discover -s src | |
89 | %endif | |
781cfd24 AM |
90 | %endif |
91 | ||
92 | %install | |
93 | rm -rf $RPM_BUILD_ROOT | |
94 | ||
95 | %if %{with python2} | |
96 | %py_install | |
c088d166 | 97 | |
781cfd24 AM |
98 | %py_postclean |
99 | %endif | |
100 | ||
101 | %if %{with python3} | |
102 | %py3_install | |
103 | %endif | |
104 | ||
105 | %clean | |
106 | rm -rf $RPM_BUILD_ROOT | |
107 | ||
108 | %if %{with python2} | |
109 | %files | |
110 | %defattr(644,root,root,755) | |
c088d166 JB |
111 | %doc README.rst |
112 | %{py_sitescriptdir}/%{module}.py[co] | |
781cfd24 AM |
113 | %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info |
114 | %endif | |
115 | ||
116 | %if %{with python3} | |
c088d166 | 117 | %files -n python3-%{pypi_name} |
781cfd24 | 118 | %defattr(644,root,root,755) |
c088d166 | 119 | %doc README.rst |
781cfd24 | 120 | %{py3_sitescriptdir}/%{module}.py |
781cfd24 | 121 | %{py3_sitescriptdir}/__pycache__/%{module}.cpython*.pyc |
c088d166 | 122 | %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info |
781cfd24 | 123 | %endif |