RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN with the following as its source: https://src.fedoraproject.org/rpms/python-toml#81771194d42eeddd742ea014b270604c0453368b
This commit is contained in:
parent
0a8ed0a02c
commit
676be5dd19
7
.gitignore
vendored
7
.gitignore
vendored
@ -0,0 +1,7 @@
|
|||||||
|
/toml-0.9.0.tar.gz
|
||||||
|
/toml-0.9.1.tar.gz
|
||||||
|
/toml-0.9.2.tar.gz
|
||||||
|
/toml-0.9.3.0.tar.gz
|
||||||
|
/toml-0.9.4.tar.gz
|
||||||
|
/toml-0.10.0.tar.gz
|
||||||
|
/toml-0.10.1.tar.gz
|
166
python-toml.spec
Normal file
166
python-toml.spec
Normal file
@ -0,0 +1,166 @@
|
|||||||
|
%global pypi_name toml
|
||||||
|
%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 \
|
||||||
|
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 \
|
||||||
|
toml file.
|
||||||
|
|
||||||
|
Name: python-%{pypi_name}
|
||||||
|
Version: 0.10.1
|
||||||
|
Release: 3%{?dist}
|
||||||
|
Summary: Python Library for Tom's Obvious, Minimal Language
|
||||||
|
|
||||||
|
License: MIT
|
||||||
|
URL: https://pypi.python.org/pypi/%{pypi_name}
|
||||||
|
Source0: %{pypi_source}
|
||||||
|
|
||||||
|
BuildArch: noarch
|
||||||
|
|
||||||
|
BuildRequires: python%{python3_pkgversion}-devel
|
||||||
|
BuildRequires: pyproject-rpm-macros
|
||||||
|
|
||||||
|
%bcond_without tests
|
||||||
|
%if %{with tests}
|
||||||
|
BuildRequires: /usr/bin/toml-test
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%description
|
||||||
|
%desc
|
||||||
|
|
||||||
|
|
||||||
|
%package -n python%{python3_pkgversion}-%{pypi_name}
|
||||||
|
Summary: %{summary}
|
||||||
|
%{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}}
|
||||||
|
|
||||||
|
%description -n python%{python3_pkgversion}-%{pypi_name}
|
||||||
|
%desc
|
||||||
|
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -p1 -n %{pypi_name}-%{version}
|
||||||
|
|
||||||
|
|
||||||
|
%generate_buildrequires
|
||||||
|
%pyproject_buildrequires %{?with_tests:-t}
|
||||||
|
|
||||||
|
|
||||||
|
%build
|
||||||
|
%pyproject_wheel
|
||||||
|
|
||||||
|
|
||||||
|
%install
|
||||||
|
%pyproject_install
|
||||||
|
%pyproject_save_files %{pypi_name}
|
||||||
|
|
||||||
|
|
||||||
|
%if %{with tests}
|
||||||
|
%check
|
||||||
|
ln -s /usr/share/toml-test/ . # python tests require test cases here
|
||||||
|
%tox
|
||||||
|
# Also using the language independent toml-test suite to launch tests
|
||||||
|
ln -s /usr/share/toml-test/tests/* tests/ # toml-test requires them here
|
||||||
|
toml-test $(pwd)/tests/decoding_test3.sh
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
|
%files -n python%{python3_pkgversion}-%{pypi_name} -f %{pyproject_files}
|
||||||
|
%license LICENSE
|
||||||
|
%doc README.rst
|
||||||
|
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* 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
|
||||||
|
- Subpackage python2-toml has been removed
|
||||||
|
See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
|
||||||
|
|
||||||
|
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-2
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sun Nov 25 2018 Julien Enselme <jujens@jujens.eu> - 0.10.0-1
|
||||||
|
- Update to 0.10.0 (#1652946)
|
||||||
|
|
||||||
|
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.4-5
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||||
|
|
||||||
|
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.9.4-4
|
||||||
|
- Rebuilt for Python 3.7
|
||||||
|
|
||||||
|
* Wed Feb 21 2018 Sayan Chowdhury <sayanchowdhury@fedoraproject.org> - 0.9.4-3
|
||||||
|
- Make changes to build the package for EPEL
|
||||||
|
|
||||||
|
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.4-2
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||||
|
|
||||||
|
* Wed Dec 27 2017 Julien Enselme <jujens@jujens.eu> - 0.9.4-1
|
||||||
|
- Update to 0.9.4
|
||||||
|
|
||||||
|
* Tue Sep 26 2017 Julien Enselme <jujens@jujens.eu> - 0.9.3-1
|
||||||
|
- Update to 0.9.3
|
||||||
|
|
||||||
|
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.2-4
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.2-3
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
||||||
|
|
||||||
|
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.9.2-2
|
||||||
|
- Rebuild for Python 3.6
|
||||||
|
|
||||||
|
* Thu Sep 01 2016 Julien Enselme <jujens@jujens.eu> - 0.9.2-1
|
||||||
|
- Update to 0.9.2
|
||||||
|
- Improve spec with %%summary and %%desc macros
|
||||||
|
|
||||||
|
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.1-7
|
||||||
|
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
|
||||||
|
|
||||||
|
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.1-6
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
||||||
|
|
||||||
|
* Wed Nov 11 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.1-5
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
|
||||||
|
|
||||||
|
* Mon Nov 9 2015 Julien Enselme <jujens@jujens.eu> - 0.9.1-4
|
||||||
|
- Correct %%python_provides for python3
|
||||||
|
|
||||||
|
* Thu Nov 5 2015 Julien Enselme <jujens@jujens.eu> - 0.9.1-3
|
||||||
|
- Rebuilt for python 3.5
|
||||||
|
|
||||||
|
* Sat Aug 8 2015 Julien Enselme <jujens@jujens.eu> - 0.9.1-2
|
||||||
|
- Enable tests suite
|
||||||
|
- Build python3 and python2 in the same directory
|
||||||
|
- Use %%py2_build, %%py3_build, %%py2_install and %%py2_install
|
||||||
|
- Move python2 package in its own subpackage
|
||||||
|
|
||||||
|
* Sat Jul 11 2015 Fedora Release Monitoring <release-monitoring@fedoraproject.org> - 0.9.1-1
|
||||||
|
- Update to 0.9.1 (#1242131)
|
||||||
|
|
||||||
|
* Sun Jun 28 2015 Julien Enselme <jujens@jujens.eu> - 0.9.0-2
|
||||||
|
- Update description to explain what toml is
|
||||||
|
- Try to import the package in %%check
|
||||||
|
|
||||||
|
* Mon Jun 15 2015 Julien Enselme <jujens@jujens.eu> - 0.9.0-1
|
||||||
|
- Initial packaging
|
1
sources
Normal file
1
sources
Normal file
@ -0,0 +1 @@
|
|||||||
|
SHA512 (toml-0.10.1.tar.gz) = 9dc813f84b56bee6519c70efe49a834d6695c82d429f0b7cc6e6153a1fb14d3fb627dea24df2d2664354f27108389d51475609272d59fc7e4b64a2c17d74f33f
|
26
tests/tests.yml
Normal file
26
tests/tests.yml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
- hosts: localhost
|
||||||
|
roles:
|
||||||
|
- role: standard-test-basic
|
||||||
|
tags:
|
||||||
|
- classic
|
||||||
|
repositories:
|
||||||
|
- repo: "https://src.fedoraproject.org/rpms/pyproject-rpm-macros.git"
|
||||||
|
dest: "pyproject-rpm-macros"
|
||||||
|
tests:
|
||||||
|
- pyproject_pytest:
|
||||||
|
dir: pyproject-rpm-macros/tests
|
||||||
|
run: ./mocktest.sh python-pytest
|
||||||
|
- pyproject_entrypoints:
|
||||||
|
dir: pyproject-rpm-macros/tests
|
||||||
|
run: ./mocktest.sh python-entrypoints
|
||||||
|
- pyproject_pluggy:
|
||||||
|
dir: pyproject-rpm-macros/tests
|
||||||
|
run: ./mocktest.sh python-pluggy
|
||||||
|
- pyproject_clikit:
|
||||||
|
dir: pyproject-rpm-macros/tests
|
||||||
|
run: ./mocktest.sh python-clikit
|
||||||
|
required_packages:
|
||||||
|
- mock
|
||||||
|
- rpmdevtools
|
||||||
|
- rpm-build
|
56
toml_test.py
Normal file
56
toml_test.py
Normal file
@ -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))
|
||||||
|
|
11
toml_test3.py
Normal file
11
toml_test3.py
Normal file
@ -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))
|
Loading…
Reference in New Issue
Block a user