Compare commits

...

No commits in common. 'c9' and 'i8ce' have entirely different histories.
c9 ... i8ce

2
.gitignore vendored

@ -1 +1 @@
SOURCES/toml-0.10.2.tar.gz SOURCES/toml-0.10.0.tar.gz

@ -1 +1 @@
00137fc72f31100edd1c03670081b03053b6c836 SOURCES/toml-0.10.2.tar.gz 53ac05074977ec92c5a3559d91c7cc9de649a440 SOURCES/toml-0.10.0.tar.gz

@ -0,0 +1,56 @@
#!/usr/bin/env python2
import datetime
import json
import sys
import toml
try:
_range = xrange
iteritems = dict.iteritems
except NameError:
unicode = str
_range = range
basestring = str
unichr = chr
iteritems = dict.items
long = int
def tag(value):
if isinstance(value, dict):
d = { }
for k, v in iteritems(value):
d[k] = tag(v)
return d
elif isinstance(value, list):
a = []
for v in value:
a.append(tag(v))
try:
a[0]["value"]
except KeyError:
return a
except IndexError:
pass
return {'type': 'array', 'value': a}
elif isinstance(value, basestring):
return {'type': 'string', 'value': value}
elif isinstance(value, bool):
return {'type': 'bool', 'value': str(value).lower()}
elif isinstance(value, int):
return {'type': 'integer', 'value': str(value)}
elif isinstance(value, long):
return {'type': 'integer', 'value': str(value)}
elif isinstance(value, float):
return {'type': 'float', 'value': repr(value)}
elif isinstance(value, datetime.datetime):
sdate = value.strftime('%Y-%m-%dT%H:%M:%SZ')
return {'type': 'datetime', 'value': sdate}
assert False, 'Unknown type: %s' % type(value)
if __name__ == '__main__':
tdata = toml.loads(sys.stdin.read())
tagged = tag(tdata)
print(json.dumps(tagged))

@ -0,0 +1,11 @@
#!/usr/bin/env python3
import toml_test
import toml
import sys
import json
if __name__ == '__main__':
tdata = toml.loads(sys.stdin.read())
tagged = toml_test.tag(tdata)
print(json.dumps(tagged))

@ -1,127 +1,82 @@
# Disable tests on RHEL9 as to not pull in the test dependencies
# Specify --with tests to run the tests e.g. on EPEL
%bcond_with tests
%global pypi_name toml %global pypi_name toml
%global with_test 0
%global desc TOML aims to be a minimal configuration file format that's easy to read due to \ %global desc TOML aims to be a minimal configuration file format that's easy to read due to \
obvious semantics. TOML is designed to map unambiguously to a hash table. TOML \ obvious semantics. TOML is designed to map unambiguously to a hash table. TOML \
should be easy to parse into data structures in a wide variety of languages. \ should be easy to parse into data structures in a wide variety of languages. \
This package loads toml file into python dictionary and dump dictionary into \ This package loads toml file into python dictionary and dump dictionary into \
toml file. toml file.
%if 0%{?fedora}
%global with_test 0
%endif
Name: python-%{pypi_name} Name: python-%{pypi_name}
Version: 0.10.2 Version: 0.10.0
Release: 6%{?dist} Release: 3%{?dist}
Summary: Python Library for Tom's Obvious, Minimal Language Summary: Python Library for Tom's Obvious, Minimal Language
License: MIT License: MIT
URL: https://pypi.python.org/pypi/%{pypi_name} URL: https://pypi.python.org/pypi/%{pypi_name}
Source0: %{pypi_source} Source0: https://files.pythonhosted.org/packages/b9/19/5cbd78eac8b1783671c40e34bb0fa83133a06d340a38b55c645076d40094/toml-0.10.0.tar.gz
# Tests files are not provided in pypi release as they require toml-test to run
Source1: https://raw.githubusercontent.com/uiri/toml/da6d593944d08569e08ff32f2bb2e73da91d3578/toml_test.py
Source2: https://raw.githubusercontent.com/uiri/toml/da6d593944d08569e08ff32f2bb2e73da91d3578/toml_test3.py
BuildArch: noarch BuildArch: noarch
BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: pyproject-rpm-macros %if 0%{with_test}
BuildRequires: golang-github-BurntSushi-toml-test
%if %{with tests}
BuildRequires: /usr/bin/toml-test
%endif %endif
%description %description
%desc %desc
%package -n python%{python3_pkgversion}-%{pypi_name} %package -n python%{python3_pkgversion}-%{pypi_name}
Summary: %{summary} Summary: %{summary}
BuildRequires: python%{python3_pkgversion}-devel
%{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}} %{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}}
%description -n python%{python3_pkgversion}-%{pypi_name} %description -n python%{python3_pkgversion}-%{pypi_name}
%desc %desc
%prep %prep
%autosetup -p1 -n %{pypi_name}-%{version} %setup -q -n %{pypi_name}-%{version}
# https://github.com/uiri/toml/pull/339 %if 0%{with_test}
sed -i '/pytest-cov/d' tox.ini # Copy test files and make them executable so toml-test can work
cp -a %{SOURCE1} %{SOURCE2} .
chmod +x toml_test.py toml_test3.py
%generate_buildrequires %endif
%pyproject_buildrequires %{?with_tests:-t}
%build %build
%pyproject_wheel %py3_build
%install %install
%pyproject_install %py3_install
%pyproject_save_files %{pypi_name}
%if %{with tests}
%check %check
ln -s /usr/share/toml-test/ . # python tests require test cases here # Using the language independent toml-test suite to launch tests
%tox # link the the tests files
# Also using the language independent toml-test suite to launch tests %if 0%{with_test}
ln -s /usr/share/toml-test/tests/* tests/ # toml-test requires them here ln -s /usr/share/toml-test/tests tests
toml-test $(pwd)/tests/decoding_test3.sh toml-test $(pwd)/toml_test.py
toml-test $(pwd)/toml_test3.py
%endif %endif
%files -n python%{python3_pkgversion}-%{pypi_name} -f %{pyproject_files} %files -n python%{python3_pkgversion}-%{pypi_name}
%license LICENSE %license LICENSE
%doc README.rst %doc README.rst
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
%{python3_sitelib}/%{pypi_name}/
%changelog %changelog
* Tue Feb 08 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 0.10.2-6 * Mon Jan 15 2024 Sergey Cherevko <s.cherevko@msvsphere-os.ru> - 0.10.0-3
- Add automatically generated Obsoletes tag with the python39- prefix - Rebuilt for MSVSphere 8.9
for smoother upgrade from RHEL8
- Related: rhbz#1990421
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 0.10.2-5
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 0.10.2-4
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Wed Mar 10 2021 Charalampos Stratakis <cstratak@redhat.com> - 0.10.2-3
- Disable tests on RHEL9 to avoid pulling in the test dependencies
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Nov 23 2020 Miro Hrončok <mhroncok@redhat.com> - 0.10.2-1
- Update to 0.10.2
- Fixes: rhbz#1893498
* Fri Nov 13 2020 Miro Hrončok <mhroncok@redhat.com> - 0.10.1-4
- Don't BR pytest-cov
* Thu Sep 03 2020 Miro Hrončok <mhroncok@redhat.com> - 0.10.1-3
- Use pyproject-rpm-macros
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri Jun 19 2020 Miro Hrončok <mhroncok@redhat.com> - 0.10.1-1
- Update to 0.10.1 (#1835567)
* Sat May 23 2020 Miro Hrončok <mhroncok@redhat.com> - 0.10.0-8
- Rebuilt for Python 3.9
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.10.0-6
- Rebuilt for Python 3.8.0rc1 (#1748018)
* Fri Aug 16 2019 Miro Hrončok <mhroncok@redhat.com> - 0.10.0-5
- Rebuilt for Python 3.8
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Mon Feb 11 2019 Miro Hrončok <mhroncok@redhat.com> - 0.10.0-3 * Mon Feb 11 2019 Miro Hrončok <mhroncok@redhat.com> - 0.10.0-3
- Subpackage python2-toml has been removed - Subpackage python2-toml has been removed

Loading…
Cancel
Save