]> git.pld-linux.org Git - packages/python-toml.git/blob - python-toml.spec
rebuild with python 3.10
[packages/python-toml.git] / python-toml.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # unit tests
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
9 Summary(pl.UTF-8):      Pythonowa biblioteka do formatu TOML (Tom's Obvious, Minimal Language)
10 Name:           python-%{module}
11 Version:        0.10.2
12 Release:        3
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
22 %if %{with tests}
23 BuildRequires:  python-pytest
24 %endif
25 %endif
26 %if %{with python3}
27 BuildRequires:  python3-modules >= 1:3.3
28 BuildRequires:  python3-setuptools
29 %if %{with tests}
30 BuildRequires:  python3-pytest
31 %endif
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
42 %description -l pl.UTF-8
43 Pythonowa biblioteka do analizy i tworzenia plików TOML.
44
45 %package -n python3-%{module}
46 Summary:        Python Library for Tom's Obvious, Minimal Language
47 Summary(pl.UTF-8):      Pythonowa biblioteka do formatu TOML (Tom's Obvious, Minimal Language)
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
54 %description -n python3-%{module} -l pl.UTF-8
55 Pythonowa biblioteka do analizy i tworzenia plików TOML.
56
57 %prep
58 %setup -q -n %{module}-%{version}
59
60 %build
61 %if %{with python2}
62 %py_build
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
69 %endif
70
71 %if %{with python3}
72 %py3_build
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
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)
100 %doc LICENSE README.rst test.toml
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)
108 %doc LICENSE README.rst test.toml
109 %{py3_sitescriptdir}/%{module}
110 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
111 %endif
This page took 0.02713 seconds and 3 git commands to generate.