14
0

Accepting request 609873 from devel:languages:python:misc

Fast fractions data type for rational numbers

OBS-URL: https://build.opensuse.org/request/show/609873
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-quicktions?expand=0&rev=1
This commit is contained in:
Todd R
2018-05-16 17:36:41 +00:00
committed by Git OBS Bridge
commit 9f77e09141
5 changed files with 140 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

38
python-quicktions.changes Normal file
View File

@@ -0,0 +1,38 @@
-------------------------------------------------------------------
Wed May 16 15:36:31 UTC 2018 - toddrme2178@gmail.com
- Update to 1.6
* Speed up Fraction creation from a string value by 3-5x.
* Built using Cython 0.28.1.
- Update to 1.5
* Result of power operator (``**``) was not normalised for negative values.
* Built using Cython 0.27.2.
- Update to 1.4
* Rebuilt using Cython 0.26.1 to improve support of Python 3.7.
- Update to 1.3
* repair the faster instantiation from Decimal values in Python 3.6
* avoid potential glitch for certain large numbers in normalisation under Python 2.x
- Update to 1.2
* change hash function in Python 2.x to match that of ``fractions.Fraction``
- Update to 1.1
* faster instantiation from float values
* faster instantiation from Decimal values in Python 3.6
- Update to 1.0
* ``Fraction.imag`` property could return non-zero
* parsing strings with long fraction parts could use an incorrect scale
- Implement single-spec version
-------------------------------------------------------------------
Thu Sep 3 14:34:44 UTC 2015 - toddrme2178@gmail.com
- Update to 0.7 (2014-10-09)
* faster instantiation from float and string values
fix test in Python 2.x
- Update to 0.6 (2014-10-09)
* faster normalisation (and thus instantiation)
-------------------------------------------------------------------
Wed Oct 8 13:27:43 UTC 2014 - toddrme2178@gmail.com
- Initial version

75
python-quicktions.spec Normal file
View File

@@ -0,0 +1,75 @@
#
# spec file for package python-quicktions
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-quicktions
Version: 1.6
Release: 0
License: Python-2.0
Summary: Fast fractions data type for rational numbers
Url: https://github.com/scoder/quicktions
Group: Development/Languages/Python
Source: https://files.pythonhosted.org/packages/source/q/quicktions/quicktions-%{version}.tar.gz
BuildRequires: %{python_module Cython}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
# SECTION test requirements
BuildRequires: %{python_module pytest}
# /SECTION
%python_subpackages
%description
Python's Fraction data type is an excellent way to do exact money
calculations and largely beats Decimal in terms of simplicity,
accuracy and safety. Clearly not in terms of speed, though, given
the cdecimal accelerator in Py3.3+.
Quicktions is an adaptation of the original fractions module
(as included in CPython 3.5) that is compiled and optimised with
Cython into a fast, native extension module.
Compared to the standard library fractions module in Py2.7 and
Py3.4, quicktions is currently about 10x faster, and still about
6x faster than the current version in Python 3.5. It's also about
15x faster than the (Python implemented) decimal module in Py2.7.
%prep
%setup -q -n quicktions-%{version}
%build
export CFLAGS="%{optflags}"
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%check
%{python_expand export PYTHONDONTWRITEBYTECODE=1
export PYTHONPATH=%{buildroot}%{$python_sitearch}
pytest-%{$python_bin_suffix} src/test_fractions.py --capture=no --strict
}
%files %{python_files}
%doc CHANGES.rst README.rst
%license LICENSE
%{python_sitearch}/*
%changelog

3
quicktions-1.6.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fb545e2ad561ae25d5b7c672008137c59af42bea4a8720b75556a7d2baa2e8aa
size 201962