15
0
forked from pool/python-json5
Files
python-json5/python-json5.spec

112 lines
3.3 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python-json5
#
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
Accepting request 794581 from home:pgajdos:python - version update to 0.9.4 * v0.9.4 (2020-03-26) * [GitHub pull #38](https://github.com/dpranke/pyjson5/pull/38) Fix from fredrik@fornwall.net for dumps() crashing when passed an empty string as a key in an object. * v0.9.3 (2020-03-17) * [GitHub pull #35](https://github.com/dpranke/pyjson5/pull/35) Fix from pastelmind@ for dump() not passing the right args to dumps(). * Fix from p.skouzos@novafutur.com to remove the tests directory from the setup call, making the package a bit smaller. * v0.9.2 (2020-03-02) * [GitHub pull #34](https://github.com/dpranke/pyjson5/pull/34) Fix from roosephu@ for a badly formatted nested list. * v0.9.1 (2020-02-09) * [GitHub issue #33](https://github.com/dpranke/pyjson5/issues/33): Fix stray trailing comma when dumping an object with an invalid key. * v0.9.0 (2020-01-30) * [GitHub issue #29](https://github.com/dpranke/pyjson5/issues/29): Fix an issue where objects keys that started with a reserved word were incorrectly quoted. * [GitHub issue #30](https://github.com/dpranke/pyjson5/issues/30): Fix an issue where dumps() incorrectly thought a data structure was cyclic in some cases. * [GitHub issue #32](https://github.com/dpranke/pyjson5/issues/32): Allow for non-string keys in dicts passed to ``dump()``/``dumps()``. Add an ``allow_duplicate_keys=False`` to prevent possible ill-formed JSON that might result. OBS-URL: https://build.opensuse.org/request/show/794581 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-json5?expand=0&rev=3
2020-04-16 12:10:46 +00:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
#
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-json5
Version: 0.9.6
Release: 0
Summary: A Python implementation of the JSON5 data format
Accepting request 794581 from home:pgajdos:python - version update to 0.9.4 * v0.9.4 (2020-03-26) * [GitHub pull #38](https://github.com/dpranke/pyjson5/pull/38) Fix from fredrik@fornwall.net for dumps() crashing when passed an empty string as a key in an object. * v0.9.3 (2020-03-17) * [GitHub pull #35](https://github.com/dpranke/pyjson5/pull/35) Fix from pastelmind@ for dump() not passing the right args to dumps(). * Fix from p.skouzos@novafutur.com to remove the tests directory from the setup call, making the package a bit smaller. * v0.9.2 (2020-03-02) * [GitHub pull #34](https://github.com/dpranke/pyjson5/pull/34) Fix from roosephu@ for a badly formatted nested list. * v0.9.1 (2020-02-09) * [GitHub issue #33](https://github.com/dpranke/pyjson5/issues/33): Fix stray trailing comma when dumping an object with an invalid key. * v0.9.0 (2020-01-30) * [GitHub issue #29](https://github.com/dpranke/pyjson5/issues/29): Fix an issue where objects keys that started with a reserved word were incorrectly quoted. * [GitHub issue #30](https://github.com/dpranke/pyjson5/issues/30): Fix an issue where dumps() incorrectly thought a data structure was cyclic in some cases. * [GitHub issue #32](https://github.com/dpranke/pyjson5/issues/32): Allow for non-string keys in dicts passed to ``dump()``/``dumps()``. Add an ``allow_duplicate_keys=False`` to prevent possible ill-formed JSON that might result. OBS-URL: https://build.opensuse.org/request/show/794581 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-json5?expand=0&rev=3
2020-04-16 12:10:46 +00:00
License: Apache-2.0
Group: Development/Languages/Python
Accepting request 794581 from home:pgajdos:python - version update to 0.9.4 * v0.9.4 (2020-03-26) * [GitHub pull #38](https://github.com/dpranke/pyjson5/pull/38) Fix from fredrik@fornwall.net for dumps() crashing when passed an empty string as a key in an object. * v0.9.3 (2020-03-17) * [GitHub pull #35](https://github.com/dpranke/pyjson5/pull/35) Fix from pastelmind@ for dump() not passing the right args to dumps(). * Fix from p.skouzos@novafutur.com to remove the tests directory from the setup call, making the package a bit smaller. * v0.9.2 (2020-03-02) * [GitHub pull #34](https://github.com/dpranke/pyjson5/pull/34) Fix from roosephu@ for a badly formatted nested list. * v0.9.1 (2020-02-09) * [GitHub issue #33](https://github.com/dpranke/pyjson5/issues/33): Fix stray trailing comma when dumping an object with an invalid key. * v0.9.0 (2020-01-30) * [GitHub issue #29](https://github.com/dpranke/pyjson5/issues/29): Fix an issue where objects keys that started with a reserved word were incorrectly quoted. * [GitHub issue #30](https://github.com/dpranke/pyjson5/issues/30): Fix an issue where dumps() incorrectly thought a data structure was cyclic in some cases. * [GitHub issue #32](https://github.com/dpranke/pyjson5/issues/32): Allow for non-string keys in dicts passed to ``dump()``/``dumps()``. Add an ``allow_duplicate_keys=False`` to prevent possible ill-formed JSON that might result. OBS-URL: https://build.opensuse.org/request/show/794581 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-json5?expand=0&rev=3
2020-04-16 12:10:46 +00:00
URL: https://github.com/dpranke/pyjson5
Source: https://github.com/dpranke/pyjson5/archive/v%{version}.tar.gz#/pyjson5-%{version}.tar.gz
Accepting request 794581 from home:pgajdos:python - version update to 0.9.4 * v0.9.4 (2020-03-26) * [GitHub pull #38](https://github.com/dpranke/pyjson5/pull/38) Fix from fredrik@fornwall.net for dumps() crashing when passed an empty string as a key in an object. * v0.9.3 (2020-03-17) * [GitHub pull #35](https://github.com/dpranke/pyjson5/pull/35) Fix from pastelmind@ for dump() not passing the right args to dumps(). * Fix from p.skouzos@novafutur.com to remove the tests directory from the setup call, making the package a bit smaller. * v0.9.2 (2020-03-02) * [GitHub pull #34](https://github.com/dpranke/pyjson5/pull/34) Fix from roosephu@ for a badly formatted nested list. * v0.9.1 (2020-02-09) * [GitHub issue #33](https://github.com/dpranke/pyjson5/issues/33): Fix stray trailing comma when dumping an object with an invalid key. * v0.9.0 (2020-01-30) * [GitHub issue #29](https://github.com/dpranke/pyjson5/issues/29): Fix an issue where objects keys that started with a reserved word were incorrectly quoted. * [GitHub issue #30](https://github.com/dpranke/pyjson5/issues/30): Fix an issue where dumps() incorrectly thought a data structure was cyclic in some cases. * [GitHub issue #32](https://github.com/dpranke/pyjson5/issues/32): Allow for non-string keys in dicts passed to ``dump()``/``dumps()``. Add an ``allow_duplicate_keys=False`` to prevent possible ill-formed JSON that might result. OBS-URL: https://build.opensuse.org/request/show/794581 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-json5?expand=0&rev=3
2020-04-16 12:10:46 +00:00
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Accepting request 794581 from home:pgajdos:python - version update to 0.9.4 * v0.9.4 (2020-03-26) * [GitHub pull #38](https://github.com/dpranke/pyjson5/pull/38) Fix from fredrik@fornwall.net for dumps() crashing when passed an empty string as a key in an object. * v0.9.3 (2020-03-17) * [GitHub pull #35](https://github.com/dpranke/pyjson5/pull/35) Fix from pastelmind@ for dump() not passing the right args to dumps(). * Fix from p.skouzos@novafutur.com to remove the tests directory from the setup call, making the package a bit smaller. * v0.9.2 (2020-03-02) * [GitHub pull #34](https://github.com/dpranke/pyjson5/pull/34) Fix from roosephu@ for a badly formatted nested list. * v0.9.1 (2020-02-09) * [GitHub issue #33](https://github.com/dpranke/pyjson5/issues/33): Fix stray trailing comma when dumping an object with an invalid key. * v0.9.0 (2020-01-30) * [GitHub issue #29](https://github.com/dpranke/pyjson5/issues/29): Fix an issue where objects keys that started with a reserved word were incorrectly quoted. * [GitHub issue #30](https://github.com/dpranke/pyjson5/issues/30): Fix an issue where dumps() incorrectly thought a data structure was cyclic in some cases. * [GitHub issue #32](https://github.com/dpranke/pyjson5/issues/32): Allow for non-string keys in dicts passed to ``dump()``/``dumps()``. Add an ``allow_duplicate_keys=False`` to prevent possible ill-formed JSON that might result. OBS-URL: https://build.opensuse.org/request/show/794581 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-json5?expand=0&rev=3
2020-04-16 12:10:46 +00:00
Requires: python-setuptools
%if %{with libalternatives}
Requires: alts
%else
Requires(post): update-alternatives
Requires(postun):update-alternatives
%endif
BuildArch: noarch
%python_subpackages
%description
A Python implementation of the JSON5 data format.
JSON5 extends the JSON data interchange format to make it
slightly more usable as a configuration language:
* JavaScript-style comments (both single and multi-line) are legal.
* Object keys may be unquoted if they are legal ECMAScript identifiers
* Objects and arrays may end with trailing commas.
* Strings can be single-quoted, and multi-line string literals are allowed.
%prep
%setup -q -n pyjson5-%{version}
%build
%python_build
%install
%python_install
%if ! %{with libalternatives}
%python_clone -a %{buildroot}%{_bindir}/pyjson5
%else
%python_clone %{buildroot}%{_bindir}/pyjson5
ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/pyjson5
mkdir -p %{buildroot}%{_datadir}/libalternatives/pyjson5
%python_expand content="binary=%{_bindir}/pyjson5-%{$python_version}"
%python_expand echo -e $content > %{buildroot}%{_datadir}/libalternatives/pyjson5/10%{$python_version_nodots}.conf
%endif
%python_expand rm -rf %{buildroot}%{$python_sitelib}/tests
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
Accepting request 794581 from home:pgajdos:python - version update to 0.9.4 * v0.9.4 (2020-03-26) * [GitHub pull #38](https://github.com/dpranke/pyjson5/pull/38) Fix from fredrik@fornwall.net for dumps() crashing when passed an empty string as a key in an object. * v0.9.3 (2020-03-17) * [GitHub pull #35](https://github.com/dpranke/pyjson5/pull/35) Fix from pastelmind@ for dump() not passing the right args to dumps(). * Fix from p.skouzos@novafutur.com to remove the tests directory from the setup call, making the package a bit smaller. * v0.9.2 (2020-03-02) * [GitHub pull #34](https://github.com/dpranke/pyjson5/pull/34) Fix from roosephu@ for a badly formatted nested list. * v0.9.1 (2020-02-09) * [GitHub issue #33](https://github.com/dpranke/pyjson5/issues/33): Fix stray trailing comma when dumping an object with an invalid key. * v0.9.0 (2020-01-30) * [GitHub issue #29](https://github.com/dpranke/pyjson5/issues/29): Fix an issue where objects keys that started with a reserved word were incorrectly quoted. * [GitHub issue #30](https://github.com/dpranke/pyjson5/issues/30): Fix an issue where dumps() incorrectly thought a data structure was cyclic in some cases. * [GitHub issue #32](https://github.com/dpranke/pyjson5/issues/32): Allow for non-string keys in dicts passed to ``dump()``/``dumps()``. Add an ``allow_duplicate_keys=False`` to prevent possible ill-formed JSON that might result. OBS-URL: https://build.opensuse.org/request/show/794581 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-json5?expand=0&rev=3
2020-04-16 12:10:46 +00:00
%pytest
%if %{with libalternatives}
%pre
# removing old update-alternatives entries
if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then
%python_uninstall_alternative pyjson5
fi
%else
%post
%python_install_alternative pyjson5
%postun
%python_uninstall_alternative pyjson5
%endif
%files %{python_files}
%doc README.md
%license LICENSE
%if ! 0%{with libalternatives}
%python_alternative %{_bindir}/pyjson5
%else
%dir %{_datadir}/libalternatives
%dir %{_datadir}/libalternatives/pyjson5
%{_datadir}/libalternatives/pyjson5/10%python_version_nodots.conf
%{_bindir}/pyjson5
%{_bindir}/pyjson5-%python_version
%endif
%{python_sitelib}/*
%changelog