Skip to content

Commit 0090e0a

Browse files
authored
fix: Format code style
* fix: Try publishing to the pypi test site * fix: Format code style * fix: Test the master branch
1 parent db0570a commit 0090e0a

File tree

11 files changed

+25
-13
lines changed

11 files changed

+25
-13
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: build
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [ master, Fix-CI-errors ]
66
pull_request:
7-
branches: [ master ]
7+
branches: [ master, Fix-CI-errors ]
88

99
jobs:
1010
test:
@@ -68,4 +68,5 @@ jobs:
6868
env:
6969
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7070
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
71+
PYPI_REPOSITORY_URL: https://test.pypi.org/legacy/
7172
run: npx semantic-release

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ include = '\.pyi?$'
4040
[tool.ruff]
4141
line-length = 88
4242

43+
[tool.ruff.lint]
4344
select = [
4445
"E", # pycodestyle errors
4546
"W", # pycodestyle warnings

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[metadata]
2-
name = casvisor
2+
name = casvisor-python-sdk-test
33
version = 1.0.0
44
author = Casvisor
55
author_email = admin@casvisor.org

src/casvisor/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
#
15-
from .main import CasvisorSDK
1615
from .base import BaseClient, Response
16+
from .main import CasvisorSDK
1717
from .record import Record, _RecordSDK
1818

1919
__all__ = ["CasvisorSDK", "BaseClient", "Response", "Record", "_RecordSDK"]

src/casvisor/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
# limitations under the License.
1414

1515
import json
16-
from typing import Dict, Union, List, Tuple
16+
from typing import Dict, List, Tuple, Union
17+
1718
import requests
19+
1820
from . import util
1921

2022

src/casvisor/record.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414

1515
import json
1616
from typing import Dict, List, Optional, Tuple
17-
from .base import BaseClient, Response
17+
1818
from . import util
19+
from .base import BaseClient, Response
1920

2021

2122
class Record:

src/casvisor/util.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
# limitations under the License.
1414

1515

16-
from requests_toolbelt.multipart.encoder import MultipartEncoder
1716
from typing import Dict, Tuple
1817

18+
from requests_toolbelt.multipart.encoder import MultipartEncoder
19+
1920

2021
def get_url(base_url: str, action: str, query_map: Dict[str, str]) -> str:
2122
query = "&".join([f"{k}={v}" for k, v in query_map.items()])

src/tests/test_base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
# limitations under the License.
1414

1515
import unittest
16+
1617
import requests_mock
18+
1719
from src.casvisor import BaseClient, Response
18-
from src.tests.test_util import TestEndpoint, TestClientId, TestClientSecret
20+
from src.tests.test_util import TestClientId, TestClientSecret, TestEndpoint
1921

2022

2123
class TestBaseClient(unittest.TestCase):

src/tests/test_main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313
# limitations under the License.
1414

1515
import unittest
16+
1617
from src.casvisor import BaseClient, CasvisorSDK
1718
from src.tests.test_util import (
18-
TestEndpoint,
19+
TestApplication,
1920
TestClientId,
2021
TestClientSecret,
22+
TestEndpoint,
2123
TestOrganization,
22-
TestApplication,
2324
)
2425

2526

src/tests/test_record.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import unittest
1615
import time
17-
from src.casvisor import Record, BaseClient, _RecordSDK
16+
import unittest
17+
18+
from src.casvisor import BaseClient, Record, _RecordSDK
1819
from src.tests.test_util import (
1920
TestClientId,
2021
TestClientSecret,

src/tests/test_util.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020
TestOrganization = "casbin"
2121
TestApplication = "app-casvisor"
2222

23+
2324
def get_random_code(length):
2425
std_nums = "0123456789"
2526
result = "".join(random.choice(std_nums) for _ in range(length))
2627
return result
2728

29+
2830
def get_random_name(prefix):
29-
return f"{prefix}_{get_random_code(6)}"
31+
return f"{prefix}_{get_random_code(6)}"

0 commit comments

Comments
 (0)