ABEJA Platform SDK is the ABEJA Platform Software Development Kit (SDK) for Python, which allows Python developers to write software that makes use of services like Datalake, Dataset, Training, Deployment, etc. You can find the latest, most up to date, documentation at our doc site, including a list of services that are supported.
ABEJA Platform SDKは、Python 用のABEJA Platform Software Development Kit(SDK)で、Python 開発者はDatalake, Dataset, Training, Deployment などのサービスを利用したソフトウェアを書くことができる。 サポートされているサービスのリストなど、最新のドキュメントはdoc サイトでご覧いただけます。
$ pip install abeja-sdk>=1.0.0
If you want to use latest version including release candidate, add --pre
option.
リリース候補を含む最新版を使用したい場合は、--pre
オプションを追加してください。
$ pip install abeja-sdk>=1.0.0 --pre
If you have bigger version than latest pre-release, bigger not-pre-release version in installed.
For example, when there are versions of 1.0.1
and 1.0.0rc1
, 1.0.1
is installed even if you specify --pre
option.
Release candidate is published when release branch is pushed to Github.
もし、最新のプレリリース版よりも新しいバージョンがある場合はそのバージョンがインストールされます。
例えば、 1.0.1
と 1.0.0rc1
というバージョンがある場合、 --pre
オプションを指定しても、 1.0.1
がインストールされます。
release ブランチがGithubにプッシュされると、リリース候補版が公開されます。
requirements.txt
abeja-sdk>=1.0.0
If you want to use pre-release, add rc0
suffix.
プレリリースを使いたい場合は、最後にrc0
をつけてください。
abeja-sdk>=1.0.0rc
$ poetry install
$ poetry run pre-commit install
You can run tests in all supported Python versions using pytest
.
サポートされているすべてのバージョンのPython で pytest
を使ってテストを実行することができます。
$ make test
You can also run individual tests with your default Python version:
また、デフォルトのPython バージョンで個々のテストを実行することも可能です。
$ poetry run pytest tests/
Sphinx is used for documentation. You can generate HTML locally with the following:
Sphinx はドキュメント作成に使用します。以下のようにして、ローカルにHTML を生成することができます。
$ poetry install -E docs
$ make docs
$ brew install sphinx-doc
$ echo 'export PATH="/usr/local/opt/sphinx-doc/bin:$PATH"' >> ~/.bashrc
$ poetry install
Synchronize master and develop branch.
まず、master ブランチとdevelop ブランチをpull します。
$ git checkout master
$ git pull
$ git checkout develop
$ git pull
Create release branch and prepare for release.
続いて、リリース用ブランチを作成し、リリースの準備をします。 ※ rc2 以上を作る場合はpyproject.toml のversion を明示的に指定する必要があります。
$ git flow release start X.X.X
$ vim CHANGELOG.md
# update to new version
$ poetry version X.X.X
$ git add pyproject.toml
$ git add CHANGELOG.md
$ git commit -m "bump version"
$ git flow release publish X.X.X
After pushing to relase branch, RC package is published to packagecloud.
Check CircleCI result. If the build succeeded then execute:
リリース用ブランチにpush した後、RC パッケージはpackagecloud に公開されます。
CircleCI の結果を確認します。 ビルドに成功したら、次を実行します:
$ git flow release finish X.X.X
$ git push origin develop
$ git push origin master
$ git push origin X.X.X
以下のコマンドでwheel ファイルを作成する。dist ディレクトリにabeja_sdk-x.x.x-py3-none-any.whl
というファイルが爆誕。
make release
SDK を利用する側を想定した環境で、上記のwhl ファイルを指定してpip install する
> pip install ./abeja_sdk-2.1.4rc3-py3-none-any.whl
Processing ./abeja_sdk-2.1.4rc3-py3-none-any.whl
Collecting protobuf<4
Downloading protobuf-3.20.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.0/1.0 MB 37.2 MB/s eta 0:00:00
(省略)
Successfully installed abeja-sdk-2.1.4rc3 protobuf-3.20.1 retrying-1.3.4 tensorboardx-2.5.1 tomlkit-0.7.0 typing-extensions-3.7.4.3
以下のようにローカルファイルを指定してabeja-sdk のパッケージがインストールされるので、普通にpython コード内でimport(import abeja.datalake.Client
とか)すればローカルに閉じて検証可能になる。
> pip freeze
abeja-sdk @ file:///app/abeja_sdk-2.1.4rc3-py3-none-any.whl
aiofiles==22.1.0