Skip to content

Commit 95acd27

Browse files
authored
Merge pull request #857 from Backblaze/prepare-3.7.1
Prepare release 3.7.1
2 parents 52d5e28 + 75e6ec8 commit 95acd27

7 files changed

Lines changed: 70 additions & 119 deletions

File tree

.github/workflows/cd.yml

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -83,54 +83,6 @@ jobs:
8383
draft: ${{ env.ACTIONS_STEP_DEBUG == 'true' }}
8484
prerelease: false
8585
files: ${{ steps.sign.outputs.asset_path }}
86-
deploy-macos-bundle:
87-
needs: deploy
88-
env:
89-
B2_OSX_CODE_SIGNING_CERTIFICATE: ${{ secrets.B2_OSX_CODE_SIGNING_CERTIFICATE }}
90-
B2_OSX_CODE_SIGNING_CERTIFICATE_NAME: ${{ secrets.B2_OSX_CODE_SIGNING_CERTIFICATE_NAME }}
91-
B2_OSX_CODE_SIGNING_CERTIFICATE_PASSWORD: ${{ secrets.B2_OSX_CODE_SIGNING_CERTIFICATE_PASSWORD }}
92-
B2_OSX_NOTARY_NAME: ${{ secrets.B2_OSX_NOTARY_NAME }}
93-
B2_OSX_NOTARY_PASSWORD: ${{ secrets.B2_OSX_NOTARY_PASSWORD }}
94-
runs-on: macos-10.15
95-
steps:
96-
- uses: actions/checkout@v3
97-
with:
98-
fetch-depth: 0
99-
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }}
100-
uses: actions/setup-python@v4
101-
with:
102-
python-version: ${{ env.PYTHON_DEFAULT_VERSION }}
103-
- name: Install dependencies
104-
run: python -m pip install --upgrade nox pip setuptools
105-
- name: Bundle the distribution
106-
id: bundle
107-
run: nox -vs bundle >> $GITHUB_OUTPUT
108-
- name: Import certificate
109-
uses: apple-actions/import-codesign-certs@v1
110-
with:
111-
p12-file-base64: ${{ env.B2_OSX_CODE_SIGNING_CERTIFICATE }}
112-
p12-password: ${{ env.B2_OSX_CODE_SIGNING_CERTIFICATE_PASSWORD }}
113-
- name: Sign the bundle
114-
id: sign
115-
run: nox -vs sign -- '${{ env.B2_OSX_CODE_SIGNING_CERTIFICATE_NAME }}' >> $GITHUB_OUTPUT
116-
- name: Notarize the bundle
117-
if: ${{ env.B2_OSX_NOTARY_NAME != '' }}
118-
uses: devbotsxyz/xcode-notarize@v1
119-
with:
120-
product-path: ${{ steps.sign.outputs.asset_path }}
121-
appstore-connect-username: ${{ env.B2_OSX_NOTARY_NAME }}
122-
appstore-connect-password: ${{ env.B2_OSX_NOTARY_PASSWORD }}
123-
primary-bundle-id: com.backblaze.b2
124-
- name: Generate hashes
125-
id: hashes
126-
run: nox -vs make_dist_digest
127-
- name: Upload the bundle to the GitHub release
128-
uses: softprops/action-gh-release@v1
129-
with:
130-
name: ${{ needs.deploy.outputs.version }}
131-
draft: ${{ env.ACTIONS_STEP_DEBUG == 'true' }}
132-
prerelease: false
133-
files: ${{ steps.sign.outputs.asset_path }}
13486
deploy-windows-bundle:
13587
needs: deploy
13688
env:

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ jobs:
138138
path: ${{ steps.bundle.outputs.asset_path }}
139139
if-no-files-found: warn
140140
retention-days: 7
141-
test-macos-and-windows-bundle:
141+
test-windows-bundle:
142142
needs: cleanup_buckets
143143
env:
144144
B2_TEST_APPLICATION_KEY: ${{ secrets.B2_TEST_APPLICATION_KEY }}
@@ -147,7 +147,7 @@ jobs:
147147
strategy:
148148
fail-fast: false
149149
matrix:
150-
os: [macos-11, windows-2019]
150+
os: [windows-2019, windows-latest]
151151
steps:
152152
- uses: actions/checkout@v3
153153
with:

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [3.7.1] - 2023-02-08
10+
911
### Fixed
1012
* Remove unnecessary printing options from `rm`
1113
* Clarify that `--recursive` is required when `--withWildcard` is used
14+
* Adjust description of `rm`
15+
16+
### Infrastructure
17+
* Remove macos stand-alone binary from CI/CD
1218

