Ubelt

Latest version: v1.3.5

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

Scan your dependencies

Page 2 of 11

1.2.2

Added

* Add `ubelt.util_dict.UDict.take`.
* Added `__add__`, `__radd__`, `startswith`, and `endswith` methods to `ubelt.Path` to make
it a better drop-in replacement for string based paths.

Changed
* Reverse dunder methods of `ubelt.SetDict` now promote the type.
* Add `cls` keyword argument to `ubelt.SetDict` methods.
* Deprecate: `ensure_app_cache_dir`, `ensure_app_config_dir`, `ensure_app_data_dir`,
`get_app_cache_dir`, `get_app_config_dir`, `get_app_data_dir`, `readfrom`, `writeto`, `ensure_unicode`.
* Initial work on new Path methods for move and copy.
* CacheStamp.renew now does nothing and returns None if the stamp is disabled.
* AutoDict, SetDict, and UDict are now always ordered. In Python 3.6 it inherits from OrderedDict. Otherwise it uses regular dict, which will be ordered in 3.7+
* AutoDict now inherits from UDict.
* PathLike objects can now be used in args to ub.cmd when the command is an iterable.


Deprecated
* deprecate AutoOrderedDict, which is now indistinguishable from AutoDict


Fixed
* Tentative fixes for new `__editable__` based install path with `ub.modname_to_modpath`

1.2.1

Fixed
* Implemented inplace and reverse versions of dictionary set operations
* Added copy to setdict

1.2.0

Added
* Added keywords argument to `ub.compatible`.
* Added `warncls` argument to `ub.schedule_deprecation`.
* Experimental SetDict, UDict and aliases sdict, udict.

Fixed
* Race condition on win32 in `ubelt.symlink`
* Issue with `ubelt.memoize_method` where the method name and docstring were
not wrapped correctly.
* The `timeout` argument now works correctly with `ub.cmd` when `tee=True`.
* Added `appname` to `ubelt.download` which was supposed to exist as indicated
by the docs, but didn't.
* The resources used by `ubelt.cmd` are now properly closed.

Changed
* `ub.compatible` no longer errors on positional only functions, instead it
returns the keyword-compatible arguments.
* An issue in `ubelt.symlink` with unintuitive behavior when an empty string
was given as the link path. This now raises an error.
* The main implementations of `ubelt.sorted_vals` and `ubelt.map_vals` were
renamed to `ubelt.sorted_values` and `ubelt.map_values`, but the old names
are still available as aliases.
* Positional arguments in `Path.augment` have been modified.
* In `Path.augment`, deprecate overloaded `suffix` and introduce `stemsuffix`
as an alternative.
* Added cls to a lot of util_dict funcs

1.1.2

Added
* Added new module `util_deprecate` with the function `schedule_deprecation`,
which is generally useful for library maintenance.

Fixed
* Fixed issue where ubelt Cacher triggered its own warnings
* Fixed deprecated usage of LooseVersion

Changed
* Tentative deprecation or backwards incompatible change in ub.Path.augment with suffix or prefix keywords

1.1.1

Changed
* Removed warning from `ubelt.Cacher` when depends is not specified.
* `ub.timestamp` / `ub.timeparse` now respects a `default_timezone` argument and handles `datetime.date` objects.
* Type stubs are now included in the distribution

Fixed
* Issue 113, where a `ub.find_exe` test failed on Gentoo. Fixed by 114
* Issue where older versions of CacheStamp would be interpreted as 1.1 stamps.

1.1.0

Added
* New method: `ub.timeparse` can parse the result of `ub.timestamp` into a
`datetime` object. Can optionally use `dateutil.parser.parse` under the hood.
* `ub.Path.ls` a convenience function that aliases `list(path.iterdir())`.
* `ub.Path.walk` to wrap `os.walk`.

Changed
* Register `pathlib.Path` with `ub.repr2`
* Can now register global `ub.repr2` extensions via `ub.repr2.register`
* Can now register global `ub.hash_data` extensions via `ub.hash_data.register`
* Removed deprecated arguments from `ubelt.cmd`.
* `ub.CacheStamp` will now check the mtime and size to quickly check if the products
have changed and force expiration.
* `ub.CacheStamp` now takes an `expires` keyword arg, which will keep the cache valid
only for the specified amount of time.
* `ub.CacheStamp` now takes an `hash_prefix` keyword arg, which will check that it
matches the hash of the product.
* `ub.cmd` now has a `system` argument for modularity with `os.system`.
* `ub.cmd` now accepts a `timeout` argument (tee support is pending).
* `ub.JobPool` now contains a protected `_prog` variable allowing the user
finer-grained progress controls.
* `ub.JobPool` now contains a convenience method `join` that executes all jobs
and returns a list of results.
* `ub.timestamp` can now accept a `datetime` object as an argument, and will return
the timestamp for that object.
* The `ubelt.util_download.grabdata` function now uses `CacheStamp` instead of
implementing its own stamp solution.
* The `ubelt.util_hash.HashableExtensions` implementation was updated to use
`functools.singledispatch` instead of the custom solution. This seems faster
and should not have any API impact.

Deprecated
* `product` and `cfgstr` arguments to `CacheStamp.expired`
* `product` and `cfgstr` arguments to `CacheStamp.renew`
* Passing `hasher` as an instance to functions like `grabdata` or `CacheStamp`
can cause unexpected hashes as they may be used more than once.

Fixed
* `ub.hash_data` now recognizes subclasses of registered types.
* `ub.timestamp()` has been outputting incorrect (negated) UTC offsets. This is now fixed.
* `ub.timestamp()` now works correctly when the year has less than 4 digits.

Page 2 of 11

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.