forked from pool/python-Delorean
Manipulating datetimes with ease and clarityof older code and makes some small modifications to the `Delorean` API to make it more
Pythonic. 1.0.0 includes support for humanizing a `Delorean` object, as well as outputing a localized string
representing the `Delorean` object.
+ This change introduces the following breaking changes:
* `Delorean.epoch` is a property, not a function.
* `Delorean.midnight` is a property, not a function.
* `Delorean.naive` is a property, not a function.
* `Delorean.timezone` is a property, not a function.
+ delorean/dates.py
* `is_datetime_naive()` no longer returns True when dt is None
* `localize()` works with pytz tzinfo objects
* `normalize()` works with pytz tzinfo objects
* `Delorean.__init__()` accepts tzinfo objects as input to timezone
* `Delorean.timezone()` is now a property
* Added suport for humanizing a `Delorean` object
* Added support for localizing a `Delorean` object for string output
+ delorean/interface.py
* `parse()` understands `dateutil.tz.tzoffset`, `datetutil.tz.tzlocal` and `dateutil.tz.tzutc` and converts those tzinfo
objects into pytz based tzinfo objects. This allows `parse()` to return a `Delorean` object with a `pytz.FixedOffset`
timezone attached to it instead of returning a `Delorean` object converted to UTC
- Implement single-spec version
- Complete spec file rewrite
- Require python-python-dateutil. package was renamed
- Don't run testsuite, there is none
- Add LICENSE.txt and README.rst
- Add runtime dependencies
- created package (version 0.2.0)
OBS-URL: https://build.opensuse.org/request/show/609887
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Delorean?expand=0&rev=1
77 lines
2.5 KiB
RPMSpec
77 lines
2.5 KiB
RPMSpec
#
|
|
# spec file for package python-Delorean
|
|
#
|
|
# 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-Delorean
|
|
Version: 1.0.0
|
|
Release: 0
|
|
License: MIT
|
|
Summary: Manipulating datetimes with ease and clarity
|
|
Url: https://github.com/myusuf3/delorean
|
|
Group: Development/Languages/Python
|
|
Source: https://files.pythonhosted.org/packages/source/D/Delorean/Delorean-%{version}.tar.gz
|
|
BuildRequires: %{python_module devel}
|
|
BuildRequires: %{python_module setuptools}
|
|
BuildRequires: fdupes
|
|
BuildRequires: python-rpm-macros
|
|
# SECTION test requirements
|
|
BuildRequires: %{python_module Babel >= 2.1.1}
|
|
BuildRequires: %{python_module humanize >= 0.5.1}
|
|
BuildRequires: %{python_module mock}
|
|
BuildRequires: %{python_module python-dateutil >= 2.4.2}
|
|
BuildRequires: %{python_module pytz >= 2015.7}
|
|
BuildRequires: %{python_module tzlocal >= 1.2}
|
|
# /SECTION
|
|
Requires: python-Babel >= 2.1.1
|
|
Requires: python-humanize >= 0.5.1
|
|
Requires: python-python-dateutil >= 2.4.2
|
|
Requires: python-pytz >= 2015.7
|
|
Requires: python-tzlocal >= 1.2
|
|
BuildArch: noarch
|
|
|
|
%python_subpackages
|
|
|
|
%description
|
|
Delorean is a library for clearing up the inconvenient truths that
|
|
arise dealing with datetimes in Python. Understanding that timing is
|
|
a delicate enough of a problem `delorean` hopes to provide a cleaner
|
|
less troublesome solution to shifting, manipulating, and generating
|
|
datetimes.
|
|
|
|
%prep
|
|
%setup -q -n Delorean-%{version}
|
|
|
|
%build
|
|
%python_build
|
|
|
|
%install
|
|
%python_install
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
%check
|
|
%{python_expand export PYTHONDONTWRITEBYTECODE=1
|
|
export PYTHONPATH=%{buildroot}%{$python_sitelib}
|
|
$python tests/delorean_tests.py
|
|
}
|
|
|
|
%files %{python_files}
|
|
%doc CHANGES.rst README.rst
|
|
%license LICENSE.txt
|
|
%{python_sitelib}/*
|
|
|
|
%changelog
|