All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
This project uses towncrier and the changes for the upcoming release can be found in changelog.d.
1.26.0 - 2023-11-20
- Add
expires
,content_disposition
,content_encoding
,content_language
arguments to variousBucket
methods (#357)
- Towncrier changelog generation - to avoid conflicts when simultaneously working on PRs
- Add
*_PART_SIZE
,BUCKET_NAME_*
,STDOUT_FILEPATH
constants - Add
points_to_fifo
,points_to_stdout
functions
- Mark
TempDir
as deprecated in favor oftempfile.TemporaryDirectory
- Fix downloading to a non-seekable file, such as /dev/stdout
- Fix ScanPoliciesManager support for compiled regexes
- Fix readthedocs build by updating to v2 configuration schema
- Fix spellcheck erroring out on LICENSE file
- Fix snyk reporting vulnerability due to tornado package use in docs generation
- Deduplicate test_base files in test suite
- Refactor integration tests for better pytest compatibility & eager bucket cleanup
- Fix missing key ID for large file encrypted with SSE-C
- Fix concatenating error message when message is None
- 'bypass_governance' flag to delete_file_version
- Add
get_file_info_by_name
to the B2Api class
- Require
typing_extensions
on Python 3.11 (already required on earlier versions) for better compatibility with pydantic v2 - Fix
RawSimulator
handling ofcache_control
parameter during tests.
- Fix regression in dir exclusion patterns introduced in 1.22.0
- Declare official support of Python 3.12
- Improved
lifecycle_rules
argument type annotations
- Deprecate
file_infos
argument. Usefile_info
instead. Old argument name won't be supported in v3.
version_utils
decorators now ignorecurrent_version
parameter to better fitapiver
needs
- Circular symlinks no longer cause infinite loops when syncing a folder
- Fix crash on upload retry with unbound data source
- Remove unsupported PyPy versions (3.7, 3.8) from tests matrix and add PyPy 3.9 & 3.10 instead
- Replaced
pyflakes
withruff
for linting - Refactored logic for resuming large file uploads to unify code paths, correct inconsistencies, and enhance configurability (#381)
- Automatically set copyright date when generating the docs
- Use modern type hints in documentation (achieved through combination of PEP 563 & 585 and
sphinx-autodoc-typehints
)
- Add support for custom upload timestamp
- Add support for cache control header while uploading
- Remove dependency from
arrow
- Build Python wheels for distribution
- Add
use_cache
parameter toB2Api.list_buckets
- Connection timeout is now being set explicitly
- Small files downloaded twice
- Disable changelog verification for dependabot PRs
- Authorizing a key for a single bucket ensures that this bucket is cached
Bucket.ls
operation supports wildcard matching strings- Documentation for
AbstractUploadSource
and its children InvalidJsonResponse
when the received error is not a proper JSON document- Raising
PotentialS3EndpointPassedAsRealm
when a specific misconfiguration is suspected - Add
large_file_sha1
support - Add support for incremental upload and sync
- Ability to stream data from an unbound source to B2 (for example stdin)
- Removed information about replication being in closed beta
- Don't throw raw
OSError
exceptions when usingDownloadedFile.save_to
to a path that doesn't exist, is a directory or the user doesn't have permissions to write to
- Additional tests for listing files/versions
- Ensured that changelog validation only happens on pull requests
- Upgraded GitHub actions checkout to v3, python-setup to v4
- Additional tests for
IncrementalHexDigester
- Logging performance summary of parallel download threads
- Add
max_download_streams_per_file
parameter to B2Api class and underlying structures - Add
is_file_lock_enabled
parameter toBucket.update()
and related methods
- Replace
ReplicationScanResult.source_has_sse_c_enabled
withsource_encryption_mode
- Fix
B2Api.get_key()
andRawSimulator.delete_key()
- Fix calling
CopySizeTooBig
exception
- Fix nox's deprecated
session.install()
calls - Re-enable changelog validation in CI
- StatsCollector contains context managers for gathering performance statistics
- Fix
FileVersion._get_upload_headers
when encryption key isNone
- Fix download integration tests on non-production environments
- Add
B2_DEBUG_HTTP
env variable to enable network-level test debugging - Disable changelog validation temporarily
- Fix a race in progress reporter
- Fix import of replication
- Fix importing scan module
As in version 1.16.0, the replication API may still be unstable, however no backward-incompatible changes are planned at this point.
- Add
included_sources
module for keeping track of included modified third-party libraries - Add
include_existing_files
parameter toReplicationSetupHelper
- Add
get_b2sdk_doc_urls
function for extraction of external documentation URLs during runtime
- Downloading compressed files with
Content-Encoding
header set no longer causes them to be decompressed on the fly - it's an option - Change the per part retry limit from 5 to 20 for data transfer operations. Please note that the retry system is not considered to be a part of the public interface and is subject to be adjusted
- Do not wait more than 64 seconds between retry attempts (unless server asks for it)
- On longer failures wait an additional (random, up to 1s) amount of time to prevent client synchronization
- Flatten
ReplicationConfiguration
interface - Reorder actions of
ReplicationSetupHelper
to avoid zombie rules
- Fix: downloading compressed files and decompressing them on the fly now does not cause a TruncatedOutput error
- Fix
AccountInfo.is_master_key()
- Fix docstring of
SqliteAccountInfo
- Fix lifecycle rule type in the docs
- Add 3.11.0-beta.1 to CI
- Change Sphinx major version from 5 to 6
- Extract folder/bucket scanning into a new
scan
module - Enable pip cache in CI
This release contains a preview of replication support. It allows for basic usage of B2 replication feature (currently in closed beta).
As the interface of the sdk (and the server api) may change, the replication support shall be considered PRIVATE interface and should be used with caution. Please consult the documentation on how to safely use the private api interface.
Expect substantial amount of work on sdk interface:
- The interface of
ReplicationConfiguration
WILL change - The interface of
FileVersion.replication_status
MIGHT change - The interface of
FileVersionDownload
MIGHT change
- Add basic replication support to
Bucket
andFileVersion
- Add
is_master_key()
method toAbstractAccountInfo
- Add
readBucketReplications
andwriteBucketReplications
toALL_CAPABILITIES
- Add log tracing of
interpret_b2_error
- Add
ReplicationSetupHelper
- Fix license test on Windows
- Fix cryptic errors when running integration tests with a non-full key
- Don't run coverage in pypy in CI
- Introduce a common thread worker pool for all downloads
- Increase http timeout to 20min (for copy using 5GB parts)
- Remove inheritance from object (leftover from python2)
- Run unit tests on all CPUs
- Add pypy-3.8 to test matrix
- Add support for unverified checksum upload mode
- Add dedicated exception for unverified email
- Add a parameter to customize
sync_policy_manager
- Add parameters to set the min/max part size for large file upload/copy methods
- Add CopySourceTooBig exception
- Add an option to set a custom file version class to
FileVersionFactory
- Add an option for B2Api to turn off hash checking for downloaded files
- Add an option for B2Api to set write buffer size for
DownloadedFile.save_to
method - Add support for multiple profile files for SqliteAccountInfo
- Fix copying objects larger than 1TB
- Fix uploading objects larger than 1TB
- Fix downloading files with unverified checksum
- Fix decoding in filename and file info of
DownloadVersion
- Fix an off-by-one bug and other bugs in the Simulator copy functionality
- Drop support for Python 3.5 and Python 3.6
- Fix setting permissions for local sqlite database (thanks to Jan Schejbal for responsible disclosure!)
- Relax constraint on arrow to allow for versions >= 1.0.2
- Add support for Python 3.10
- Update a list with all capabilities
- Fix pypy selector in CI
- The
importlib-metadata
requirement is less strictly bound now (just >=3.3.0 for python > 3.5). B2Api
update_file_legal_hold
andupdate_file_retention_setting
now return the set values
BucketIdNotFound
thrown based on B2 cloud response_clone
method toFileVersion
andDownloadVersion
delete
,update_legal_hold
,update_retention
anddownload
methods added toFileVersion
- FileSimulator returns special file info headers properly
- One unused import.
- apiver
v2
interface released.from b2sdk.v2 import ...
is now the recommended import, butfrom b2sdk.v1 import ...
works as before
get_fresh_state
method added toFileVersion
andBucket
download_file_*
methods refactored to allow for inspecting DownloadVersion before downloading the whole fileB2Api.get_file_info
returns aFileVersion
object in v2B2RawApi
renamed toB2RawHTTPApi
B2HTTP
tests are now commonB2HttpApiConfig
class introduced to provide parameters likeuser_agent_append
toB2Api
without using internal classes in v2Bucket.update
returns aBucket
object in v2Bucket.ls
argumentshow_versions
renamed tolatest_only
in v2B2Api
application key methods refactored to operate with dataclasses instead of dicts in v2B2Api.list_keys
is a generator lazily fetching all keys in v2account_id
andbucket_id
added to FileVersion
- Fix EncryptionSetting.from_response_headers
- Fix FileVersion.size and FileVersion.mod_time_millis type ambiguity
- Old buckets (from past tests) are cleaned up before running integration tests in a single thread
- Remove deprecated
SyncReport
methods
ScanPoliciesManager
is able to filter b2 files by upload timestamp
Synchronizer.make_file_sync_actions
andSynchronizer.make_folder_sync_actions
were made private in v2 interface- Refactored
sync.file.*File
andsync.file.*FileVersion
tosync.path.*SyncPath
in v2 - Refactored
FileVersionInfo
toFileVersion
in v2 ScanPoliciesManager
exclusion interface changed in v2B2Api
unittests for v0, v1 and v2 are now commonB2Api.cancel_large_file
returns aFileIdAndName
object instead of aFileVersion
object in v2FileVersion
has a mandatoryapi
parameter in v2B2Folder
holds a handle to B2ApiBucket
unit tests for v1 and v2 are now common
- Fix call to incorrect internal api in
B2Api.get_download_url_for_file_name
- Add
get_bucket_name_or_none_from_bucket_id
toAccountInfo
andCache
- Add possibility to change realm during integration tests
- Add support for "file locks": file retention, legal hold and default bucket retention
- Cleanup sync errors related to directories
- Use proper error handling in
ScanPoliciesManager
- Application key restriction message reverted to previous form
- Added missing apiver wrappers for FileVersionInfo
- Fix crash when Content-Range header is missing
- Pin dependency versions appropriately
b2sdk.v1.sync
refactored to reflectb2sdk.sync
structure- Make
B2Api.get_bucket_by_id
return populated bucket objects in v2 - Add proper support of
recommended_part_size
andabsolute_minimum_part_size
inAccountInfo
- Refactored
minimum_part_size
torecommended_part_size
(the value used stays the same) - Encryption settings, types and providers are now part of the public API
- Remove
Bucket.copy_file
andBucket.start_large_file
- Remove
FileVersionInfo.format_ls_entry
andFileVersionInfo.format_folder_ls_entry
- Add
__slots__
and__eq__
toFileVersionInfo
for memory usage optimization and ease of testing - Add support for SSE-C server-side encryption mode
- Add support for
XDG_CONFIG_HOME
for determining the location ofSqliteAccountInfo
db file
BasicSyncEncryptionSettingsProvider
supports different settings sets for reading and writing- Refactored AccountInfo tests to a single file using pytest
- Fix clearing cache during
authorize_account
- Fix
ChainedStream
(needed inBucket.create_file
etc.) - Make tqdm-based progress reporters less jumpy and easier to read
- Fix emerger examples in docs
- Fetch S3-compatible API URL from
authorize_account
- Exclude packages inside the test package when installing
- Fix for server response change regarding SSE
- Add
dependabot.yml
- Add support for SSE-B2 server-side encryption mode
- Add upper version limit for the requirements
- Pin
setuptools-scm<6.0
as>=6.0
doesn't support Python 3.5
- Add an ability to provide
bucket_id
filter parameter forlist_buckets
- Add
is_same_key
method toAccountInfo
- Add upper version limit for arrow dependency, because of a breaking change
- Fix docs autogen
- Add custom exception for
403 transaction_cap_exceeded
- Add
get_file_info_by_id
andget_file_info_by_name
toBucket
FileNotPresent
andNonExistentBucket
now subclass new exceptionsFileOrBucketNotFound
andResourceNotFound
- Fix missing import in the synchronization example
- Use
setuptools-scm
for versioning - Clean up CI steps
- Add support for Python 3.9
- Support for bucket to bucket sync
- Add a possibility to append a string to the User-Agent in
B2Http
- Change default fetch count for
ls
to 10000
- Drop Python 2 and Python 3.4 support 🎉
- Remove
--prefix
fromls
(it didn't really work, usefolderName
argument)
- Allow to set an empty bucket info during the update
- Fix docs generation in CI
- Allow specifying custom realm in B2Session.authorize_account
- Fix upload part for file range on Python 2.7
- Add
list_file_versions
method to buckets. - Add server-side copy support for large files
- Add ability to synthesize objects from local and remote sources
- Add AuthInfoCache, InMemoryCache and AbstractCache to public interface
- Add ability to filter in ScanPoliciesManager based on modification time
- Add ScanPoliciesManager and SyncReport to public interface
- Add md5 checksum to FileVersionInfo
- Add more keys to dicts returned by as_dict() methods
- Make sync treat hidden files as deleted
- Ignore urllib3 "connection pool is full" warning
- Remove arrow warnings caused by arrow-py/arrow#612
- Fix handling of modification time of files
- Remove upper version limit for arrow dependency
- Minor bug fix.
- Deprecate some transitional method names to v0 in preparation for v1.0.0.
- Remove a parameter (which did nothing, really) from
b2sdk.v1.Bucket.copy_file
signature
- Add support for b2_copy_file
- Add support for
prefix
parameter on ls-like calls
- Rename account ID for authentication to application key ID. Account ID is still backwards compatible, only the terminology has changed.
- Fix transferer crashing on empty file download attempt
Initial official release of SDK as a separate package (until now it was a part of B2 CLI)