From 94057b6cdf79ed393e4bf9f30ffd4f3223978fa8 Mon Sep 17 00:00:00 2001 From: Maciej Lech Date: Sat, 8 Aug 2020 23:32:40 +0200 Subject: [PATCH 01/12] Add GitHub Action workflow for CD --- .github/workflows/cd.yml | 52 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 36d58e9e3..82f1e735a 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -2,19 +2,61 @@ name: Continuous Delivery on: push: - tags: 'demo' + tags: 'v*' # push events to matching v*, i.e. v1.0, v20.15.10 + +env: + PYTHON_DEFAULT_VERSION: 3.8 jobs: - demo: + build: + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Set up Python 3.8 + - name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: ${{ env.PYTHON_DEFAULT_VERSION }} - name: Display Python version run: python -c "import sys; print(sys.version)" - name: Install dependencies run: python -m pip install --upgrade nox pip - + - name: Build the distribution + run: nox -vs build + - name: Set the distribution output + id: output-dist + run: echo "::set-output name=dist::$(ls ./dist)" + - name: Create GitHub release + id: create-release + uses: actions/create-release@v1 + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + draft: false + prerelease: false + - name: Upload the distribution to GitHub + id: upload-dist + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create-release.outputs.upload_url }} + asset_path: ./dist/${{ steps.output-dist.outputs.dist }} + asset_name: ${{ steps.output-dist.outputs.dist }} + asset_content_type: application/gzip + doc: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} + uses: actions/setup-python@v2 + with: + python-version: ${{ env.PYTHON_DEFAULT_VERSION }} + - name: Display Python version + run: python -c "import sys; print(sys.version)" + - name: Install dependencies + run: | + sudo apt-get install -y graphviz plantuml + python -m pip install --upgrade nox pip + - name: Build the docs + run: nox --non-interactive -vs doc From e9d68babae2973d02ea9f762223a29a9770fef12 Mon Sep 17 00:00:00 2001 From: Maciej Lech Date: Sun, 9 Aug 2020 00:03:23 +0200 Subject: [PATCH 02/12] Add upload to PyPi step --- .github/workflows/cd.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 82f1e735a..1987c0167 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -8,9 +8,10 @@ env: PYTHON_DEFAULT_VERSION: 3.8 jobs: - build: + deploy: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + B2_PYPI_PASSWORD: ${{ secrets.B2_PYPI_PASSWORD }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -36,15 +37,21 @@ jobs: draft: false prerelease: false - name: Upload the distribution to GitHub - id: upload-dist uses: actions/upload-release-asset@v1 with: upload_url: ${{ steps.create-release.outputs.upload_url }} asset_path: ./dist/${{ steps.output-dist.outputs.dist }} asset_name: ${{ steps.output-dist.outputs.dist }} asset_content_type: application/gzip - doc: - needs: build + - name: Upload the distribution to PyPI + if: ${{ env.B2_PYPI_PASSWORD != '' }} + uses: pypa/gh-action-pypi-publish@v1.3.1 + with: + user: __token__ + password: ${{ env.B2_PYPI_PASSWORD }} + repository_url: https://test.pypi.org/legacy/ + doc_deploy: + needs: deploy runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From 5d60bb7773ae643a957fc033b957d2debb47dffa Mon Sep 17 00:00:00 2001 From: Maciej Lech Date: Sun, 9 Aug 2020 12:03:44 +0200 Subject: [PATCH 03/12] Update changelog, change release strategy --- .github/workflows/cd.yml | 22 +++++++---- CHANGELOG.md | 85 ++++++++++++++++++++++++++++++++++++++++ MANIFEST.in | 2 + README.md | 76 +---------------------------------- README.release.md | 19 +++++---- noxfile.py | 7 ---- setup.py | 6 ++- 7 files changed, 118 insertions(+), 99 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 1987c0167..1505e8abd 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -24,24 +24,31 @@ jobs: - name: Install dependencies run: python -m pip install --upgrade nox pip - name: Build the distribution - run: nox -vs build - - name: Set the distribution output - id: output-dist - run: echo "::set-output name=dist::$(ls ./dist)" + id: build + run: | + nox -vs build + echo "::set-output name=dist::$(ls ./dist)" + echo "::set-output name=ver::${GITHUB_REF#refs/tags/v}" + - name: Read the Changelog + id: read-changelog + uses: mindsers/changelog-reader-action@v1 + with: + version: ${{ steps.build.outputs.ver }} - name: Create GitHub release id: create-release uses: actions/create-release@v1 with: tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} + release_name: ${{ steps.build.outputs.ver }} + body: ${{ steps.read-changelog.outputs.log_entry }} draft: false prerelease: false - name: Upload the distribution to GitHub uses: actions/upload-release-asset@v1 with: upload_url: ${{ steps.create-release.outputs.upload_url }} - asset_path: ./dist/${{ steps.output-dist.outputs.dist }} - asset_name: ${{ steps.output-dist.outputs.dist }} + asset_path: ./dist/${{ steps.build.outputs.dist }} + asset_name: ${{ steps.build.outputs.dist }} asset_content_type: application/gzip - name: Upload the distribution to PyPI if: ${{ env.B2_PYPI_PASSWORD != '' }} @@ -50,6 +57,7 @@ jobs: user: __token__ password: ${{ env.B2_PYPI_PASSWORD }} repository_url: https://test.pypi.org/legacy/ + skip_existing: true doc_deploy: needs: deploy runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..f1cdc944f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,85 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] +### Removed +* Drop Python 2 and Python 3.4 support :tada:* Remove `--prefix` from `ls` (it didn't really work, use `folderName` argument) + +## [1.1.4] - 2020-07-15 +### Added +* Allow specifying custom realm in B2Session.authorize_account + +## [1.1.2] - 2020-07-06 +### Fixed +* Fix upload part for file range on Python 2.7 + +## [1.1.0] - 2020-06-24 +### Added +* 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 + +### Changed +* Make sync treat hidden files as deleted +* Ignore urllib3 "connection pool is full" warning + +### Removed +* Remove arrow warnings caused by https://github.com/crsmithdev/arrow/issues/612 + +### Fixed +* Fix handling of modification time of files + +## [1.0.2] - 2019-10-15 +### Changed +* Remove upper version limit for arrow dependency + +## [1.0.0] - 2019-10-03 +### Fixed +* Minor bug fix. + +## [1.0.0-rc1] - 2019-07-09 +### Deprecated +* Deprecate some transitional method names to v0 in preparation for v1.0.0. + +## [0.1.10] - 2019-07-09 +### Removed +* Remove a parameter (which did nothing, really) from `b2sdk.v1.Bucket.copy_file` signature + +## [0.1.8] - 2019-06-28 +### Added +* Add support for b2_copy_file +* Add support for `prefix` parameter on ls-like calls + +## [0.1.6] - 2019-04-24 +### Changed +* Rename account ID for authentication to application key ID. +Account ID is still backwards compatible, only the terminology +has changed. + +### Fixed +* Fix transferer crashing on empty file download attempt + + +## [0.1.4] - 2019-04-04 +### Added +Initial official release of SDK as a separate package (until now it was a part of B2 CLI) + +[Unreleased]: https://github.com/Backblaze/b2-sdk-python/compare/v1.1.4...HEAD +[1.1.4]: https://github.com/Backblaze/b2-sdk-python/compare/v1.1.2...v1.1.4 +[1.1.2]: https://github.com/Backblaze/b2-sdk-python/compare/v1.1.0...v1.1.2 +[1.1.0]: https://github.com/Backblaze/b2-sdk-python/compare/v1.0.2...v1.1.0 +[1.0.2]: https://github.com/Backblaze/b2-sdk-python/compare/v1.0.0...v1.0.2 +[1.0.0]: https://github.com/Backblaze/b2-sdk-python/compare/v1.0.0-rc1...v1.0.0 +[1.0.0-rc1]: https://github.com/Backblaze/b2-sdk-python/compare/v0.1.10...v1.0.0-rc1 +[0.1.10]: https://github.com/Backblaze/b2-sdk-python/compare/v0.1.8...v0.1.10 +[0.1.8]: https://github.com/Backblaze/b2-sdk-python/compare/v0.1.6...v0.1.8 +[0.1.6]: https://github.com/Backblaze/b2-sdk-python/compare/v0.1.4...v0.1.6 +[0.1.4]: https://github.com/Backblaze/b2-sdk-python/compare/4fd290c...v0.1.4 diff --git a/MANIFEST.in b/MANIFEST.in index c9134ed81..6f90ad731 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,5 @@ +include CHANGELOG.md +include CONTRIBUTING.md include README.md include requirements.txt include LICENSE diff --git a/README.md b/README.md index e0f7bfcf7..0def9ecfa 100644 --- a/README.md +++ b/README.md @@ -30,83 +30,9 @@ Therefore when setting up b2sdk as a dependency, please make sure to match the v b2sdk>=0.0.0,<1.0.0 ``` - # Release History -## Not released yet - -* Drop Python 2 and Python 3.4 support :tada: - -## 1.1.4 (2020-07-15) - -* Allow specifying custom realm in B2Session.authorize_account - -## 1.1.2 (2020-07-06) - -* Fix upload part for file range on Python 2.7 - -## 1.1.0 (2020-06-24) - -* Make sync treat hidden files as deleted -* Remove arrow warnings caused by https://github.com/crsmithdev/arrow/issues/612 -* 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 -* Ignore urllib3 "connection pool is full" warning -* 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 -* Fix handling of modification time of files - -## 1.0.2 (2019-10-15) - -Changes: - -* Remove upper version limit for arrow dependency - -## 1.0.0 (2019-10-03) - -Changes: - -* Minor bug fix. - -## 1.0.0-rc1 (2019-07-09) - -Changes: - -* Deprecate some transitional method names to v0 in preparation for v1.0.0. - -## 0.1.10 (2019-07-09) - -Changes: - -* Remove a parameter (which did nothing, really) from `b2sdk.v1.Bucket.copy_file` signature - - -## 0.1.8 (2019-06-28) - -Changes: - -* Add support for b2_copy_file -* Add support for `prefix` parameter on ls-like calls - - -## 0.1.6 (2019-04-24) - -Changes: - -* Fix transferer crashing on empty file download attempt -* Rename account ID for authentication to application key ID. -Account ID is still backwards compatible, only the terminology -has changed. - - -## 0.1.4 (2019-04-04) - -Initial official release of SDK as a separate package (until now it was a part of B2 CLI) - +Please refer to the [changelog](CHANGELOG.md). # Developer Info diff --git a/README.release.md b/README.release.md index c2080c148..eeab8f9b4 100644 --- a/README.release.md +++ b/README.release.md @@ -3,23 +3,26 @@ - Get the Nox: - `pip install -U nox` - Bump the version number to an even number in `b2sdk/version.py`. -- Update the release history in `README.md` by changing "not released yet" to the current date for this release. +- Update the release history in `CHANGELOG.md`: + - Change "Unreleased" to the current release version and date. + - Create empty "Unreleased" section. + - Add proper link to the new release (at the bottom of the file). + - Update "Unreleased" link (at the bottom of the file). - Run linters and tests: - `export B2_TEST_APPLICATION_KEY=your_app_key` - `export B2_TEST_APPLICATION_KEY_ID=your_app_key_id` - `nox -x` - Build docs locally: - `nox --non-interactive -xs doc` -- Commit and push to GitHub, then wait for build to complete successfully. +- Commit and push to GitHub, then wait for CI workflow to complete successfully. - No need to make a branch. Push straight to `master`. - Tag in git and push tag to origin. (Version tags look like "v0.4.6".) - `git tag vx.x.x` - `git push origin vx.x.x` -- Build the distribution and upload to PyPI. - - `nox -xs build deploy` +- Wait for CD workflow to complete successfully. + - Verify that the GitHub release is created + - Verify that the release has been uploaded to the PyPI - Install using pip and verify that it gets the correct version. -- Update for dev +- Update for dev: - Bump the version number to an odd number (for example: 1.0.2 -> 1.0.3) - - Add a "not released yet" section in the release history, like: 0.8.5 (not released yet) - - Commit the changes -- Push to GitHub again. + - Commit the changes and push to GitHub again. diff --git a/noxfile.py b/noxfile.py index d3d632039..2deb42b39 100644 --- a/noxfile.py +++ b/noxfile.py @@ -144,13 +144,6 @@ def build(session): session.run('python', 'setup.py', 'sdist', *session.posargs) -@nox.session(python=PYTHON_DEFAULT_VERSION) -def deploy(session): - """Deploy the distribution to the PyPi.""" - session.install('twine') - session.run('twine', 'upload', 'dist/*') - - @nox.session(python=PYTHON_DEFAULT_VERSION) def doc(session): """Build the documentation.""" diff --git a/setup.py b/setup.py index 5b5e5a787..8f48df41f 100644 --- a/setup.py +++ b/setup.py @@ -107,11 +107,13 @@ # dependencies). You can install these using the following syntax, # for example: # $ pip install -e .[dev,test] - extras_require={}, + extras_require={ + 'doc': ['sphinx', 'sphinx-autobuild', 'sphinx_rtd_theme', 'sphinxcontrib-plantuml', 'sadisplay'], + }, # If there are data files included in your packages that need to be # installed, specify them here. - package_data={'b2sdk': ['requirements.txt']}, + package_data={'b2sdk': ['CHANGELOG.md', 'CONTRIBUTING.md', 'README.md', 'requirements.txt', 'LICENSE']}, # Although 'package_data' is the preferred approach, in some case you may # need to place data files outside of your packages. See: From d060f9246da45abd243b79345ee43c5abe7e182e Mon Sep 17 00:00:00 2001 From: Maciej Lech Date: Sun, 9 Aug 2020 12:30:45 +0200 Subject: [PATCH 04/12] Remove doc_deploy step --- .github/workflows/cd.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 1505e8abd..1b6dd6abc 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -58,20 +58,3 @@ jobs: password: ${{ env.B2_PYPI_PASSWORD }} repository_url: https://test.pypi.org/legacy/ skip_existing: true - doc_deploy: - needs: deploy - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} - uses: actions/setup-python@v2 - with: - python-version: ${{ env.PYTHON_DEFAULT_VERSION }} - - name: Display Python version - run: python -c "import sys; print(sys.version)" - - name: Install dependencies - run: | - sudo apt-get install -y graphviz plantuml - python -m pip install --upgrade nox pip - - name: Build the docs - run: nox --non-interactive -vs doc From 59fbad3ba63fbfc070fccbd3bbc13bd4fc4d7c40 Mon Sep 17 00:00:00 2001 From: Maciej Lech Date: Sun, 9 Aug 2020 12:32:12 +0200 Subject: [PATCH 05/12] Remove TestPyPI from the config --- .github/workflows/cd.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 1b6dd6abc..f47806c36 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -56,5 +56,3 @@ jobs: with: user: __token__ password: ${{ env.B2_PYPI_PASSWORD }} - repository_url: https://test.pypi.org/legacy/ - skip_existing: true From b26dee376b07cca8a3c4924dab97630204966086 Mon Sep 17 00:00:00 2001 From: Maciej Lech Date: Sun, 9 Aug 2020 12:46:03 +0200 Subject: [PATCH 06/12] Format the code --- setup.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 8f48df41f..abde5fc14 100644 --- a/setup.py +++ b/setup.py @@ -108,12 +108,18 @@ # for example: # $ pip install -e .[dev,test] extras_require={ - 'doc': ['sphinx', 'sphinx-autobuild', 'sphinx_rtd_theme', 'sphinxcontrib-plantuml', 'sadisplay'], + 'doc': + [ + 'sphinx', 'sphinx-autobuild', 'sphinx_rtd_theme', 'sphinxcontrib-plantuml', + 'sadisplay' + ], }, # If there are data files included in your packages that need to be # installed, specify them here. - package_data={'b2sdk': ['CHANGELOG.md', 'CONTRIBUTING.md', 'README.md', 'requirements.txt', 'LICENSE']}, + package_data={ + 'b2sdk': ['CHANGELOG.md', 'CONTRIBUTING.md', 'README.md', 'requirements.txt', 'LICENSE'] + }, # Although 'package_data' is the preferred approach, in some case you may # need to place data files outside of your packages. See: From 853bfb04b83c2b26a699fbb4a0b4cbd427d6b6a2 Mon Sep 17 00:00:00 2001 From: Maciej Lech Date: Sun, 9 Aug 2020 20:25:28 +0200 Subject: [PATCH 07/12] Align building with CLI --- .github/workflows/cd.yml | 13 +++++-------- CHANGELOG.md | 3 ++- noxfile.py | 12 ++++++++++++ 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index f47806c36..9b27f4215 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -25,21 +25,18 @@ jobs: run: python -m pip install --upgrade nox pip - name: Build the distribution id: build - run: | - nox -vs build - echo "::set-output name=dist::$(ls ./dist)" - echo "::set-output name=ver::${GITHUB_REF#refs/tags/v}" + run: nox -vs build - name: Read the Changelog id: read-changelog uses: mindsers/changelog-reader-action@v1 with: - version: ${{ steps.build.outputs.ver }} + version: ${{ steps.build.outputs.version }} - name: Create GitHub release id: create-release uses: actions/create-release@v1 with: tag_name: ${{ github.ref }} - release_name: ${{ steps.build.outputs.ver }} + release_name: ${{ steps.build.outputs.version }} body: ${{ steps.read-changelog.outputs.log_entry }} draft: false prerelease: false @@ -47,8 +44,8 @@ jobs: uses: actions/upload-release-asset@v1 with: upload_url: ${{ steps.create-release.outputs.upload_url }} - asset_path: ./dist/${{ steps.build.outputs.dist }} - asset_name: ${{ steps.build.outputs.dist }} + asset_path: ${{ steps.build.outputs.asset_path }} + asset_name: ${{ steps.build.outputs.asset_name }} asset_content_type: application/gzip - name: Upload the distribution to PyPI if: ${{ env.B2_PYPI_PASSWORD != '' }} diff --git a/CHANGELOG.md b/CHANGELOG.md index f1cdc944f..c0e875390 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Removed -* Drop Python 2 and Python 3.4 support :tada:* Remove `--prefix` from `ls` (it didn't really work, use `folderName` argument) +* Drop Python 2 and Python 3.4 support :tada: +* Remove `--prefix` from `ls` (it didn't really work, use `folderName` argument) ## [1.1.4] - 2020-07-15 ### Added diff --git a/noxfile.py b/noxfile.py index 2deb42b39..ad7fd7e5e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -10,6 +10,7 @@ import os import subprocess +from glob import glob import nox @@ -143,6 +144,17 @@ def build(session): session.run('rm', '-rf', 'build', 'dist', 'b2sdk.egg-info', external=True) session.run('python', 'setup.py', 'sdist', *session.posargs) + # Set outputs for GitHub Actions + if CI: + asset_path = glob('dist/*')[0] + print('::set-output name=asset_path::', asset_path, sep='') + + asset_name = os.path.basename(asset_path) + print('::set-output name=asset_name::', asset_name, sep='') + + version = os.environ['GITHUB_REF'].replace('refs/tags/v', '') + print('::set-output name=version::', version, sep='') + @nox.session(python=PYTHON_DEFAULT_VERSION) def doc(session): From b688f5f9278cf290a0bb379e0a279972834e472d Mon Sep 17 00:00:00 2001 From: Evan Allrich Date: Fri, 11 Sep 2020 18:49:58 -0500 Subject: [PATCH 08/12] Update sync reference --- doc/source/quick_start.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/quick_start.rst b/doc/source/quick_start.rst index 5b018c333..28d099e83 100644 --- a/doc/source/quick_start.rst +++ b/doc/source/quick_start.rst @@ -133,7 +133,7 @@ File actions .. tip:: Sync is the preferred way of getting files into and out of B2 cloud, because it can achieve *highest performance* due to parallelization of scanning and data transfer operations. - To learn more about sync, see `Sync `_. + To learn more about sync, see :ref:`sync`. Use the functions described below only if you *really* need to transfer a single file. From d8c2339d7ff61f33f47e157314315f2a563dfcb1 Mon Sep 17 00:00:00 2001 From: Evan Allrich Date: Fri, 11 Sep 2020 19:07:35 -0500 Subject: [PATCH 09/12] Include how to create the B2Api instance --- doc/source/tutorial.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/source/tutorial.rst b/doc/source/tutorial.rst index e582169cb..3e13a5ca2 100644 --- a/doc/source/tutorial.rst +++ b/doc/source/tutorial.rst @@ -29,6 +29,8 @@ Account authorization .. code-block:: python + >>> from b2sdk.v1 import B2Api + >>> b2_api = B2Api(info) >>> application_key_id = '4a5b6c7d8e9f' >>> application_key = '001b8e23c26ff6efb941e237deb182b9599a84bef7' >>> b2_api.authorize_account("production", application_key_id, application_key) From df35a7a5bb012bc211b601f32d28660d9595a5ed Mon Sep 17 00:00:00 2001 From: Evan Allrich Date: Fri, 11 Sep 2020 19:12:10 -0500 Subject: [PATCH 10/12] Remove broken doc reference --- doc/source/quick_start.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/source/quick_start.rst b/doc/source/quick_start.rst index 28d099e83..a0d0098ab 100644 --- a/doc/source/quick_start.rst +++ b/doc/source/quick_start.rst @@ -282,8 +282,6 @@ Get file metadata Copy file ========= -Please switch to :meth:`b2sdk.v2.Bucket.copy`. - .. code-block:: python >>> file_id = '4_z5485a1682662eb3e60980d10_f118df9ba2c5131e8_d20190619_m065809_c002_v0001126_t0040' From 4113b701f41cd475ab7290a43fe92e2da2087fe7 Mon Sep 17 00:00:00 2001 From: Evan Allrich Date: Sat, 12 Sep 2020 07:14:51 -0500 Subject: [PATCH 11/12] Switching API reference to v1 --- doc/source/quick_start.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/source/quick_start.rst b/doc/source/quick_start.rst index a0d0098ab..c7c9650bc 100644 --- a/doc/source/quick_start.rst +++ b/doc/source/quick_start.rst @@ -282,6 +282,8 @@ Get file metadata Copy file ========= +Please switch to :meth:`b2sdk.v1.Bucket.copy`. + .. code-block:: python >>> file_id = '4_z5485a1682662eb3e60980d10_f118df9ba2c5131e8_d20190619_m065809_c002_v0001126_t0040' From 977ab2089d8f813dc6dfd6c0cd79473dfe3c8899 Mon Sep 17 00:00:00 2001 From: Maciej Lech Date: Mon, 28 Sep 2020 19:14:44 +0200 Subject: [PATCH 12/12] Update after PR comments --- MANIFEST.in | 3 --- README.release.md | 9 +++++---- setup.py | 4 +--- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 6f90ad731..a7da3fcb4 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,2 @@ -include CHANGELOG.md -include CONTRIBUTING.md -include README.md include requirements.txt include LICENSE diff --git a/README.release.md b/README.release.md index eeab8f9b4..6f4e3ac5a 100644 --- a/README.release.md +++ b/README.release.md @@ -6,7 +6,7 @@ - Update the release history in `CHANGELOG.md`: - Change "Unreleased" to the current release version and date. - Create empty "Unreleased" section. - - Add proper link to the new release (at the bottom of the file). + - 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. - Update "Unreleased" link (at the bottom of the file). - Run linters and tests: - `export B2_TEST_APPLICATION_KEY=your_app_key` @@ -17,12 +17,13 @@ - Commit and push to GitHub, then wait for CI workflow to complete successfully. - No need to make a branch. Push straight to `master`. - Tag in git and push tag to origin. (Version tags look like "v0.4.6".) - - `git tag vx.x.x` - - `git push origin vx.x.x` + - `git tag vx.x.x` + - `git push origin vx.x.x` - Wait for CD workflow to complete successfully. - Verify that the GitHub release is created - Verify that the release has been uploaded to the PyPI -- Install using pip and verify that it gets the correct version. +- Install using pip and verify that it gets the correct version: + - `pip install -U b2sdk` - Update for dev: - Bump the version number to an odd number (for example: 1.0.2 -> 1.0.3) - Commit the changes and push to GitHub again. diff --git a/setup.py b/setup.py index abde5fc14..609e5b90b 100644 --- a/setup.py +++ b/setup.py @@ -117,9 +117,7 @@ # If there are data files included in your packages that need to be # installed, specify them here. - package_data={ - 'b2sdk': ['CHANGELOG.md', 'CONTRIBUTING.md', 'README.md', 'requirements.txt', 'LICENSE'] - }, + package_data={'b2sdk': ['requirements.txt', 'LICENSE']}, # Although 'package_data' is the preferred approach, in some case you may # need to place data files outside of your packages. See: