Rotate-backups

Latest version: v8.1

Safety actively analyzes 613734 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 6

8.1

---------------------------

- Bug fix to really make the 'hour', 'minute' and 'second' capture groups in
user defined timestamp patterns optional (this fixes issue `26`_).

- Fixed :man:`humanfriendly` 8 deprecation warnings.

.. _Release 8.1: https://github.com/xolox/python-rotate-backups/compare/8.0...8.1
.. _26: https://github.com/xolox/python-rotate-backups/issues/26

8.0

---------------------------

This is a bit of an awkward release:

- An :exc:`~exceptions.ImportError` was reported in issue `24`_ caused by a
backwards incompatible change in :pypi:`humanfriendly` concerning an
undocumented module level variable (shouldn't have used that).

- I've now updated :pypi:`rotate-backups` to be compatible with the newest
release of :pypi:`humanfriendly` however in the mean time that package
dropped support for Python 3.4.

- This explains how a simple bug fix release concerning two lines in the code
base triggered a major version bump because compatibility is changed.

- While I was at it I set up Python 3.8 testing on Travis CI which seems to
work fine, so I've documented Python 3.8 as compatible. Python 3.9 seems
to be a whole other story, I'll get to that soon.

.. _Release 8.0: https://github.com/xolox/python-rotate-backups/compare/7.2...8.0
.. _24: https://github.com/xolox/python-rotate-backups/issues/24

7.2

---------------------------

Merged pull request `23`_ which makes it possible to customize the regular
expression that's used to match timestamps in filenames using a new command
line option ``rotate-backups --timestamp-pattern``.

The pull request wasn't exactly complete (the code couldn't have run as
written, although it showed the general idea clear enough) so I decided to
treat `23`_ as more of a feature suggestion. However there was no reason no to
merge the pull request and use it as a base for my changes, hence why I decided
to do so despite rewriting the code.

Changes from the pull request:

- Renamed ``timestamp`` to :attr:`~rotate_backups.RotateBackups.timestamp_pattern`
to make it less ambiguous.

- Added validation that custom patterns provided by callers define
named capture groups corresponding to the required date components
(year, month and day).

- Rewrote the mapping from capture groups to :class:`datetime.datetime`
arguments as follows:

- Previously positional :class:`datetime.datetime` arguments were used
which depended on the order of capture groups in the hard coded
regular expression pattern to function correctly.

- Now that users can define their own patterns, this is no longer a
reasonable approach. As such the code now constructs and passes a
dictionary of keyword arguments to :class:`datetime.datetime`.

- Updated the documentation and the command line interface usage message to
describe the new command line option and configuration file option.

- Added tests for the new behavior.

.. _Release 7.2: https://github.com/xolox/python-rotate-backups/compare/7.1...7.2
.. _23: https://github.com/xolox/python-rotate-backups/pull/23

7.1

---------------------------

- Make it possibly to disable system logging using ``rotate-backups
--syslog=false`` (fixes `20`_).

- Explicitly support numeric :man:`ionice` classes (as required by
:man:`busybox` and suggested in `14`_):

- This follows up on a pull request to :pypi:`executor` (a dependency of
:pypi:`rotate-backups`) that was merged in 2018.

- Since that pull request was merged this new "feature" has been implicitly
supported by :pypi:`rotate-backups` by upgrading the installed version of
the :pypi:`executor` package, however this probably wasn't clear to anyone
who's not a Python developer 😇.

- I've now merged pull request `14`_ which adds a test to confirm that
numeric :man:`ionice` classes are supported.

- I also bumped the :pypi:`executor` requirement and updated the usage
instructions to point out that numeric :man:`ionice` classes are now
supported.

.. _Release 7.1: https://github.com/xolox/python-rotate-backups/compare/7.0...7.1
.. _20: https://github.com/xolox/python-rotate-backups/issues/20
.. _14: https://github.com/xolox/python-rotate-backups/pull/14

7.0

---------------------------

**Significant changes:**

- Sanity checks are done to ensure the directory with backups exists, is
readable and is writable. However `18`_ made it clear that such sanity
checks can misjudge the situation, which made me realize an escape hatch
should be provided. The new ``--force`` option makes ``rotate-backups``
continue even if sanity checks fail.

- Skip the sanity check that the directory with backups is writable when the
``--removal-command`` option is given (because custom removal commands imply
custom semantics, see `18`_ for an example).

**Miscellaneous changes:**

- Start testing on Python 3.7 and document compatibility.
- Dropped Python 2.6 (I don't think anyone still cares about this 😉).
- Copied Travis CI workarounds for MacOS from :pypi:`humanfriendly`.
- Updated ``Makefile`` to use Python 3 for local development.
- Bumped copyright to 2020.

.. _Release 7.0: https://github.com/xolox/python-rotate-backups/compare/6.0...7.0
.. _18: https://github.com/xolox/python-rotate-backups/issues/18

6.0

---------------------------

This is a bug fix release that changes the behavior of the program, and because
`rotate-backups` involves the deletion of important files I'm considering this
a significant change in behavior that deserves a major version bump...

It was reported in issue `12`_ that filenames that match the filename pattern
but contain digits with invalid values for the year/month/day/etc fields would
cause a ``ValueError`` exception to be raised.

Starting from this release these filenames are ignored instead, although a
warning is logged to make sure the operator understands what's going on.

.. _Release 6.0: https://github.com/xolox/python-rotate-backups/compare/5.3...6.0
.. _12: https://github.com/xolox/python-rotate-backups/issues/12

Page 1 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.