]>
Commit | Line | Data |
---|---|---|
e1b15806 | 1 | # |
4f993e53 | 2 | # Conditional build: |
e1b15806 | 3 | %bcond_without tests # unit tests |
4f993e53 JP |
4 | %bcond_without python2 # CPython 2.x module |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | %define module toml | |
8 | Summary: Python Library for Tom's Obvious, Minimal Language | |
e1b15806 | 9 | Summary(pl.UTF-8): Pythonowa biblioteka do formatu TOML (Tom's Obvious, Minimal Language) |
4f993e53 JP |
10 | Name: python-%{module} |
11 | Version: 0.10.2 | |
08198dff | 12 | Release: 4 |
4f993e53 JP |
13 | License: MIT |
14 | Group: Libraries/Python | |
15 | #Source0Download: https://pypi.org/simple/toml/ | |
16 | Source0: https://files.pythonhosted.org/packages/source/t/toml/%{module}-%{version}.tar.gz | |
17 | # Source0-md5: 59bce5d8d67e858735ec3f399ec90253 | |
18 | URL: https://github.com/uiri/toml | |
19 | %if %{with python2} | |
20 | BuildRequires: python-modules >= 1:2.6 | |
21 | BuildRequires: python-setuptools | |
e1b15806 JB |
22 | %if %{with tests} |
23 | BuildRequires: python-pytest | |
24 | %endif | |
4f993e53 JP |
25 | %endif |
26 | %if %{with python3} | |
27 | BuildRequires: python3-modules >= 1:3.3 | |
28 | BuildRequires: python3-setuptools | |
e1b15806 JB |
29 | %if %{with tests} |
30 | BuildRequires: python3-pytest | |
31 | %endif | |
4f993e53 JP |
32 | %endif |
33 | BuildRequires: rpm-pythonprov | |
34 | BuildRequires: rpmbuild(macros) >= 1.714 | |
35 | Requires: python-modules >= 1:2.6 | |
36 | BuildArch: noarch | |
37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
38 | ||
39 | %description | |
40 | A Python library for parsing and creating TOML. | |
41 | ||
e1b15806 JB |
42 | %description -l pl.UTF-8 |
43 | Pythonowa biblioteka do analizy i tworzenia plików TOML. | |
44 | ||
4f993e53 JP |
45 | %package -n python3-%{module} |
46 | Summary: Python Library for Tom's Obvious, Minimal Language | |
e1b15806 | 47 | Summary(pl.UTF-8): Pythonowa biblioteka do formatu TOML (Tom's Obvious, Minimal Language) |
4f993e53 JP |
48 | Group: Libraries/Python |
49 | Requires: python3-modules >= 1:3.3 | |
50 | ||
51 | %description -n python3-%{module} | |
52 | A Python library for parsing and creating TOML. | |
53 | ||
e1b15806 JB |
54 | %description -n python3-%{module} -l pl.UTF-8 |
55 | Pythonowa biblioteka do analizy i tworzenia plików TOML. | |
56 | ||
4f993e53 JP |
57 | %prep |
58 | %setup -q -n %{module}-%{version} | |
59 | ||
60 | %build | |
61 | %if %{with python2} | |
62 | %py_build | |
e1b15806 JB |
63 | |
64 | %if %{with tests} | |
65 | # disable test_{valid,invalid}_tests: no toml-test/tests/{valid,invalid} data | |
66 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
67 | %{__python} -m pytest tests -k 'not (test_invalid_tests or test_valid_tests)' | |
68 | %endif | |
4f993e53 JP |
69 | %endif |
70 | ||
71 | %if %{with python3} | |
72 | %py3_build | |
e1b15806 JB |
73 | |
74 | %if %{with tests} | |
75 | # disable test_{valid,invalid}_tests: no toml-test/tests/{valid,invalid} data | |
76 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
77 | %{__python3} -m pytest tests -k 'not (test_invalid_tests or test_valid_tests)' | |
78 | %endif | |
4f993e53 JP |
79 | %endif |
80 | ||
81 | %install | |
82 | rm -rf $RPM_BUILD_ROOT | |
83 | ||
84 | %if %{with python2} | |
85 | %py_install | |
86 | ||
87 | %py_postclean | |
88 | %endif | |
89 | ||
90 | %if %{with python3} | |
91 | %py3_install | |
92 | %endif | |
93 | ||
94 | %clean | |
95 | rm -rf $RPM_BUILD_ROOT | |
96 | ||
97 | %if %{with python2} | |
98 | %files | |
99 | %defattr(644,root,root,755) | |
e1b15806 | 100 | %doc LICENSE README.rst test.toml |
4f993e53 JP |
101 | %{py_sitescriptdir}/%{module} |
102 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
103 | %endif | |
104 | ||
105 | %if %{with python3} | |
106 | %files -n python3-%{module} | |
107 | %defattr(644,root,root,755) | |
e1b15806 | 108 | %doc LICENSE README.rst test.toml |
4f993e53 JP |
109 | %{py3_sitescriptdir}/%{module} |
110 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
111 | %endif |