1319
## [3.7.0] - 2023-02-07
1420

@@ -394,7 +400,8 @@ This version is pinned strictly to `b2-sdk-python==1.16.0` for the same reason.
394400
* Fix an off-by-one issue when downloading a range of a file (affects library, but not CLI).
395401
* Better handling of some errors from the B2 service.
396402

397-
[Unreleased]: https://github.com/Backblaze/B2_Command_Line_Tool/compare/v3.7.0...HEAD
403+
[Unreleased]: https://github.com/Backblaze/B2_Command_Line_Tool/compare/v3.7.1...HEAD
404+
[3.7.1]: https://github.com/Backblaze/B2_Command_Line_Tool/compare/v3.7.1...v3.7.1
398405
[3.7.0]: https://github.com/Backblaze/B2_Command_Line_Tool/compare/v3.6.0...v3.7.0
399406
[3.6.0]: https://github.com/Backblaze/B2_Command_Line_Tool/compare/v3.5.0...v3.6.0
400407
[3.5.0]: https://github.com/Backblaze/B2_Command_Line_Tool/compare/v3.4.0...v3.5.0

README.md

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,47 @@ The latest documentation is available on [Read the Docs](https://b2-command-line
1414

1515
# Installation
1616

17-
Stand-alone binaries are available for Linux, MacOS and Windows - this is the most straightforward way to use the
18-
command-line tool and is sufficient in most use cases. The latest versions are available for download from the
19-
[Releases page](https://github.com/Backblaze/B2_Command_Line_Tool/releases).
17+
Detailed instructions on how to install the command line tool can be found [here](https://www.backblaze.com/b2/docs/quick_command_line.html)
2018

21-
Alternatively, you can install with:
19+
## Homebrew
20+
21+
[Homebrew](https://brew.sh/) is widely used in the Mac community, particularly amongst developers. We recommend using the [B2 CLI Homebrew](https://formulae.brew.sh/formula/b2-tools) formula as the quickest setup method for Mac users:
22+
```
23+
brew install b2-tools
24+
```
25+
26+
## Binaries
27+
28+
Stand-alone binaries are available for Linux and Windows - this is the most straightforward way to use the command-line tool and is sufficient in most use cases. The latest versions are available for download from the [Releases page](https://github.com/Backblaze/B2_Command_Line_Tool/releases).
29+
30+
## Python Package Index
31+
32+
You can also install it in your python environment ([virtualenv](https://pypi.org/project/virtualenv/) is recommended) from PyPI with:
2233

2334
pip install b2
2435

36+
## Installing from source
37+
38+
If installing from the repository is needed in order to, for example, check if a pre-release version resolves a bug effectively, it can be installed with:
39+
40+
python3 setup.py install
41+
42+
In this case of installing a pre-release, [virtualenv](https://pypi.org/project/virtualenv/) is strongly recommended.
43+
2544
# Usage
2645

2746
b2 authorize-account [-h] [applicationKeyId] [applicationKey]
2847
b2 cancel-all-unfinished-large-files [-h] bucketName
2948
b2 cancel-large-file [-h] fileId
3049
b2 clear-account [-h]
3150
b2 copy-file-by-id [-h] [--fetchMetadata] [--contentType CONTENTTYPE] [--range RANGE] [--info INFO | --noInfo] [--destinationServerSideEncryption {SSE-B2,SSE-C}] [--destinationServerSideEncryptionAlgorithm {AES256}] [--sourceServerSideEncryption {SSE-C}] [--sourceServerSideEncryptionAlgorithm {AES256}] [--fileRetentionMode {compliance,governance}] [--retainUntil TIMESTAMP] [--legalHold {on,off}] sourceFileId destinationBucketName b2FileName
32-
b2 create-bucket [-h] [--bucketInfo BUCKETINFO] [--corsRules CORSRULES] [--lifecycleRules LIFECYCLERULES] [--fileLockEnabled] [--defaultServerSideEncryption {SSE-B2,none}] [--defaultServerSideEncryptionAlgorithm {AES256}] bucketName bucketType
51+
b2 create-bucket [-h] [--bucketInfo BUCKETINFO] [--corsRules CORSRULES] [--lifecycleRules LIFECYCLERULES] [--fileLockEnabled] [--replication REPLICATION] [--defaultServerSideEncryption {SSE-B2,none}] [--defaultServerSideEncryptionAlgorithm {AES256}] bucketName bucketType
3352
b2 create-key [-h] [--bucket BUCKET] [--namePrefix NAMEPREFIX] [--duration DURATION] [--allCapabilities] keyName [capabilities]
3453
b2 delete-bucket [-h] bucketName
3554
b2 delete-file-version [-h] [fileName] fileId
3655
b2 delete-key [-h] applicationKeyId
37-
b2 download-file-by-id [-h] [--noProgress] [--sourceServerSideEncryption {SSE-C}] [--sourceServerSideEncryptionAlgorithm {AES256}] fileId localFileName
38-
b2 download-file-by-name [-h] [--noProgress] [--sourceServerSideEncryption {SSE-C}] [--sourceServerSideEncryptionAlgorithm {AES256}] bucketName b2FileName localFileName
56+
b2 download-file-by-id [-h] [--noProgress] [--threads THREADS] [--sourceServerSideEncryption {SSE-C}] [--sourceServerSideEncryptionAlgorithm {AES256}] [--write-buffer-size BYTES] [--skip-hash-verification] [--max-download-streams-per-file MAX_DOWNLOAD_STREAMS_PER_FILE] fileId localFileName
57+
b2 download-file-by-name [-h] [--noProgress] [--threads THREADS] [--sourceServerSideEncryption {SSE-C}] [--sourceServerSideEncryptionAlgorithm {AES256}] [--write-buffer-size BYTES] [--skip-hash-verification] [--max-download-streams-per-file MAX_DOWNLOAD_STREAMS_PER_FILE] bucketName b2FileName localFileName
3958
b2 get-account-info [-h]
4059
b2 get-bucket [-h] [--showSize] bucketName
4160
b2 get-file-info [-h] fileId
@@ -46,16 +65,22 @@ Alternatively, you can install with:
4665
b2 list-keys [-h] [--long]
4766
b2 list-parts [-h] largeFileId
4867
b2 list-unfinished-large-files [-h] bucketName
49-
b2 ls [-h] [--long] [--json] [--versions] [--recursive] [--withWildcard] bucketName [folderName]
50-
b2 rm [-h] [--versions] [--recursive] [--withWildcard] [--dryRun] [--threads THREADS] [--queueSize QUEUESIZE] [--noProgress] [--failFast] bucketName [folderName/fileName]
68+
b2 ls [-h] [--long] [--json] [--replication] [--versions] [--recursive] [--withWildcard] bucketName [folderName]
69+
b2 rm [-h] [--dryRun] [--threads THREADS] [--queueSize QUEUESIZE] [--noProgress] [--failFast] [--versions] [--recursive] [--withWildcard] bucketName [folderName]
5170
b2 make-url [-h] fileId
5271
b2 make-friendly-url [-h] bucketName fileName
53-
b2 sync [-h] [--noProgress] [--dryRun] [--allowEmptySource] [--excludeAllSymlinks] [--threads THREADS] [--compareVersions {none,modTime,size}] [--compareThreshold MILLIS] [--excludeRegex REGEX] [--includeRegex REGEX] [--excludeDirRegex REGEX] [--excludeIfModifiedAfter TIMESTAMP] [--destinationServerSideEncryption {SSE-B2,SSE-C}] [--destinationServerSideEncryptionAlgorithm {AES256}] [--sourceServerSideEncryption {SSE-C}] [--sourceServerSideEncryptionAlgorithm {AES256}] [--skipNewer | --replaceNewer] [--delete | --keepDays DAYS] [--incrementalMode] source destination
54-
b2 update-bucket [-h] [--bucketInfo BUCKETINFO] [--corsRules CORSRULES] [--lifecycleRules LIFECYCLERULES] [--defaultRetentionMode {compliance,governance,none}] [--defaultRetentionPeriod period] [--defaultServerSideEncryption {SSE-B2,none}] [--defaultServerSideEncryptionAlgorithm {AES256}] bucketName bucketType
72+
b2 sync [-h] [--noProgress] [--dryRun] [--allowEmptySource] [--excludeAllSymlinks] [--threads THREADS] [--syncThreads SYNCTHREADS] [--downloadThreads DOWNLOADTHREADS] [--uploadThreads UPLOADTHREADS] [--compareVersions {none,modTime,size}] [--compareThreshold MILLIS] [--excludeRegex REGEX] [--includeRegex REGEX] [--excludeDirRegex REGEX] [--excludeIfModifiedAfter TIMESTAMP] [--destinationServerSideEncryption {SSE-B2,SSE-C}] [--destinationServerSideEncryptionAlgorithm {AES256}] [--sourceServerSideEncryption {SSE-C}] [--sourceServerSideEncryptionAlgorithm {AES256}] [--write-buffer-size BYTES] [--skip-hash-verification] [--max-download-streams-per-file MAX_DOWNLOAD_STREAMS_PER_FILE] [--incrementalMode] [--skipNewer | --replaceNewer] [--delete | --keepDays DAYS] source destination
73+
b2 update-bucket [-h] [--bucketInfo BUCKETINFO] [--corsRules CORSRULES] [--lifecycleRules LIFECYCLERULES] [--defaultRetentionMode {compliance,governance,none}] [--defaultRetentionPeriod period] [--replication REPLICATION] [--fileLockEnabled] [--defaultServerSideEncryption {SSE-B2,none}] [--defaultServerSideEncryptionAlgorithm {AES256}] bucketName [bucketType]
5574
b2 upload-file [-h] [--noProgress] [--quiet] [--contentType CONTENTTYPE] [--minPartSize MINPARTSIZE] [--sha1 SHA1] [--threads THREADS] [--info INFO] [--destinationServerSideEncryption {SSE-B2,SSE-C}] [--destinationServerSideEncryptionAlgorithm {AES256}] [--legalHold {on,off}] [--fileRetentionMode {compliance,governance}] [--retainUntil TIMESTAMP] [--incrementalMode] bucketName localFilePath b2FileName
5675
b2 update-file-legal-hold [-h] [fileName] fileId {on,off}
5776
b2 update-file-retention [-h] [--retainUntil TIMESTAMP] [--bypassGovernance] [fileName] fileId {governance,compliance,none}
77+
b2 replication-setup [-h] [--destination-profile DESTINATION_PROFILE] [--name NAME] [--priority PRIORITY] [--file-name-prefix PREFIX] [--include-existing-files] SOURCE_BUCKET_NAME DESTINATION_BUCKET_NAME
78+
b2 replication-delete [-h] SOURCE_BUCKET_NAME REPLICATION_RULE_NAME
79+
b2 replication-pause [-h] SOURCE_BUCKET_NAME REPLICATION_RULE_NAME
80+
b2 replication-unpause [-h] SOURCE_BUCKET_NAME REPLICATION_RULE_NAME
81+
b2 replication-status [-h] [--rule REPLICATION_RULE_NAME] [--destination-profile DESTINATION_PROFILE] [--dont-scan-destination] [--output-format {console,json,csv}] [--noProgress] [--columns COLUMN ONE,COLUMN TWO] SOURCE_BUCKET_NAME
5882
b2 version [-h]
83+
b2 license [-h]
5984

6085

6186
The environment variable `B2_ACCOUNT_INFO` specifies the sqlite
@@ -73,11 +98,9 @@ that command.
7398

7499
## Parallelism and the --threads parameter
75100

76-
Users with high performance networks, or file sets with very small files, may benefit from
77-
increased parallelism. Experiment with using the `--threads` parameter with small values to
78-
determine if there are benefits.
101+
Users with high performance networks, file sets with very small files or high network latency, will usually benefit from increased parallelism. Experiment with using the `--threads` parameter to increase performance.
79102

80-
Note that using multiple threads will usually be detrimental to the other users on your network.
103+
Note that using many threads could in some cases be detrimental to the other users on your network.
81104

82105
# Contrib
83106

README.release.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
# Release Process
22

3-
- Get the Nox:
4-
- `pip install -U nox`
53
- Update the release history in `CHANGELOG.md`:
64
- Change "Unreleased" to the current release version and date.
75
- Create empty "Unreleased" section.
86
- Add proper link to the new release (at the bottom of the file). Use GitHub [compare feature](https://docs.github.com/en/free-pro-team@latest/github/committing-changes-to-your-project/comparing-commits#comparing-tags) between two tags.
97
- Update "Unreleased" link (at the bottom of the file).
108
- Copy the main usage string (from `b2 --help`) to `README.md`.
11-
- Run linters and tests:
12-
- `export B2_TEST_APPLICATION_KEY=your_app_key`
13-
- `export B2_TEST_APPLICATION_KEY_ID=your_app_key_id`
14-
- `nox -x`
15-
- Build docs locally:
16-
- `nox --non-interactive -xs doc`
17-
- Commit and push to GitHub, then wait for CI workflow to complete successfully.
18-
- No need to make a branch. Push straight to `master`.
9+
- Commit and push to a GitHub branch, then wait for CI workflow to complete successfully.
10+
- Merge the PR
11+
- Pull from GitHub
1912
- Tag in git and push tag to `origin`. (Version tags look like `v0.4.6`.)
2013
- `git tag vx.x.x`
2114
- `git push origin vx.x.x`
@@ -24,4 +17,4 @@
2417
- Verify that the release has been uploaded to the PyPI
2518
- Install using `pip` and verify that it gets the correct version:
2619
- `pip install -U b2`
27-
- Update https://www.backblaze.com/b2/docs/quick_command_line.html
20+
- Update https://www.backblaze.com/b2/docs/quick_command_line.html if needed

b2/console_tool.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,10 +1731,10 @@ def run(self, args):
17311731

17321732
class AbstractLsCommand(Command, metaclass=ABCMeta):
17331733
"""
1734-
The ``--versions`` option shows all versions of each file, not
1734+
The ``--versions`` option selects all versions of each file, not
17351735
just the most recent.
17361736
1737-
The ``--recursive`` option will descend into folders, and will show
1737+
The ``--recursive`` option will descend into folders, and will select
17381738
only files, not folders.
17391739
17401740
The ``--withWildcard`` option will allow using ``*``, ``?`` and ```[]```
@@ -1906,20 +1906,29 @@ def format_ls_entry(self, file_version: FileVersion, replication: bool):
19061906
@B2.register_subcommand
19071907
class Rm(AbstractLsCommand):
19081908
"""
1909-
Removes a group of files. Use with caution.
1909+
Removes a "folder" or a set of files matching a pattern. Use with caution.
1910+
1911+
.. note::
1912+
1913+
``rm`` is a high-level command that under the hood utilizes multiple calls to the server,
1914+
which means the server cannot guarantee consistency between multiple operations. For
1915+
example if a file matching a pattern is uploaded during a run of ``rm`` command, it MIGHT
1916+
be deleted (as "latest") instead of the one present when the ``rm`` run has started.
1917+
1918+
In order to safely delete a single file version, please use ``delete-file-version``.
19101919
19111920
To list (but not remove) files to be deleted, use ``--dryRun``. You can also
1912-
list files via ``ls`` command the listing behaviour is exactly the same.
1921+
list files via ``ls`` command - the listing behaviour is exactly the same.
19131922
1914-
Users with high-performance networks or multiple files to be removed, will benefit
1915-
from multi-threaded capabilities. The default number of threads is 10.
1923+
Users with multiple files to be removed will benefit from multi-threaded
1924+
capabilities. The default number of threads is 10.
19161925
19171926
Progress is displayed on the console unless ``--noProgress`` is specified.
19181927
19191928
{ABSTRACTLSCOMMAND}
19201929
1921-
The ``--dryRun`` option prints all the files that
1922-
would be affected by the command, but removes nothing.
1930+
The ``--dryRun`` option prints all the files that would be affected by
1931+
the command, but removes nothing.
19231932
19241933
Normally, when an error happens during file removal, log is printed and the command
19251934
goes further. If any error should be immediately breaking the command,

noxfile.py

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@
5454
"staticx==0.13.5;platform_system=='Linux'",
5555
]
5656

57-
OSX_BUNDLE_IDENTIFIER = 'com.backblaze.b2'
58-
OSX_BUNDLE_ENTITLEMENTS = 'contrib/macos/entitlements.plist'
59-
6057
WINDOWS_TIMESTAMP_SERVER = 'http://timestamp.digicert.com'
6158
WINDOWS_SIGNTOOL_PATH = 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe'
6259

@@ -287,28 +284,6 @@ def bundle(session: nox.Session):
287284
def sign(session):
288285
"""Sign the bundled distribution (macOS and Windows only)."""
289286

290-
def sign_darwin(cert_name):
291-
session.run('security', 'find-identity', external=True, **run_kwargs)
292-
session.run(
293-
'codesign',
294-
'--deep',
295-
'--force',
296-
'--verbose',
297-
'--timestamp',
298-
'--identifier',
299-
OSX_BUNDLE_IDENTIFIER,
300-
'--entitlements',
301-
OSX_BUNDLE_ENTITLEMENTS,
302-
'--options',
303-
'runtime',
304-
'--sign',
305-
cert_name,
306-
'dist/b2',
307-
external=True,
308-
**run_kwargs
309-
)
310-
session.run('codesign', '--verify', '--verbose', 'dist/b2', external=True, **run_kwargs)
311-
312287
def sign_windows(cert_file, cert_password):
313288
session.run('certutil', '-f', '-p', cert_password, '-importpfx', cert_file, **run_kwargs)
314289
session.run(
@@ -338,15 +313,7 @@ def sign_windows(cert_file, cert_password):
338313
**run_kwargs
339314
)
340315

341-
if SYSTEM == 'darwin':
342-
try:
343-
certificate_name, = session.posargs
344-
except ValueError:
345-
session.error('pass the certificate name as a positional argument')
346-
return
347-
348-
sign_darwin(certificate_name)
349-
elif SYSTEM == 'windows':
316+
if SYSTEM == 'windows':
350317
try:
351318
certificate_file, certificate_password = session.posargs
352319
except ValueError:

0 commit comments

Comments
 (0)