Skip to content

Commit bdb415e

Browse files
author
fireblocks_dx_team
committed
Generated SDK #6554
1 parent fc6fa95 commit bdb415e

File tree

12 files changed

+94
-11
lines changed

12 files changed

+94
-11
lines changed

.bump_version.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[tool.bumpversion]
2+
commit = false
3+
tag = false
4+
current_version = "placeholder_version"
5+
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(\\-(?P<release>[a-z]+))?"
6+
serialize = [
7+
"{major}.{minor}.{patch}-{release}",
8+
"{major}.{minor}.{patch}"
9+
]
10+
[[tool.bumpversion.files]]
11+
filename = "setup.py"
12+
13+
[[tool.bumpversion.files]]
14+
filename = "pyproject.toml"
15+
16+
[[tool.bumpversion.files]]
17+
filename = "fireblocks/__init__.py"
18+
19+
[[tool.bumpversion.files]]
20+
filename = "fireblocks/configuration.py"

.github/workflows/create-pr.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,40 @@ on:
66
- 'fireblocks-api-spec/generated/*'
77

88
jobs:
9+
bump-version:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Check out repository code
14+
uses: actions/checkout@v4
15+
- name: Set up Python
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: '3.x'
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install build
23+
pip install bump-my-version
24+
- name: Bump version
25+
run: |
26+
initialTag=v0.0.6
27+
tag="${initialTag//[v]/}"
28+
echo $tag
29+
git remote update
30+
git fetch
31+
echo "finished fetching"
32+
echo "finished checkout"
33+
git config --global user.email "[email protected]"
34+
git config --global user.name "Github Actions"
35+
echo "finished configuration"
36+
bump-my-version bump --config-file .bump_version.toml --current-version 0.0.0 --new-version $tag
37+
echo "bumpversion finished"
38+
git add .
39+
git commit -m "release $tag"
40+
git push
941
create-pull-request:
42+
needs: bump-version
1043
runs-on: ubuntu-latest
1144

1245
steps:

.github/workflows/python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
strategy:
88
matrix:
99
python-version: [3.8, 3.9, "3.10", 3.11, 3.12]
10-
os: [macos-11, macos-12, windows-latest, ubuntu-20.04, ubuntu-22.04]
10+
os: [macos-12, windows-latest, ubuntu-20.04, ubuntu-22.04]
1111
runs-on: ${{ matrix.os }}
1212
steps:
1313
- uses: actions/checkout@v3

.github/workflows/python-publish.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,33 @@ jobs:
2929
run: |
3030
python -m pip install --upgrade pip
3131
pip install build
32+
pip install bump-my-version
33+
- name: Bump version
34+
run: |
35+
initialTag=${{ github.event.release.tag_name }}
36+
tag="${initialTag//[v]/}"
37+
echo $tag
38+
git remote update
39+
git fetch
40+
echo "finished fetching"
41+
git checkout --track origin/master
42+
echo "finished checkout"
43+
git config --global user.email "[email protected]"
44+
git config --global user.name "Github Actions"
45+
echo "finished configuration"
46+
bump-my-version bump --config-file .bump_version.toml --current-version 0.0.0 --new-version $tag
47+
echo "bumpversion finished"
48+
git add .
49+
git commit -m "release $tag"
50+
git push
51+
- name: Move tag
52+
run: |
53+
TAG_NAME=${{ github.event.release.tag_name }}
54+
echo $tag
55+
git tag -d $TAG_NAME
56+
git push origin :refs/tags/$TAG_NAME
57+
git tag $TAG_NAME
58+
git push origin $TAG_NAME
3259
- name: Build package
3360
run: python -m build
3461
- name: Publish package

.openapi-generator/FILES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.bump_version.toml
12
.gitignore
23
LICENSE.txt
34
README.md

fireblocks/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
""" # noqa: E501
1616

1717

18-
__version__ = "1.0.3"
18+
__version__ = "0.0.0"
1919

2020
# import apis into sdk package
2121
from fireblocks.api.api_user_api import ApiUserApi

fireblocks/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def __init__(
8888
self.default_headers[header_name] = header_value
8989
self.cookie = cookie
9090
# Set default User-Agent.
91-
self.user_agent = "OpenAPI-Generator/1.0.3/python"
91+
self.user_agent = "fireblocks/sdk/python"
9292
self.client_side_validation = configuration.client_side_validation
9393

9494
def __enter__(self):

fireblocks/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ def to_debug_report(self):
424424
"OS: {env}\n"
425425
"Python Version: {pyversion}\n"
426426
"Version of the API: 1.6.2\n"
427-
"SDK Package Version: 1.0.3".format(env=sys.platform, pyversion=sys.version)
427+
"SDK Package Version: 0.0.0".format(env=sys.platform, pyversion=sys.version)
428428
)
429429

430430
def get_host_settings(self):

fireblocks/user_agent_util.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111
""" # noqa: E501
1212

1313
import platform
14+
from fireblocks import __version__
1415

1516

1617
class UserAgentUtil:
1718
@staticmethod
1819
def get_user_agent(is_anonymous_platform: bool, custom_user_agent: str) -> str:
19-
user_agent = "fireblocks/sdk/python/1.0.3"
20+
user_agent = f"fireblocks/sdk/python/{__version__}"
2021
if not is_anonymous_platform:
2122
os_type = platform.system()
2223
os_version = platform.release()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "fireblocks"
3-
version = "1.0.3"
3+
version = "0.0.0"
44
description = "Fireblocks API"
55
authors = ["Fireblocks <[email protected]>"]
66
license = "MIT License"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# prerequisite: setuptools
2323
# http://pypi.python.org/pypi/setuptools
2424
NAME = "fireblocks"
25-
VERSION = "1.0.3"
25+
VERSION = "0.0.0"
2626
PYTHON_REQUIRES = ">=3.8"
2727
REQUIRES = [
2828
"urllib3 >= 1.25.3, < 2.1.0",

test/fireblocks/test_user_agent_util.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import pytest
1515
from fireblocks.user_agent_util import UserAgentUtil
16+
from fireblocks import __version__
1617

1718
@pytest.fixture
1819
def mock_platform(mocker):
@@ -21,10 +22,10 @@ def mock_platform(mocker):
2122
mocker.patch('platform.machine', return_value="x86_64")
2223

2324
@pytest.mark.parametrize("is_anonymous_platform, user_agent, expected", [
24-
(False, "customUserAgent", "customUserAgent fireblocks/sdk/python/1.0.3 (Linux 5.4.0-42-generic; x86_64)"),
25-
(True, "customUserAgent", "customUserAgent fireblocks/sdk/python/1.0.3"),
26-
(False, None, "fireblocks/sdk/python/1.0.3 (Linux 5.4.0-42-generic; x86_64)"),
27-
(True, None, "fireblocks/sdk/python/1.0.3")])
25+
(False, "customUserAgent", f"customUserAgent fireblocks/sdk/python/{__version__} (Linux 5.4.0-42-generic; x86_64)"),
26+
(True, "customUserAgent", f"customUserAgent fireblocks/sdk/python/{__version__}"),
27+
(False, None, f"fireblocks/sdk/python/{__version__} (Linux 5.4.0-42-generic; x86_64)"),
28+
(True, None, f"fireblocks/sdk/python/{__version__}")])
2829
def test_get_user_agent(mock_platform, is_anonymous_platform, user_agent, expected):
2930
# Create an instance of UserAgentUtil
3031
util = UserAgentUtil()

0 commit comments

Comments
 (0)