- Add remove-six.patch to remove dependency on six module

(gh#dateutil/dateutil!1403).

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-dateutil?expand=0&rev=32
This commit is contained in:
Matej Cepl 2024-12-17 23:43:45 +00:00 committed by Git OBS Bridge
commit 6c4eeedf41
7 changed files with 1655 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

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

BIN
python-dateutil-2.9.0.post0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,718 @@
-------------------------------------------------------------------
Tue Dec 17 23:25:58 UTC 2024 - Matej Cepl <mcepl@cepl.eu>
- Add remove-six.patch to remove dependency on six module
(gh#dateutil/dateutil!1403).
-------------------------------------------------------------------
Tue Mar 5 13:44:20 UTC 2024 - Ben Greiner <code@bnavigator.de>
- Update to 2.9.0.post0
* Pinned setuptools_scm to <8, which should make the generated
_version.py file compatible with all supported versions of
Python. (We don't do this at openSUSE, we don't need Python 2
installs from a setuptools_scm v8 build)
- Version 2.9.0
* Updated tzdata version to 2024a. (gh pr #1342)
* Made all dateutil submodules lazily imported using PEP 562. On
Python 3.7+, things like import dateutil;
dateutil.tz.gettz("America/New_York") will now work without
explicitly importing dateutil.tz, with the import occurring
behind the scenes on first use. The old behavior remains on
Python 3.6 and earlier. Fixed by Orson Adams. (gh issue #771,
gh pr #1007)
* Removed a call to datetime.utcfromtimestamp, which is
deprecated as of Python 3.12. Reported by Hugo van Kemenade (gh
pr #1284), fixed by Thomas Grainger (gh pr #1285).
- Provide underscore name: some consuming packages go with that,
don't fail unnecessarily
- Drop no-utcfromtimestamp.patch
-------------------------------------------------------------------
Mon Sep 18 04:39:14 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch no-utcfromtimestamp.patch, stop using a deprecated function.
- Switch to pyproject and autosetup macros.
- Stop using greedy globs in %files.
-------------------------------------------------------------------
Fri Apr 21 12:32:11 UTC 2023 - Dirk Müller <dmueller@suse.com>
- add sle15_python_module_pythons (jsc#PED-68)
-------------------------------------------------------------------
Thu Apr 13 22:44:14 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Make calling of %{sle15modernpython} optional.
-------------------------------------------------------------------
Mon Jul 26 21:41:48 UTC 2021 - Dirk Müller <dmueller@suse.com>
- update to 2.8.2:
- Updated tzdata version to 2021a. (gh pr #1128)
- Fixed a bug in the parser where non-``ValueError`` exceptions would be raised
during exception handling; this would happen, for example, if an
``IllegalMonthError`` was raised in ``dateutil`` code. Fixed by Mark Bailey.
(gh issue #981, pr #987).
- Fixed the custom ``repr`` for ``dateutil.parser.ParserError``, which was not
defined due to an indentation error. (gh issue #991, gh pr #993)
- Fixed a bug that caused ``b'`` prefixes to appear in parse_isodate exception
messages. Reported and fixed by Paul Brown (@pawl) (gh pr #1122)
- Make ``isoparse`` raise when trying to parse times with inconsistent use of
`:` separator. Reported and fixed by @mariocj89 (gh pr #1125).
- Fixed ``tz.gettz()`` not returning local time when passed an empty string.
Reported by @labrys (gh issues #925, #926). Fixed by @ffe4 (gh pr #1024)
* Documentation changes
* Simplified handling of bytes and bytearray in ``_parser._timelex``.
-------------------------------------------------------------------
Thu Jan 16 08:42:35 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 2.8.1:
* Updated tzdata version to 2019c.
* Fixed a race condition in the tzoffset and tzstr "strong"
caches on Python 2.7. Reported by @kainjow (gh issue #901).
* Parsing errors will now raise ParserError, a subclass of
ValueError, which has a nicer string representation. Patch by
@gfyoung (gh pr #881).
* parser.parse will now raise TypeError when tzinfos is passed a
type that cannot be interpreted as a time zone. Prior to this
change, it would raise an UnboundLocalError instead. Patch by
@jbrockmendel (gh pr #891).
* Changed error message raised when when passing a bytes object as
the time zone name to gettz in Python 3. Reported and fixed by
@labrys () (gh issue #927, gh pr #935).
* Changed compatibility logic to support a potential Python 4.0
release. Patch by Hugo van Kemenade (gh pr #950).
* Updated many modules to use tz.UTC in favor of tz.tzutc()
internally, to avoid an unnecessary function call. (gh pr #910).
* Fixed issue where dateutil.tz was using a backported version of
contextlib.nullcontext even in Python 3.7 due to a malformed
import statement. (gh pr #963).
-------------------------------------------------------------------
Mon Oct 14 14:36:03 UTC 2019 - Matej Cepl <mcepl@suse.com>
- Replace %fdupes -s with plain %fdupes; hardlinks are better.
-------------------------------------------------------------------
Mon Feb 25 12:05:09 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Switch to _multibuild to not create buildcycle
-------------------------------------------------------------------
Thu Feb 21 11:00:12 UTC 2019 - Hans-Peter Jansen <hpj@urpla.net>
- Update to 2.8.0 (2019-02-04)
+ Data updates
* Updated tzdata version to to 2018i.
+ Features
* Added support for EXDATE parameters when parsing rrule
strings. Reported by @mlorant (gh issue #410), fixed by
@nicoe (gh pr #859).
* Added support for sub-minute time zone offsets in Python
3.6+. Fixed by @cssherry (gh issue #582, pr #763)
* Switched the tzoffset, tzstr and gettz caches over to using
weak references, so that the cache expires when no other
references to the original tzinfo objects exist. This cache-
expiry behavior is not guaranteed in the public interface and
may change in the future. To improve performance in the case
where transient references to the same time zones are
repeatedly created but no strong reference is continuously
held, a smaller “strong value” cache was also added. Weak
value cache implemented by @cs-cordero (gh pr #672, #801),
strong cache added by Gökçen Nurlu (gh issue #691, gh pr
#761)
+ Bugfixes
* Added time zone inference when initializing an rrule with a
specified UNTIL but without an explicitly specified DTSTART;
the time zone of the generated DTSTART will now be taken from
the UNTIL rule. Reported by @href (gh issue #652). Fixed by
@absreim (gh pr #693).
* Fixed an issue where parser.parse would raise Decimal-
specific errors instead of a standard ValueError if certain
malformed values were parsed (e.g. NaN or infinite values).
Reported and fixed by @amureki (gh issue #662, gh pr #679).
* Fixed issue in parser where a tzinfos call explicitly
returning None would throw a ValueError. Fixed by @parsethis
(gh issue #661, gh pr #681)
* Fixed incorrect parsing of certain dates earlier than 100 AD
when repesented in the form “%B.%Y.%d”, e.g.
“December.0031.30”. (gh issue #687, pr #700)
* Add support for ISO 8601 times with comma as the decimal
separator in the dateutil.parser.isoparse function. (gh pr
#721)
* Changed handling of T24:00 to be compliant with the standard.
T24:00 now represents midnight on the following day. Fixed by
@cheukting (gh issue #658, gh pr #751)
* Fixed an issue where isoparser.parse_isotime was unable to
handle the 24:00 variant representation of midnight. (gh pr
#773)
* Added support for more than 6 fractional digits in isoparse.
Reported and fixed by @jayschwa (gh issue #786, gh pr #787).
* Added z (lower case Z) as valid UTC time zone in isoparser.
Reported by @cjgibson (gh issue #820). Fixed by @Cheukting
(gh pr #822)
* Fixed a bug with base offset changes during DST in tzfile,
and refactored the way base offset changes are detected.
Originally reported on StackOverflow by @MartinThoma. (gh
issue #812, gh pr #810)
* Fixed error condition in tz.gettz when a non-ASCII timezone
is passed on Windows in Python 2.7. (gh issue #802, pr #861)
* Improved performance and inspection properties of tzname
methods. (gh pr #811)
* Removed unnecessary binary_type compatibility shims. Added by
@jdufresne (gh pr #817)
* Changed python setup.py test to print an error to stderr and
exit with 1 instead of 0. Reported and fixed by @hroncok (gh
pr #814)
* Added a pyproject.toml file with build requirements and an
explicitly specified build backend. (gh issue #736, gh prs
#746, #863)
+ Documentation changes
* Added documentation for the rrule.rrulestr function. Fixed by
@prdickson (gh issue #623, gh pr #762)
* Added documentation for dateutil.tz.gettz. Fixed by
@weatherpattern (gh issue #647, gh pr #704)
* Add documentation for the dateutil.tz.win module and mocked
out certain Windows-specific modules so that autodoc can
still be run on non-Windows systems. (gh issue #442, pr #715)
* Added changelog to documentation. (gh issue #692, gh pr #707)
* Changed order of keywords in the rrule docstring. Reported
and fixed by @rmahajan14 (gh issue #686, gh pr #695).
* Improved documentation on the use of until and count
parameters in rrule. Fixed by @lucaferocino (gh pr #755).
* Added an example of how to use a custom parserinfo subclass
to parse non-standard datetime formats in the examples
documentation for parser. Added by @prdickson (gh #753)
* Added doctest examples to tzfile documentation. Patch by
@weatherpattern (gh pr #671)
* Updated the documentation for relativedeltas weekday
arguments. Fixed by @kvn219 @huangy22 and @ElliotJH (gh pr
#673)
* Improved explanation of the order that relativedelta
components are applied in. Fixed by @kvn219 @huangy22 and
@ElliotJH (gh pr #673)
* Expanded the description and examples in the relativedelta
class. Contributed by @andrewcbennett (gh pr #759)
* Improved the contributing documentation to clarify where to
put new changelog files. Contributed by @andrewcbennett (gh
pr #757)
* Fixed a broken doctest in the relativedelta module. Fixed by
@nherriot (gh pr #758).
* Changed the default theme to sphinx_rtd_theme, and changed
the sphinx configuration accordingly. (gh pr #707)
* Reorganized dateutil.tz documentation and fixed issue with
the dateutil.tz docstring. (gh pr #714)
* Cleaned up malformed RST in the tz documentation. (gh issue
#702, gh pr #706)
* Corrected link syntax and updated URL to https for ISO year
week number notation in relativedelta examples. (gh issue
#670, pr #711)
+ Misc
* GH #674, GH #688, GH #699, GH #720, GH #723, GH #726, GH
#727, GH #740, GH #750, GH #760, GH #767, GH #772, GH #773,
GH #780, GH #784, GH #785, GH #791, GH #799, GH #813, GH
#836, GH #839, GH #857
- Update to 2.7.5 (2018-10-27)
+ Data updates
* Update tzdata to 2018g
- Update to 2.7.4 (2018-10-24)
+ Data updates
* Updated tzdata version to 2018f.
- Testing switched to py.test
- Add test dependencies
-------------------------------------------------------------------
Tue Dec 4 12:53:00 UTC 2018 - Matej Cepl <mcepl@suse.com>
- Remove superfluous devel dependency for noarch package
-------------------------------------------------------------------
Wed Aug 22 15:21:45 UTC 2018 - alarrosa@suse.com
- Update to version 2.7.3
* Update tzdata to 2018e. (gh pr #710)
* Fixed an issue where decimal.Decimal would cast `NaN` or infinite value in a
parser.parse, which will raise decimal.Decimal-specific errors. Reported and
fixed by @amureki (gh issue #662, gh pr #679).
* Fixed a ValueError being thrown if tzinfos call explicity returns ``None``.
Reported by @pganssle (gh issue #661) Fixed by @parsethis (gh pr #681)
* Fixed incorrect parsing of certain dates earlier than 100 AD when repesented
in the form "%B.%Y.%d", e.g. "December.0031.30". (gh issue #687, pr #700)
* Fixed a bug where automatically generated DTSTART was naive even if a
specified UNTIL had a time zone. Automatically generated DTSTART will now
take on the timezone of an UNTIL date, if provided. Reported by @href (gh
issue #652). Fixed by @absreim (gh pr #693).
* Corrected link syntax and updated URL to https for ISO year week number
notation in relativedelta examples. (gh issue #670, pr #711)
* Add doctest examples to tzfile documentation. Done by @weatherpattern and
@pganssle (gh pr #671)
* Updated the documentation for relativedelta. Removed references to tuple
arguments for weekday, explained effect of weekday(_, 1) and better explained
the order of operations that relativedelta applies. Fixed by @kvn219
@huangy22 and @ElliotJH (gh pr #673)
* Added changelog to documentation. (gh issue #692, gh pr #707)
* Changed order of keywords in rrule docstring. Reported and fixed by
@rmahajan14 (gh issue #686, gh pr #695).
* Added documentation for ``dateutil.tz.gettz``. Reported by @pganssle (gh
issue #647). Fixed by @weatherpattern (gh pr #704)
* Cleaned up malformed RST in the ``tz`` documentation. (gh issue #702, gh pr
#706)
* Changed the default theme to sphinx_rtd_theme, and changed the sphinx
configuration to go along with that. (gh pr #707)
* Reorganized ``dateutil.tz`` documentation and fixed issue with the
``dateutil.tz`` docstring. (gh pr #714)
- Update to version 2.7.2
* Fixed an issue with the setup script running in non-UTF-8 environment.
Reported and fixed by @gergondet (gh pr #651)
- Update to version 2.7.1
* Updated tzdata version to 2018d.
* Fixed issue where parser.parse would occasionally raise
decimal.Decimal-specific error types rather than ValueError. Reported by
@amureki (gh issue #632). Fixed by @pganssle (gh pr #636).
* Improve error message when rrule's dtstart and until are not both naive or
both aware. Reported and fixed by @ryanpetrello (gh issue #633, gh pr #634)
- Update to version 2.7.0
* Dropped support for Python 2.6 (gh pr #362 by @jdufresne)
* Dropped support for Python 3.2 (gh pr #626)
* Updated zoneinfo file to 2018c (gh pr #616)
* Changed licensing scheme so all new contributions are dual licensed under
Apache 2.0 and BSD. (gh pr #542, issue #496)
* Added __all__ variable to the root package. Reported by @tebriel
(gh issue #406), fixed by @mariocj89 (gh pr #494)
* Added python_requires to setup.py so that pip will distribute the right
version of dateutil. Fixed by @jakec-github (gh issue #537, pr #552)
* Added the utils submodule, for miscellaneous utilities.
* Added within_delta function to utils - added by @justanr (gh issue #432,
gh pr #437)
* Added today function to utils (gh pr #474)
* Added default_tzinfo function to utils (gh pr #475), solving an issue
reported by @nealmcb (gh issue #94)
* Added dedicated ISO 8601 parsing function isoparse (gh issue #424).
Initial implementation by @pganssle in gh pr #489 and #622, with a
pre-release fix by @kirit93 (gh issue #546, gh pr #573).
* Moved parser module into parser/_parser.py and officially deprecated the use
of several private functions and classes from that module. (gh pr #501, #515)
* Tweaked parser error message to include rejected string format, added by
@pbiering (gh pr #300)
* Add support for parsing bytesarray, reported by @uckelman (gh issue #417) and
fixed by @uckelman and @pganssle (gh pr #514)
* Started raising a warning when the parser finds a timezone string that it
cannot construct a tzinfo instance for (rather than succeeding with no
indication of an error). Reported and fixed by @jbrockmendel (gh pr #540)
* Dropped the use of assert in the parser. Fixed by @jbrockmendel (gh pr #502)
* Fixed to assertion logic in parser to support dates like '2015-15-May',
reported and fixed by @jbrockmendel (gh pr #409)
* Fixed IndexError in parser on dates with trailing colons, reported and fixed
by @jbrockmendel (gh pr #420)
* Fixed bug where hours were not validated, leading to improper parse. Reported
by @heappro (gh pr #353), fixed by @jbrockmendel (gh pr #482)
* Fixed problem parsing strings in %b-%Y-%d format. Reported and fixed by
@jbrockmendel (gh pr #481)
* Fixed problem parsing strings in the %d%B%y format. Reported by @asishm
(gh issue #360), fixed by @jbrockmendel (gh pr #483)
* Fixed problem parsing certain unambiguous strings when year <99 (gh pr #510).
Reported by @alexwlchan (gh issue #293).
* Fixed issue with parsing an unambiguous string representation of an ambiguous
datetime such that if possible the correct value for fold is set. Fixes
issue reported by @JordonPhillips and @pganssle (gh issue #318, #320,
gh pr #517)
* Fixed issue with improper rounding of fractional components. Reported by
@dddmello (gh issue #427), fixed by @m-dz (gh pr #570)
* Performance improvement to parser from removing certain min() calls. Reported
and fixed by @jbrockmendel (gh pr #589)
* Significantly refactored parser code by @jbrockmendel (gh prs #419, #436,
#490, #498, #539) and @pganssle (gh prs #435, #468)
* Implementated of __hash__ for relativedelta and weekday, reported and fixed
by @mrigor (gh pr #389)
* Implemented __abs__ for relativedelta. Reported by @binnisb and @pferreir
(gh issue #350, pr #472)
* Fixed relativedelta.weeks property getter and setter to work for both
negative and positive values. Reported and fixed by @souliane (gh issue #459,
pr #460)
* Fixed issue where passing whole number floats to the months or years
arguments of the relativedelta constructor would lead to errors during
addition. Reported by @arouanet (gh pr #411), fixed by @lkollar (gh pr #553)
* Added a pre-built tz.UTC object representing UTC (gh pr #497)
* Added a cache to tz.gettz so that by default it will return the same object
for identical inputs. This will change the semantics of certain operations
between datetimes constructed with tzinfo=tz.gettz(...). (gh pr #628)
* Changed the behavior of tz.tzutc to return a singleton (gh pr #497, #504)
* Changed the behavior of tz.tzoffset to return the same object when passed the
same inputs, with a corresponding performance improvement (gh pr #504)
same inputs, with a corresponding performance improvement (gh pr #504)
* Changed the behavior of tz.tzstr to return the same object when passed the
same inputs. (gh pr #628)
* Added .instance alternate constructors for tz.tzoffset and tz.tzstr, to
allow the construction of a new instance if desired. (gh pr #628)
* Added the tz.gettz.nocache function to allow explicit retrieval of a new
instance of the relevant tzinfo. (gh pr #628)
* Expand definition of tz.tzlocal equality so that the local zone is allow
equality with tzoffset and tzutc. (gh pr #598)
* Deprecated the idiosyncratic tzstr format mentioned in several examples but
evidently designed exclusively for dateutil, and very likely not used by
any current users. (gh issue #595, gh pr #606)
* Added the tz.resolve_imaginary function, which generates a real date from
an imaginary one, if necessary. Implemented by @Cheukting (gh issue #339,
gh pr #607)
* Fixed issue where the tz.tzstr constructor would erroneously succeed if
passed an invalid value for tzstr. Fixed by @pablogsal (gh issue #259,
gh pr #581)
* Fixed issue with tz.gettz for TZ variables that start with a colon. Reported
and fixed by @lapointexavier (gh pr #601)
* Added a lock to tz.tzical's cache. Reported and fixed by @Unrud (gh pr #430)
* Fixed an issue with fold support on certain Python 3 implementations that
used the pre-3.6 pure Python implementation of datetime.replace, most
notably pypy3 (gh pr #446).
* Added support for VALUE=DATE-TIME for DTSTART in rrulestr. Reported by @potuz
(gh issue #401) and fixed by @Unrud (gh pr #429)
* Started enforcing that within VTIMEZONE, the VALUE parameter can only be
omitted or DATE-TIME, per RFC 5545. Reported by @Unrud (gh pr #439)
* Added support for TZID parameter for DTSTART in rrulestr. Reported and
fixed by @ryanpetrello (gh issue #614, gh pr #624)
* Added 'RRULE:' prefix to rrule strings generated by rrule.__str__, in
compliance with the RFC. Reported by @AndrewPashkin (gh issue #86), fixed by
@jarondl and @mlorant (gh pr #450)
* Switched to setuptools_scm for version management, automatically calculating
a version number from the git metadata. Reported by @jreback (gh issue #511),
implemented by @Sulley38 (gh pr #564)
* Switched setup.py to use find_packages, and started testing against pip
installed versions of dateutil in CI. Fixed issue with parser import
discovered by @jreback in pandas-dev/pandas#18141. (gh issue #507, pr #509)
* Switched test suite to using pytest (gh pr #495)
* Switched CI over to use tox. Fixed by @gaborbernat (gh pr #549)
* Added a test-only dependency on freezegun. (gh pr #474)
* Reduced number of CI builds on Appveyor. Fixed by @kirit93 (gh issue #529,
gh pr #579)
* Made xfails strict by default, so that an xpass is a failure. (gh pr #567)
* Added a documentation generation stage to tox and CI. (gh pr #568)
* Added an explicit warning when running python setup.py explaining how to run
the test suites with pytest. Fixed by @lkollar. (gh issue #544, gh pr #548)
* Added requirements-dev.txt for test dependency management (gh pr #499, #516)
* Fixed code coverage metrics to account for Windows builds (gh pr #526)
* Fixed code coverage metrics to NOT count xfails. Fixed by @gaborbernat
(gh issue #519, gh pr #563)
* Style improvement to zoneinfo.tzfile that was confusing to static type
checkers. Reported and fixed by @quodlibetor (gh pr #485)
* Several unused imports were removed by @jdufresne. (gh pr #486)
* Switched ``isinstance(*, collections.Callable)`` to callable, which is available
on all supported Python versions. Implemented by @jdufresne (gh pr #612)
* Added CONTRIBUTING.md (gh pr #533)
* Added AUTHORS.md (gh pr #542)
* Corrected setup.py metadata to reflect author vs. maintainer, (gh issue #477,
gh pr #538)
* Corrected README to reflect that tests are now run in pytest. Reported and
fixed by @m-dz (gh issue #556, gh pr #557)
* Updated all references to RFC 2445 (iCalendar) to point to RFC 5545. Fixed
by @mariocj89 (gh issue #543, gh pr #555)
* Corrected parse documentation to reflect proper integer offset units,
reported and fixed by @abrugh (gh pr #458)
* Fixed dangling parenthesis in tzoffset documentation (gh pr #461)
* Started including the license file in wheels. Reported and fixed by
@jdufresne (gh pr #476)
* Indendation fixes to parser docstring by @jbrockmendel (gh pr #492)
* Moved many examples from the "examples" documentation into their appropriate
module documentation pages. Fixed by @Tomasz-Kluczkowski and @jakec-github
(gh pr #558, #561)
* Fixed documentation so that the parser.isoparse documentation displays.
Fixed by @alexchamberlain (gh issue #545, gh pr #560)
* Refactored build and release sections and added setup instructions to
CONTRIBUTING. Reported and fixed by @kynan (gh pr #562)
* Cleaned up various dead links in the documentation. (gh pr #602, #608, #618)
-------------------------------------------------------------------
Mon Jul 10 18:55:45 UTC 2017 - aloisio@gmx.com
- Update to version 2.6.1
* Updated zoneinfo file to 2017b. (gh pr #395)
* Added Python 3.6 to CI testing (gh pr #365)
* Removed duplicate test name that was preventing a test from
being run.
* Reported and fixed by @jdufresne (gh pr #371)
* Fixed testing of folds and gaps, particularly on Windows (gh
pr #392)
* Fixed deprecated escape characters in regular expressions.
Reported by @nascheme and @thierryba (gh issue #361), fixed by
@thierryba (gh pr #358)
* Many PEP8 style violations and other code smells were fixed
by @jdufresne (gh prs #358, #363, #364, #366, #367, #368, #372,
#374, #379, #380, #398)
* Improved performance of tzutc and tzoffset objects. (gh pr
#391)
* Fixed issue with several time zone classes around DST
transitions in any zones with +0 standard offset (e.g.
Europe/London) (gh issue #321, pr #390)
* Fixed issue with fuzzy parsing where tokens similar to AM/PM
that are in the end skipped were dropped in the
fuzzy_with_tokens list. Reported and fixed by @jbrockmendel (gh
pr #332).
* Fixed issue with parsing dates of the form X m YY. Reported
by @jbrockmendel. (gh issue #333, pr #393)
* Added support for parser weekdays with less than 3
characters. Reported by @arcadefoam (gh issue #343), fixed by
@jonemo (gh pr #382)
* Fixed issue with the addition and subtraction of certain
relativedeltas. Reported and fixed by @kootenpv (gh issue #346,
pr #347)
* Fixed issue where the COUNT parameter of rrules was ignored
if 0. Fixed by @mshenfield (gh pr #330), reported by @vaultah
(gh issue #329).
* Updated documentation to include the new tz methods. (gh pr
#324)
* Update documentation to reflect that the parser can raise
TypeError, reported and fixed by @tomchuk (gh issue #336, pr
#337)
* Fixed an incorrect year in a parser doctest. Fixed by
@xlotlu (gh pr #357)
* Moved version information into _version.py and set up the
versions more granularly.
- Use recommended source URL format
-------------------------------------------------------------------
Sat May 6 03:31:54 UTC 2017 - toddrme2178@gmail.com
- Don't provide python2-dateutil, singlespec packages should use
correct name.
-------------------------------------------------------------------
Tue Mar 28 17:55:07 UTC 2017 - aloisio@gmx.com
- Converted to single-spec
- Enabled tests
- Spec cleanup
-------------------------------------------------------------------
Wed Nov 9 07:56:09 UTC 2016 - tbechtold@suse.com
- Use https for Source
-------------------------------------------------------------------
Tue Nov 8 15:54:24 UTC 2016 - aloisio@gmx.com
- Update to version 2.6.0
* Added PEP-495-compatible methods to address ambiguous and
imaginary dates in time zones in a backwards-compatible
way. Ambiguous dates and times can now be safely represented
by all dateutil time zones. Many thanks to Alexander
Belopolski (@abalkin) and Tim Peters @tim-one for their
inputs on how to address this. Original issues reported by
Yupeng and @zed (lP: 1390262, gh issues #57, #112, #249,
#284, #286, prs #127, #225, #248, #264, #302).
* Added new methods for working with ambiguous and imaginary
dates to the tz module. datetime_ambiguous() determines if
a datetime is ambiguous for a given zone and datetime_exists()
determines if a datetime exists in a given zone.
This works for all fold-aware datetimes, not just those
provided by dateutil. (gh issue #253, gh pr #302)
* Fixed an issue where dst() in Portugal in 1996 was
returning the wrong value in tz.tzfile objects. Reported
by @abalkin (gh issue #128, pr #225)
* Fixed an issue where zoneinfo.ZoneInfoFile errors were not
being properly deep-copied. (gh issue #226, pr #225)
* Refactored tzwin and tzrange as a subclass of a common
class, tzrangebase, as there was substantial overlapping
functionality. As part of this change, tzrange and tzstr
now expose a transitions() function, which returns the
DST on and off transitions for a given year. (gh issue
#260, pr #302)
* Deprecated zoneinfo.gettz() due to confusion with
tz.gettz(), in favor of get() method of
zoneinfo.ZoneInfoFile objects. (gh issue #11, pr #310)
* For non-character, non-stream arguments, parser.parse now
raises TypeError instead of AttributeError. (gh issues
#171, #269, pr #247)
* Fixed an issue where tzfile objects were not properly
handling dst() and tzname() when attached to
datetime.time objects. Reported by @ovacephaloid.
(gh issue #292, pr #309)
* /usr/share/lib/zoneinfo was added to TZPATHS for
compatibility with Solaris systems. Reported by @dhduvall
(gh issue #276, pr #307)
* tzoffset and tzrange objects now accept either a number of
seconds or a datetime.timedelta() object wherever
previously only a number of seconds was allowed.
(gh pr #264, #277)
* datetime.timedelta objects can now be added to
relativedelta objects. Reported and added by Alec Nikolas
Reiter (@justanr) (gh issue #282, pr #283
* Refactored relativedelta.weekday and rrule.weekday into a
common base class to reduce code duplication.
(gh issue #140, pr #311)
* An issue where the WKST parameter was improperly rendering
in str(rrule) was reported and fixed by Daniel LePage
(@dplepage). (gh issue #262, pr #263)
* A replace() method has been added to rrule objects by
@jendas1, which creates new rrule with modified attributes,
analogous to datetime.replace (gh pr #167)
* Made some significant performance improvements to rrule
objects in Python 2.x (gh pr #245)
* All classes defining equality functions now return
NotImplemented when compared to unsupported classes,
rather than raising TypeError, to allow other classes to
provide fallback support. (gh pr #236)
* Several classes have been marked as explicitly unhashable
to maintain identical behavior between Python 2 and 3.
Submitted by Roy Williams (@rowillia) (gh pr #296)
* Trailing whitespace in easter.py has been removed.
Submitted by @OmgImAlexis (gh pr #299)
* Windows-only batch files in build scripts had line endings
switched to CRLF. (gh pr #237)
* @adamchainz updated the documentation links to reflect
that the canonical location for readthedocs links is now
at .io, not .org. (gh pr #272)
* Made some changes to the CI and codecov to test against
newer versions of Python and pypy, and to adjust the code
coverage requirements. For the moment, full pypy3
compatibility is not supported until a new release is
available, due to upstream bugs in the old version
affecting PEP-495 support. (gh prs #265, #266, #304, #308)
* The full PGP signing key fingerprint was added to the
README.md in favor of the previously used long-id.
Reported by @valholl (gh issue #287, pr #304)
* Updated zoneinfo to 2016i. (gh issue #298, gh pr #306)
-------------------------------------------------------------------
Fri Mar 4 06:59:53 UTC 2016 - tbechtold@suse.com
- Fix Obsoletes. No version upgrade was done during renaming.
-------------------------------------------------------------------
Fri Feb 26 12:45:15 UTC 2016 - tbechtold@suse.com
- Rename package to python-python-dateutil . It's openSUSE policy
to use the $pypi name with the python prefix.
-------------------------------------------------------------------
Thu Aug 13 03:13:09 UTC 2015 - Greg.Freemyer@gmail.com
- update url in specfile
- use sed to eliminate MS-DOS style end of lines
- update to version 2.4.2:
* Updated zoneinfo to 2015b.
* Fixed issue with parsing of tzstr on Python 2.7.x; tzstr will now
be decoded if not a unicode type. gh #51 (lp:1331576), gh pr #55.
* Fix a parser issue where AM and PM tokens were showing up in fuzzy
date stamps, triggering inappropriate errors. gh #56 (lp:
1428895), gh pr #63.
* Missing function "setcachsize" removed from zoneinfo __all__ list
by @ryanss, fixing an issue with wildcard imports of
dateutil.zoneinfo. (gh pr #66).
* (PyPi only) Fix an issue with source distributions not including
the test suite.
- changes from version 2.4.1:
* Added explicit check for valid hours if AM/PM is specified in
parser. (gh pr #22, issue #21)
* Fix bug in rrule introduced in 2.4.0 where byweekday parameter was
not handled properly. (gh pr #35, issue #34)
* Fix error where parser allowed some invalid dates, overwriting
existing hours with the last 2-digit number in the string. (gh pr
#32, issue #31)
* Fix and add test for Python 2.x compatibility with boolean
checking of relativedelta objects. Implemented by @nimasmi (gh pr
#43) and Céic Krier (lp: 1035038)
* Replaced parse() calls with explicit datetime objects in unit
tests unrelated to parser. (gh pr #36)
* Changed private _byxxx from sets to sorted tuples and fixed one
currently unreachable bug in _construct_byset. (gh pr #54)
* Additional documentation for parser (gh pr #29, #33, #41) and
rrule.
* Formatting fixes to documentation of rrule and README.rst.
* Updated zoneinfo to 2015a.
- changes from version 2.4.0:
* Fix an issue with relativedelta and freezegun (lp:1374022)
* Fix tzinfo in windows for timezones without dst (lp:1010050, gh
#2)
* Ignore missing timezones in windows like in POSIX
* Fix minimal version requirement for six (gh #6)
* Many rrule changes and fixes by @pganssle (gh pull requests #13
#14 #17), including defusing some infinite loops (gh #4)
- changes from version 2.3:
* Cleanup directory structure, moved test.py to
dateutil/tests/test.py
* Changed many aspects of dealing with the zone info file. Instead
of a cache, all the zones are loaded to memory, but symbolic links
are loaded only once, so not much memory is used.
* The package is now zip-safe, and universal-wheelable, thanks to
changes in the handling of the zoneinfo file.
* Fixed tzwin silently not imported on windows python2
* New maintainer, together with new hosting: GitHub, Travis,
Read-The-Docs
-------------------------------------------------------------------
Mon Jul 27 19:01:48 UTC 2015 - aloisio@gmx.com
- Update to version 2.2:
* Updated zoneinfo to 2013h
* fuzzy_with_tokens parse addon from Christopher Corley
* Bug with LANG=C fixed by Mike Gilbert
- Aligned requirement version with PyPI
-------------------------------------------------------------------
Thu Oct 24 11:01:02 UTC 2013 - speilicke@suse.com
- Require python-setuptools instead of distribute (upstreams merged)
-------------------------------------------------------------------
Wed Jun 6 10:11:52 UTC 2012 - cfarrell@suse.com
- license update: BSD-3-Clause
Look at the LICENSE file
-------------------------------------------------------------------
Wed Jun 6 08:49:28 UTC 2012 - toddrme2178@gmail.com
- Added python-six requires and buildrequires. dateutil will build
without out, but packaged down the dependency chain will fail
if it isn't installed
-------------------------------------------------------------------
Sun Jun 3 05:11:38 UTC 2012 - os-dev@jacraig.com
- Update to version 2.1
* See NEWS for changes
-------------------------------------------------------------------
Fri Apr 27 14:07:19 UTC 2012 - toddrme2178@gmail.com
- Fix building python 3 package on openSUSE 11.4
-------------------------------------------------------------------
Thu Apr 26 12:11:38 UTC 2012 - toddrme2178@gmail.com
- Add python 3 package
-------------------------------------------------------------------
Tue Apr 20 12:31:46 UTC 2010 - cstender@novell.com
- updated to version 1.5
* See NEWS for all changes and fixes
-------------------------------------------------------------------
Thu Aug 13 10:55:11 UTC 2009 - cstender@novell.com
- build as noarch
-------------------------------------------------------------------
Tue Sep 9 12:18:33 CEST 2008 - cstender@suse.de
- add python-setuptools to BuildRequire
- updated package to version 1.4.1
o See NEWS for all changes and fixes
-------------------------------------------------------------------
Fri Oct 20 20:27:51 CEST 2006 - dgollub@suse.de
- initial version of python-dateutil (1.1)

121
python-python-dateutil.spec Normal file
View File

@ -0,0 +1,121 @@
#
# spec file for package python-python-dateutil
#
# Copyright (c) 2024 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.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define oldpython python
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
%{?sle15_python_module_pythons}
Name: python-python-dateutil%{psuffix}
Version: 2.9.0.post0
Release: 0
Summary: A Python Datetime Library
License: Apache-2.0 OR BSD-3-Clause
URL: https://dateutil.readthedocs.org/en/latest/
Source0: https://files.pythonhosted.org/packages/source/p/python-dateutil/python-dateutil-%{version}.tar.gz
# PATCH-FEATURE-UPSTREAM remove-six.patch gh#dateutil/dateutil!1403 mcepl@suse.com
# remove dependency on the six module
Patch0: remove-six.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools >= 24.3}
# Don't pin to <8 like upstream does: gh#dateutil/dateutil#1346
BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module wheel}
BuildRequires: dos2unix
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Obsoletes: python-dateutil < %{version}-%{release}
Provides: python-dateutil = %{version}-%{release}
Provides: python-python_dateutil = %{version}-%{release}
BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module freezegun}
BuildRequires: %{python_module hypothesis}
BuildRequires: %{python_module pytest}
BuildRequires: timezone
%endif
%ifpython2
Obsoletes: %{oldpython}-dateutil < %{version}
Provides: %{oldpython}-dateutil = %{version}
%endif
%python_subpackages
%description
The python dateutil module provides powerful extensions to the standard
datetime module.
* Computing of relative deltas (next month, next year, next monday,
last week of month, etc.)
* Computing of relative deltas between two given dates and/or
datetime objects
* Computing of dates based on very flexible recurrence rules, using
a superset of the iCalendar specification. Parsing of RFC strings
is supported as well.
* Generic parsing of dates in almost any string format.
* Timezone (tzinfo) implementations for tzfile(5) format files
(%{_sysconfdir}/localtime, %{_datadir}/zoneinfo, etc.), TZ environment
string (in all known formats), iCalendar format files, given
ranges (with help from relative deltas), local machine timezone,
fixed offset timezone, UTC timezone, and Windows registry-based
time zones.
* Internal up-to-date world timezone information based on Olson's
database.
* Computing of Easter Sunday dates for any given year, using Western,
Orthodox or Julian algorithms.
%prep
%autosetup -p1 -n python-dateutil-%{version}
#cleanup and MSdos style end of line separators
dos2unix LICENSE NEWS PKG-INFO README.rst
%build
%pyproject_wheel
%install
%if !%{with test}
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%if %{with test}
%check
rm setup.cfg
export LANG=en_US.UTF-8
%pytest
%endif
%if !%{with test}
%files %{python_files}
%doc NEWS PKG-INFO README.rst
%license LICENSE
%{python_sitelib}/dateutil
%{python_sitelib}/python_dateutil-%{version}.dist-info
%endif
%changelog

786
remove-six.patch Normal file
View File

@ -0,0 +1,786 @@
---
.github/workflows/validate.yml | 2 -
appveyor.yml | 1
azure-pipelines.yml | 2 -
docs/conf.py | 2 -
pyproject.toml | 2 -
requirements-dev.txt | 2 -
requirements/3.3/constraints.txt | 1
setup.cfg | 1
src/dateutil/parser/_parser.py | 15 ++++------
src/dateutil/parser/isoparser.py | 5 +--
src/dateutil/relativedelta.py | 3 --
src/dateutil/rrule.py | 42 +++++++++++++-----------------
src/dateutil/tz/_common.py | 15 ----------
src/dateutil/tz/_factories.py | 3 --
src/dateutil/tz/tz.py | 18 ++++--------
src/dateutil/tz/win.py | 7 +----
src/python_dateutil.egg-info/requires.txt | 1
tests/property/test_tz_prop.py | 6 ----
tests/test_imports.py | 9 +-----
tests/test_isoparser.py | 17 ++----------
tests/test_parser.py | 14 ++--------
tests/test_rrule.py | 40 ----------------------------
tests/test_tz.py | 6 ----
updatezinfo.py | 4 +-
24 files changed, 52 insertions(+), 166 deletions(-)
--- a/.github/workflows/validate.yml
+++ b/.github/workflows/validate.yml
@@ -60,7 +60,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- run: python -m pip install -U tox six
+ run: python -m pip install -U tox
- name: Install zic (Windows)
run: |
curl https://get.enterprisedb.com/postgresql/postgresql-9.5.21-2-windows-x64-binaries.zip --output $env:GITHUB_WORKSPACE\postgresql9.5.21.zip
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -24,7 +24,6 @@ install:
# This frequently fails with network errors, so we'll retry it up to 5 times
# with a 1 minute rate limit.
- - "%PYTHON% -m pip install six"
- "ci_tools/retry.bat %PYTHON% updatezinfo.py"
# This environment variable tells the test suite it's OK to mess with the time zone.
- set DATEUTIL_MAY_CHANGE_TZ=1
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -49,7 +49,7 @@ steps:
versionSpec: $(python.version)
- bash: |
- python -m pip install -U six && python -m pip install -U 'tox < 3.8.0'
+ python -m pip install -U 'tox < 3.8.0'
if [[ $PYTHON_VERSION == "3.3" ]]; then pip install 'virtualenv<16.0'; fi
if [[ $PYTHON_VERSION == "3.3" ]]; then pip install 'setuptools<40.0'; fi
displayName: Ensure prereqs
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -188,7 +188,7 @@ htmlhelp_basename = 'dateutildoc'
# -- Options for autodoc -------------------------------------------------
-autodoc_mock_imports = ['ctypes.wintypes', 'six.moves.winreg']
+autodoc_mock_imports = ['ctypes.wintypes', 'winreg']
# Need to mock this out specifically to avoid errors
import ctypes
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -57,9 +57,7 @@ known_first_party = ["dateutil"]
known_third_party=[
"pytest",
"hypothesis",
- "six",
"freezegun",
- "mock",
]
multi_line_output=3
use_parentheses=true
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -1,9 +1,7 @@
-six
pytest >= 3.0; python_version != '3.3'
pytest-cov >= 2.0.0
freezegun ; python_version != '3.3'
hypothesis >= 3.30
coverage
-mock ; python_version < '3.0'
build >= 0.3.0 ; python_version >= '3.6'
attrs!=21.1.0
--- a/requirements/3.3/constraints.txt
+++ b/requirements/3.3/constraints.txt
@@ -10,6 +10,5 @@ py==1.4.34
pytest==3.2.5
pytest-cov==2.5.1
setuptools==39.2.0
-six==1.12.0
tox==2.9.1
virtualenv==15.2.0
--- a/setup.cfg
+++ b/setup.cfg
@@ -39,7 +39,6 @@ classifiers =
[options]
zip_safe = True
setup_requires = setuptools_scm
-install_requires = six >= 1.5
package_dir =
=src
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*
--- a/src/dateutil/parser/_parser.py
+++ b/src/dateutil/parser/_parser.py
@@ -39,9 +39,6 @@ import warnings
from calendar import monthrange
from io import StringIO
-import six
-from six import integer_types, text_type
-
from decimal import Decimal
from warnings import warn
@@ -63,7 +60,7 @@ class _timelex(object):
if isinstance(instream, (bytes, bytearray)):
instream = instream.decode()
- if isinstance(instream, text_type):
+ if isinstance(instream, str):
instream = StringIO(instream)
elif getattr(instream, 'read', None) is None:
raise TypeError('Parser must be a string or character stream, not '
@@ -648,7 +645,7 @@ class parser(object):
try:
ret = self._build_naive(res, default)
except ValueError as e:
- six.raise_from(ParserError(str(e) + ": %s", timestr), e)
+ raise ParserError(str(e) + ": %s", timestr) from e
if not ignoretz:
ret = self._build_tzaware(ret, res, tzinfos)
@@ -878,7 +875,7 @@ class parser(object):
try:
value = self._to_decimal(value_repr)
except Exception as e:
- six.raise_from(ValueError('Unknown numeric token'), e)
+ raise ValueError('Unknown numeric token') from e
len_li = len(value_repr)
@@ -1147,7 +1144,7 @@ class parser(object):
raise ValueError("Converted decimal value is infinite or NaN")
except Exception as e:
msg = "Could not convert %s to decimal" % val
- six.raise_from(ValueError(msg), e)
+ raise ValueError(msg) from e
else:
return decimal_value
@@ -1165,9 +1162,9 @@ class parser(object):
# eg tzinfos = {'BRST' : None}
if isinstance(tzdata, datetime.tzinfo) or tzdata is None:
tzinfo = tzdata
- elif isinstance(tzdata, text_type):
+ elif isinstance(tzdata, str):
tzinfo = tz.tzstr(tzdata)
- elif isinstance(tzdata, integer_types):
+ elif isinstance(tzdata, int):
tzinfo = tz.tzoffset(tzname, tzdata)
else:
raise TypeError("Offset must be tzinfo subclass, tz string, "
--- a/src/dateutil/parser/isoparser.py
+++ b/src/dateutil/parser/isoparser.py
@@ -14,7 +14,6 @@ from dateutil import tz
from functools import wraps
import re
-import six
__all__ = ["isoparse", "isoparser"]
@@ -26,13 +25,13 @@ def _takes_ascii(f):
str_in = getattr(str_in, 'read', lambda: str_in)()
# If it's unicode, turn it into bytes, since ISO-8601 only covers ASCII
- if isinstance(str_in, six.text_type):
+ if isinstance(str_in, str):
# ASCII is the same in UTF-8
try:
str_in = str_in.encode('ascii')
except UnicodeEncodeError as e:
msg = 'ISO-8601 strings should contain only ASCII characters'
- six.raise_from(ValueError(msg), e)
+ raise ValueError(msg) from e
return f(self, str_in, *args, **kwargs)
--- a/src/dateutil/relativedelta.py
+++ b/src/dateutil/relativedelta.py
@@ -5,7 +5,6 @@ import calendar
import operator
from math import copysign
-from six import integer_types
from warnings import warn
from ._common import weekday
@@ -200,7 +199,7 @@ class relativedelta(object):
"This is not a well-defined condition and will raise " +
"errors in future versions.", DeprecationWarning)
- if isinstance(weekday, integer_types):
+ if isinstance(weekday, int):
self.weekday = weekdays[weekday]
else:
self.weekday = weekday
--- a/src/dateutil/rrule.py
+++ b/src/dateutil/rrule.py
@@ -15,10 +15,6 @@ from functools import wraps
# For warning about deprecation of until and count
from warnings import warn
-from six import advance_iterator, integer_types
-
-from six.moves import _thread, range
-
from ._common import weekday as weekdaybase
try:
@@ -134,7 +130,7 @@ class rrulebase(object):
break
try:
for j in range(10):
- cache.append(advance_iterator(gen))
+ cache.append(next(gen))
except StopIteration:
self._cache_gen = gen = None
self._cache_complete = True
@@ -161,7 +157,7 @@ class rrulebase(object):
gen = iter(self)
try:
for i in range(item+1):
- res = advance_iterator(gen)
+ res = next(gen)
except StopIteration:
raise IndexError
return res
@@ -479,14 +475,14 @@ class rrule(rrulebase):
if wkst is None:
self._wkst = calendar.firstweekday()
- elif isinstance(wkst, integer_types):
+ elif isinstance(wkst, int):
self._wkst = wkst
else:
self._wkst = wkst.weekday
if bysetpos is None:
self._bysetpos = None
- elif isinstance(bysetpos, integer_types):
+ elif isinstance(bysetpos, int):
if bysetpos == 0 or not (-366 <= bysetpos <= 366):
raise ValueError("bysetpos must be between 1 and 366, "
"or between -366 and -1")
@@ -520,7 +516,7 @@ class rrule(rrulebase):
if bymonth is None:
self._bymonth = None
else:
- if isinstance(bymonth, integer_types):
+ if isinstance(bymonth, int):
bymonth = (bymonth,)
self._bymonth = tuple(sorted(set(bymonth)))
@@ -532,7 +528,7 @@ class rrule(rrulebase):
if byyearday is None:
self._byyearday = None
else:
- if isinstance(byyearday, integer_types):
+ if isinstance(byyearday, int):
byyearday = (byyearday,)
self._byyearday = tuple(sorted(set(byyearday)))
@@ -542,7 +538,7 @@ class rrule(rrulebase):
if byeaster is not None:
if not easter:
from dateutil import easter
- if isinstance(byeaster, integer_types):
+ if isinstance(byeaster, int):
self._byeaster = (byeaster,)
else:
self._byeaster = tuple(sorted(byeaster))
@@ -556,7 +552,7 @@ class rrule(rrulebase):
self._bymonthday = ()
self._bynmonthday = ()
else:
- if isinstance(bymonthday, integer_types):
+ if isinstance(bymonthday, int):
bymonthday = (bymonthday,)
bymonthday = set(bymonthday) # Ensure it's unique
@@ -573,7 +569,7 @@ class rrule(rrulebase):
if byweekno is None:
self._byweekno = None
else:
- if isinstance(byweekno, integer_types):
+ if isinstance(byweekno, int):
byweekno = (byweekno,)
self._byweekno = tuple(sorted(set(byweekno)))
@@ -588,13 +584,13 @@ class rrule(rrulebase):
# If it's one of the valid non-sequence types, convert to a
# single-element sequence before the iterator that builds the
# byweekday set.
- if isinstance(byweekday, integer_types) or hasattr(byweekday, "n"):
+ if isinstance(byweekday, int) or hasattr(byweekday, "n"):
byweekday = (byweekday,)
self._byweekday = set()
self._bynweekday = set()
for wday in byweekday:
- if isinstance(wday, integer_types):
+ if isinstance(wday, int):
self._byweekday.add(wday)
elif not wday.n or freq > MONTHLY:
self._byweekday.add(wday.weekday)
@@ -629,7 +625,7 @@ class rrule(rrulebase):
else:
self._byhour = None
else:
- if isinstance(byhour, integer_types):
+ if isinstance(byhour, int):
byhour = (byhour,)
if freq == HOURLY:
@@ -649,7 +645,7 @@ class rrule(rrulebase):
else:
self._byminute = None
else:
- if isinstance(byminute, integer_types):
+ if isinstance(byminute, int):
byminute = (byminute,)
if freq == MINUTELY:
@@ -669,7 +665,7 @@ class rrule(rrulebase):
else:
self._bysecond = None
else:
- if isinstance(bysecond, integer_types):
+ if isinstance(bysecond, int):
bysecond = (bysecond,)
self._bysecond = set(bysecond)
@@ -1062,7 +1058,7 @@ class rrule(rrulebase):
cset = set()
# Support a single byxxx value.
- if isinstance(byxxx, integer_types):
+ if isinstance(byxxx, int):
byxxx = (byxxx, )
for num in byxxx:
@@ -1315,7 +1311,7 @@ class rruleset(rrulebase):
class _genitem(object):
def __init__(self, genlist, gen):
try:
- self.dt = advance_iterator(gen)
+ self.dt = next(gen)
genlist.append(self)
except StopIteration:
pass
@@ -1324,7 +1320,7 @@ class rruleset(rrulebase):
def __next__(self):
try:
- self.dt = advance_iterator(self.gen)
+ self.dt = next(self.gen)
except StopIteration:
if self.genlist[0] is self:
heapq.heappop(self.genlist)
@@ -1400,14 +1396,14 @@ class rruleset(rrulebase):
if not lastdt or lastdt != ritem.dt:
while exlist and exlist[0] < ritem:
exitem = exlist[0]
- advance_iterator(exitem)
+ next(exitem)
if exlist and exlist[0] is exitem:
heapq.heapreplace(exlist, exitem)
if not exlist or ritem != exlist[0]:
total += 1
yield ritem.dt
lastdt = ritem.dt
- advance_iterator(ritem)
+ next(ritem)
if rlist and rlist[0] is ritem:
heapq.heapreplace(rlist, ritem)
self._len = total
--- a/src/dateutil/tz/_common.py
+++ b/src/dateutil/tz/_common.py
@@ -1,5 +1,3 @@
-from six import PY2
-
from functools import wraps
from datetime import datetime, timedelta, tzinfo
@@ -16,18 +14,7 @@ def tzname_in_python2(namefunc):
tzname() API changed in Python 3. It used to return bytes, but was changed
to unicode strings
"""
- if PY2:
- @wraps(namefunc)
- def adjust_encoding(*args, **kwargs):
- name = namefunc(*args, **kwargs)
- if name is not None:
- name = name.encode()
-
- return name
-
- return adjust_encoding
- else:
- return namefunc
+ return namefunc
# The following is adapted from Alexander Belopolsky's tz library
--- a/src/dateutil/tz/_factories.py
+++ b/src/dateutil/tz/_factories.py
@@ -2,9 +2,6 @@ from datetime import timedelta
import weakref
from collections import OrderedDict
-from six.moves import _thread
-
-
class _TzSingleton(type):
def __init__(cls, *args, **kwargs):
cls.__instance = None
--- a/src/dateutil/tz/tz.py
+++ b/src/dateutil/tz/tz.py
@@ -16,9 +16,6 @@ import bisect
import weakref
from collections import OrderedDict
-import six
-from six import string_types
-from six.moves import _thread
from ._common import tzname_in_python2, _tzinfo
from ._common import tzrangebase, enfold
from ._common import _validate_fromutc_inputs
@@ -38,8 +35,7 @@ EPOCH = datetime.datetime(1970, 1, 1, 0,
EPOCHORDINAL = EPOCH.toordinal()
-@six.add_metaclass(_TzSingleton)
-class tzutc(datetime.tzinfo):
+class tzutc(datetime.tzinfo, metaclass=_TzSingleton):
"""
This is a tzinfo object that represents the UTC time zone.
@@ -129,8 +125,7 @@ class tzutc(datetime.tzinfo):
UTC = tzutc()
-@six.add_metaclass(_TzOffsetFactory)
-class tzoffset(datetime.tzinfo):
+class tzoffset(datetime.tzinfo, metaclass=_TzOffsetFactory):
"""
A simple class for representing a fixed offset from UTC.
@@ -459,7 +454,7 @@ class tzfile(_tzinfo):
super(tzfile, self).__init__()
file_opened_here = False
- if isinstance(fileobj, string_types):
+ if isinstance(fileobj, str):
self._filename = fileobj
fileobj = open(fileobj, 'rb')
file_opened_here = True
@@ -1033,8 +1028,7 @@ class tzrange(tzrangebase):
return self._dst_base_offset_
-@six.add_metaclass(_TzStrFactory)
-class tzstr(tzrange):
+class tzstr(tzrange, metaclass=_TzStrFactory):
"""
``tzstr`` objects are time zone objects specified by a time-zone string as
it would be passed to a ``TZ`` variable on POSIX-style systems (see
@@ -1265,7 +1259,7 @@ class tzical(object):
global rrule
from dateutil import rrule
- if isinstance(fileobj, string_types):
+ if isinstance(fileobj, str):
self._s = fileobj
# ical should be encoded in UTF-8 with CRLF
fileobj = open(fileobj, 'r')
@@ -1621,7 +1615,7 @@ def __get_gettz():
except TypeError as e:
if isinstance(name, bytes):
new_msg = "gettz argument should be str, not bytes"
- six.raise_from(TypeError(new_msg), e)
+ raise TypeError(new_msg) from e
else:
raise
if os.path.isabs(name):
--- a/src/dateutil/tz/win.py
+++ b/src/dateutil/tz/win.py
@@ -10,9 +10,6 @@ Attempting to import this module on a no
import datetime
import struct
-from six.moves import winreg
-from six import text_type
-
try:
import ctypes
from ctypes import wintypes
@@ -216,7 +213,7 @@ class tzwin(tzwinbase):
self._name = name
with winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) as handle:
- tzkeyname = text_type("{kn}\\{name}").format(kn=TZKEYNAME, name=name)
+ tzkeyname = str("{kn}\\{name}").format(kn=TZKEYNAME, name=name)
with winreg.OpenKey(handle, tzkeyname) as tzkey:
keydict = valuestodict(tzkey)
@@ -282,7 +279,7 @@ class tzwinlocal(tzwinbase):
self._dst_abbr = keydict["DaylightName"]
try:
- tzkeyname = text_type('{kn}\\{sn}').format(kn=TZKEYNAME,
+ tzkeyname = str('{kn}\\{sn}').format(kn=TZKEYNAME,
sn=self._std_abbr)
with winreg.OpenKey(handle, tzkeyname) as tzkey:
_keydict = valuestodict(tzkey)
--- a/src/python_dateutil.egg-info/requires.txt
+++ b/src/python_dateutil.egg-info/requires.txt
@@ -1 +0,0 @@
-six>=1.5
--- a/tests/property/test_tz_prop.py
+++ b/tests/property/test_tz_prop.py
@@ -1,7 +1,6 @@
from datetime import datetime, timedelta
import pytest
-import six
from hypothesis import assume, given
from hypothesis import strategies as st
@@ -25,10 +24,7 @@ def test_gettz_returns_local(gettz_arg,
return
dt_act = dt.astimezone(tz.gettz(gettz_arg))
- if six.PY2:
- dt_exp = dt.astimezone(tz.tzlocal())
- else:
- dt_exp = dt.astimezone()
+ dt_exp = dt.astimezone()
assert dt_act == dt_exp
assert dt_act.tzname() == dt_exp.tzname()
--- a/tests/test_imports.py
+++ b/tests/test_imports.py
@@ -1,7 +1,6 @@
import sys
import unittest
import pytest
-import six
MODULE_TYPE = type(sys)
@@ -10,12 +9,8 @@ MODULE_TYPE = type(sys)
# But since we expect lazy imports tests to fail for Python < 3.7 we'll ignore those
# warnings with this filter.
-if six.PY2:
- filter_import_warning = pytest.mark.filterwarnings("ignore::RuntimeWarning")
-else:
-
- def filter_import_warning(f):
- return f
+def filter_import_warning(f):
+ return f
@pytest.fixture(scope="function")
--- a/tests/test_isoparser.py
+++ b/tests/test_isoparser.py
@@ -9,7 +9,6 @@ from dateutil.tz import UTC
from dateutil.parser import isoparser, isoparse
import pytest
-import six
def _generate_tzoffsets(limited):
@@ -296,8 +295,7 @@ def test_isoparser_invalid_sep(sep):
isoparser(sep=sep)
-# This only fails on Python 3
-@pytest.mark.xfail(not six.PY2, reason="Fails on Python 3 only")
+@pytest.mark.xfail(reason="Fails on Python 3 only")
def test_isoparser_byte_sep():
dt = datetime(2017, 12, 6, 12, 30, 45)
dt_str = dt.isoformat(sep=str('T'))
@@ -347,10 +345,6 @@ def __make_date_examples():
date(2016, 2, 1)
]
- if not six.PY2:
- # strftime does not support dates before 1900 in Python 2
- dates_no_day.append(date(1000, 11, 1))
-
# Only one supported format for dates with no day
o = zip(dates_no_day, it.repeat('%Y-%m'))
@@ -371,7 +365,7 @@ def __make_date_examples():
@pytest.mark.parametrize('as_bytes', [True, False])
def test_parse_isodate(d, dt_fmt, as_bytes):
d_str = d.strftime(dt_fmt)
- if isinstance(d_str, six.text_type) and as_bytes:
+ if isinstance(d_str, str) and as_bytes:
d_str = d_str.encode('ascii')
elif isinstance(d_str, bytes) and not as_bytes:
d_str = d_str.decode('ascii')
@@ -400,10 +394,7 @@ def test_parse_isodate_error_text():
isoparser().parse_isodate('2014-0423')
# ensure the error message does not contain b' prefixes
- if six.PY2:
- expected_error = "String contains unknown ISO components: u'2014-0423'"
- else:
- expected_error = "String contains unknown ISO components: '2014-0423'"
+ expected_error = "String contains unknown ISO components: '2014-0423'"
assert expected_error == str(excinfo.value)
@@ -458,7 +449,7 @@ def __make_time_examples():
@pytest.mark.parametrize('as_bytes', [True, False])
def test_isotime(time_val, time_fmt, as_bytes):
tstr = time_val.strftime(time_fmt)
- if isinstance(tstr, six.text_type) and as_bytes:
+ if isinstance(tstr, str) and as_bytes:
tstr = tstr.encode('ascii')
elif isinstance(tstr, bytes) and not as_bytes:
tstr = tstr.decode('ascii')
--- a/tests/test_parser.py
+++ b/tests/test_parser.py
@@ -14,7 +14,6 @@ from dateutil.parser import UnknownTimez
from ._common import TZEnvContext
-from six import assertRaisesRegex, PY2
from io import StringIO
import pytest
@@ -462,13 +461,6 @@ class ParserTest(unittest.TestCase):
datetime(2003, 9, 25, 10, 36, 28,
tzinfo=self.brsttz))
- def testDateCommandFormatWithLong(self):
- if PY2:
- self.assertEqual(parse("Thu Sep 25 10:36:28 BRST 2003",
- tzinfos={"BRST": long(-10800)}),
- datetime(2003, 9, 25, 10, 36, 28,
- tzinfo=self.brsttz))
-
def testISOFormatStrip2(self):
self.assertEqual(parse("2003-09-25T10:49:41+03:00"),
datetime(2003, 9, 25, 10, 49, 41,
@@ -570,11 +562,11 @@ class ParserTest(unittest.TestCase):
parse('shouldfail')
def testCorrectErrorOnFuzzyWithTokens(self):
- assertRaisesRegex(self, ParserError, 'Unknown string format',
+ self.assertRaisesRegex(ParserError, 'Unknown string format',
parse, '04/04/32/423', fuzzy_with_tokens=True)
- assertRaisesRegex(self, ParserError, 'Unknown string format',
+ self.assertRaisesRegex(ParserError, 'Unknown string format',
parse, '04/04/04 +32423', fuzzy_with_tokens=True)
- assertRaisesRegex(self, ParserError, 'Unknown string format',
+ self.assertRaisesRegex(ParserError, 'Unknown string format',
parse, '04/04/0d4', fuzzy_with_tokens=True)
def testIncreasingCTime(self):
--- a/tests/test_rrule.py
+++ b/tests/test_rrule.py
@@ -3,7 +3,6 @@ from __future__ import unicode_literals
from datetime import datetime, date
import unittest
-from six import PY2
from dateutil import tz
from dateutil.rrule import (
@@ -2282,27 +2281,6 @@ class RRuleTest(unittest.TestCase):
datetime(2010, 3, 22, 13, 1),
datetime(2010, 3, 22, 14, 1)])
- def testLongIntegers(self):
- if PY2: # There are no longs in python3
- self.assertEqual(list(rrule(MINUTELY,
- count=long(2),
- interval=long(2),
- bymonth=long(2),
- byweekday=long(3),
- byhour=long(6),
- byminute=long(6),
- bysecond=long(6),
- dtstart=datetime(1997, 9, 2, 9, 0))),
- [datetime(1998, 2, 5, 6, 6, 6),
- datetime(1998, 2, 12, 6, 6, 6)])
- self.assertEqual(list(rrule(YEARLY,
- count=long(2),
- bymonthday=long(5),
- byweekno=long(2),
- dtstart=datetime(1997, 9, 2, 9, 0))),
- [datetime(1998, 1, 5, 9, 0),
- datetime(2004, 1, 5, 9, 0)])
-
def testHourlyBadRRule(self):
"""
When `byhour` is specified with `freq=HOURLY`, there are certain
@@ -4577,24 +4555,6 @@ class RRuleTest(unittest.TestCase):
wkst=SU,
dtstart=datetime(1997, 9, 2, 9, 0)))
- def testToStrLongIntegers(self):
- if PY2: # There are no longs in python3
- self._rrulestr_reverse_test(rrule(MINUTELY,
- count=long(2),
- interval=long(2),
- bymonth=long(2),
- byweekday=long(3),
- byhour=long(6),
- byminute=long(6),
- bysecond=long(6),
- dtstart=datetime(1997, 9, 2, 9, 0)))
-
- self._rrulestr_reverse_test(rrule(YEARLY,
- count=long(2),
- bymonthday=long(5),
- byweekno=long(2),
- dtstart=datetime(1997, 9, 2, 9, 0)))
-
def testReplaceIfSet(self):
rr = rrule(YEARLY,
count=1,
--- a/tests/test_tz.py
+++ b/tests/test_tz.py
@@ -7,7 +7,6 @@ from ._common import ComparesEqual
from datetime import datetime, timedelta
from datetime import time as dt_time
from datetime import tzinfo
-from six import PY2
from io import BytesIO, StringIO
import unittest
@@ -1114,11 +1113,6 @@ def test_gettz_badzone_unicode():
b"America/New_York",
".*should be str, not bytes.*",
id="bytes on Python 3",
- marks=[
- pytest.mark.skipif(
- PY2, reason="bytes arguments accepted in Python 2"
- )
- ],
),
pytest.param(
object(),
--- a/updatezinfo.py
+++ b/updatezinfo.py
@@ -4,8 +4,8 @@ import hashlib
import json
import io
-from six.moves.urllib import request
-from six.moves.urllib import error as urllib_error
+from urllib import request
+from urllib import error as urllib_error
try:
import dateutil