Skip to content

Commit f648f35

Browse files
authored
Merge pull request #253 from reportportal/develop
Release
2 parents a659a03 + 1d4323b commit f648f35

File tree

13 files changed

+437
-79
lines changed

13 files changed

+437
-79
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[flake8]
2-
ignore = E203, W503, E701
2+
ignore = E203, W503, E701, E704
33
exclude = .git,venv,env
44
max-line-length = 119

.github/workflows/release.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -50,30 +50,30 @@ jobs:
5050
with:
5151
python-version: '3.10'
5252

53-
# - name: Install dependencies
54-
# run: python -m pip install --upgrade pip setuptools wheel
53+
- name: Install dependencies
54+
run: python -m pip install --upgrade pip setuptools wheel
5555

56-
# - name: Build package
57-
# run: python setup.py sdist bdist_wheel
58-
#
59-
# - name: Publish package
60-
# uses: pypa/gh-action-pypi-publish@release/v1
61-
# with:
62-
# user: ${{ secrets.PYPI_USERNAME }}
63-
# password: ${{ secrets.PYPI_PASSWORD }}
56+
- name: Build package
57+
run: python setup.py sdist bdist_wheel
58+
59+
- name: Publish package
60+
uses: pypa/gh-action-pypi-publish@release/v1
61+
with:
62+
user: ${{ secrets.PYPI_USERNAME }}
63+
password: ${{ secrets.PYPI_PASSWORD }}
6464

6565
- name: Setup git credentials
6666
uses: oleksiyrudenko/gha-git-credentials@v2-latest
6767
with:
6868
name: 'reportportal.io'
6969
7070
token: ${{ secrets.GITHUB_TOKEN }}
71-
#
72-
# - name: Tagging new version
73-
# id: newVersionTag
74-
# run: |
75-
# git tag -a ${{ env.RELEASE_VERSION }} -m "Release ${{ env.RELEASE_VERSION }}"
76-
# git push --tags
71+
72+
- name: Tagging new version
73+
id: newVersionTag
74+
run: |
75+
git tag -a ${{ env.RELEASE_VERSION }} -m "Release ${{ env.RELEASE_VERSION }}"
76+
git push --tags
7777
7878
- name: Checkout develop branch
7979
uses: actions/checkout@v4
@@ -108,13 +108,13 @@ jobs:
108108
version: ${{ env.RELEASE_VERSION }}
109109
path: ./${{ env.CHANGE_LOG_FILE }}
110110

111-
# - name: Create Release
112-
# id: createRelease
113-
# uses: ncipollo/release-action@v1
114-
# with:
115-
# tag: ${{ env.RELEASE_VERSION }}
116-
# name: Release ${{ env.RELEASE_VERSION }}
117-
# body: ${{ steps.readChangelogEntry.outputs.changes }}
111+
- name: Create Release
112+
id: createRelease
113+
uses: ncipollo/release-action@v1
114+
with:
115+
tag: ${{ env.RELEASE_VERSION }}
116+
name: Release ${{ env.RELEASE_VERSION }}
117+
body: ${{ steps.readChangelogEntry.outputs.changes }}
118118

119119
- name: Update version file
120120
id: versionFileUpdate

.pre-commit-config.yaml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
# See https://pre-commit.com for more information
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
4-
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
55
rev: v5.0.0
66
hooks:
7-
- id: trailing-whitespace
8-
- id: end-of-file-fixer
9-
- id: check-yaml
10-
- id: check-added-large-files
11-
- repo: https://github.com/PyCQA/pydocstyle
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
- repo: https://github.com/PyCQA/pydocstyle
1212
rev: 6.3.0
1313
hooks:
14-
- id: pydocstyle
14+
- id: pydocstyle
1515
exclude: |
16-
(?x)^(
17-
tests/.*
18-
)
19-
- repo: https://github.com/psf/black
16+
(?x)^(
17+
tests/.*
18+
)
19+
- repo: https://github.com/psf/black
2020
rev: 24.10.0
2121
hooks:
22-
- id: black
23-
args: ['reportportal_client', 'tests']
24-
- repo: https://github.com/pycqa/isort
22+
- id: black
23+
args: [ '--check', 'reportportal_client', 'tests' ]
24+
- repo: https://github.com/pycqa/isort
2525
rev: 5.13.2
2626
hooks:
2727
- id: isort
28-
- repo: https://github.com/pycqa/flake8
28+
- repo: https://github.com/pycqa/flake8
2929
rev: 7.1.1
3030
hooks:
31-
- id: flake8
31+
- id: flake8

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
## [Unreleased]
44
### Added
5+
- `markdown_helpers` module in `reportportal_client.helpers` package, by @HardNorth
6+
### Changed
7+
- `helpers.is_binary` function to improve binary content detection, by @HardNorth
8+
- `helpers` module moved to `reportportal_client.helpers` package, by @HardNorth
9+
10+
## [5.6.0]
11+
### Added
512
- `match_pattern` and `translate_glob_to_regex`, `normalize_caseless`, `caseless_equal` functions in `helpers` module, by @HardNorth
613
- `client.RP.start_test_item` method and all its children now accept `uuid` argument, by @HardNorth
714
### Removed

reportportal_client/aio/client.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,14 @@ async def __get_item_url(self, item_id_future: Union[Optional[str], Task[Optiona
227227
item_id = await await_if_necessary(item_id_future)
228228
if item_id is NOT_FOUND or item_id is None:
229229
logger.warning("Attempt to make request for non-existent id.")
230-
return
230+
return None
231231
return root_uri_join(self.base_url_v2, "item", item_id)
232232

233233
async def __get_launch_url(self, launch_uuid_future: Union[Optional[str], Task[Optional[str]]]) -> Optional[str]:
234234
launch_uuid = await await_if_necessary(launch_uuid_future)
235235
if launch_uuid is NOT_FOUND or launch_uuid is None:
236236
logger.warning("Attempt to make request for non-existent launch.")
237-
return
237+
return None
238238
return root_uri_join(self.base_url_v2, "launch", launch_uuid, "finish")
239239

240240
async def start_launch(
@@ -272,7 +272,7 @@ async def start_launch(
272272

273273
response = await AsyncHttpRequest((await self.session()).post, url=url, json=request_payload).make()
274274
if not response:
275-
return
275+
return None
276276

277277
if not self._skip_analytics:
278278
stat_coro = async_send_event("start_launch", *agent_name_version(attributes))
@@ -347,7 +347,7 @@ async def start_test_item(
347347

348348
response = await AsyncHttpRequest((await self.session()).post, url=url, json=request_payload).make()
349349
if not response:
350-
return
350+
return None
351351
item_id = await response.id
352352
if item_id is NOT_FOUND or item_id is None:
353353
logger.warning("start_test_item - invalid response: %s", str(await response.json))
@@ -402,7 +402,7 @@ async def finish_test_item(
402402
).payload
403403
response = await AsyncHttpRequest((await self.session()).put, url=url, json=request_payload).make()
404404
if not response:
405-
return
405+
return None
406406
message = await response.message
407407
logger.debug("finish_test_item - ID: %s", await await_if_necessary(item_id))
408408
logger.debug("response message: %s", message)
@@ -437,7 +437,7 @@ async def finish_launch(
437437
(await self.session()).put, url=url, json=request_payload, name="Finish Launch"
438438
).make()
439439
if not response:
440-
return
440+
return None
441441
message = await response.message
442442
logger.debug("finish_launch - ID: %s", await await_if_necessary(launch_uuid))
443443
logger.debug("response message: %s", message)
@@ -465,15 +465,15 @@ async def update_test_item(
465465
url = root_uri_join(self.base_url_v1, "item", item_id, "update")
466466
response = await AsyncHttpRequest((await self.session()).put, url=url, json=data).make()
467467
if not response:
468-
return
468+
return None
469469
logger.debug("update_test_item - Item: %s", item_id)
470470
return await response.message
471471

472472
async def __get_launch_uuid_url(self, launch_uuid_future: Union[str, Task[str]]) -> Optional[str]:
473473
launch_uuid = await await_if_necessary(launch_uuid_future)
474474
if launch_uuid is NOT_FOUND or launch_uuid is None:
475475
logger.warning("Attempt to make request for non-existent Launch UUID.")
476-
return
476+
return None
477477
logger.debug("get_launch_info - ID: %s", launch_uuid)
478478
return root_uri_join(self.base_url_v1, "launch", "uuid", launch_uuid)
479479

@@ -486,7 +486,7 @@ async def get_launch_info(self, launch_uuid_future: Union[str, Task[str]]) -> Op
486486
url = self.__get_launch_uuid_url(launch_uuid_future)
487487
response = await AsyncHttpRequest((await self.session()).get, url=url).make()
488488
if not response:
489-
return
489+
return None
490490
launch_info = None
491491
if response.is_success:
492492
launch_info = await response.json
@@ -499,7 +499,7 @@ async def __get_item_uuid_url(self, item_uuid_future: Union[Optional[str], Task[
499499
item_uuid = await await_if_necessary(item_uuid_future)
500500
if item_uuid is NOT_FOUND or item_uuid is None:
501501
logger.warning("Attempt to make request for non-existent UUID.")
502-
return
502+
return None
503503
return root_uri_join(self.base_url_v1, "item", "uuid", item_uuid)
504504

505505
async def get_item_id_by_uuid(self, item_uuid_future: Union[str, Task[str]]) -> Optional[str]:
@@ -531,7 +531,7 @@ async def get_launch_ui_url(self, launch_uuid_future: Union[str, Task[str]]) ->
531531
launch_info = await self.get_launch_info(launch_uuid)
532532
launch_id = launch_info.get("id") if launch_info else None
533533
if not launch_id:
534-
return
534+
return None
535535
mode = launch_info.get("mode") if launch_info else None
536536
if not mode:
537537
mode = self.mode
@@ -564,7 +564,7 @@ async def log_batch(self, log_batch: Optional[List[AsyncRPRequestLog]]) -> Optio
564564
(await self.session()).post, url=url, data=AsyncRPLogBatch(log_batch).payload
565565
).make()
566566
if not response:
567-
return
567+
return None
568568
return await response.messages
569569

570570
def clone(self) -> "Client":
@@ -931,7 +931,7 @@ async def get_launch_ui_id(self) -> Optional[int]:
931931
:return: Launch ID of the Launch. None if not found.
932932
"""
933933
if not self.launch_uuid:
934-
return
934+
return None
935935
return await self.__client.get_launch_ui_id(self.launch_uuid)
936936

937937
async def get_launch_ui_url(self) -> Optional[str]:
@@ -940,7 +940,7 @@ async def get_launch_ui_url(self) -> Optional[str]:
940940
:return: Launch URL string.
941941
"""
942942
if not self.launch_uuid:
943-
return
943+
return None
944944
return await self.__client.get_launch_ui_url(self.launch_uuid)
945945

946946
async def get_project_settings(self) -> Optional[dict]:
@@ -972,7 +972,7 @@ async def log(
972972
"""
973973
if item_id is NOT_FOUND:
974974
logger.warning("Attempt to log to non-existent item")
975-
return
975+
return None
976976
rp_file = RPFile(**attachment) if attachment else None
977977
rp_log = AsyncRPRequestLog(self.launch_uuid, time, rp_file, item_id, level, message)
978978
return await self.__client.log_batch(await self._log_batcher.append_async(rp_log))
@@ -1555,7 +1555,7 @@ def create_task(self, coro: Coroutine[Any, Any, _T]) -> Optional[Task[_T]]:
15551555
:return: Task instance.
15561556
"""
15571557
if not getattr(self, "_loop", None):
1558-
return
1558+
return None
15591559
result = self._loop.create_task(coro)
15601560
with self._task_mutex:
15611561
self._task_list.append(result)
@@ -1742,7 +1742,7 @@ def create_task(self, coro: Coroutine[Any, Any, _T]) -> Optional[Task[_T]]:
17421742
:return: Task instance.
17431743
"""
17441744
if not getattr(self, "_loop", None):
1745-
return
1745+
return None
17461746
result = self._loop.create_task(coro)
17471747
with self._task_mutex:
17481748
tasks = self._task_list.append(result)

reportportal_client/client.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ def start_launch(
587587
http_timeout=self.http_timeout,
588588
).make()
589589
if not response:
590-
return
590+
return None
591591

592592
if not self._skip_analytics:
593593
send_event("start_launch", *agent_name_version(attributes))
@@ -638,7 +638,7 @@ def start_test_item(
638638
"""
639639
if parent_item_id is NOT_FOUND:
640640
logger.warning("Attempt to start item for non-existent parent item.")
641-
return
641+
return None
642642
if parent_item_id:
643643
url = uri_join(self.base_url_v2, "item", parent_item_id)
644644
else:
@@ -667,7 +667,7 @@ def start_test_item(
667667
http_timeout=self.http_timeout,
668668
).make()
669669
if not response:
670-
return
670+
return None
671671
item_id = response.id
672672
if item_id is not NOT_FOUND:
673673
logger.debug("start_test_item - ID: %s", item_id)
@@ -707,7 +707,7 @@ def finish_test_item(
707707
"""
708708
if item_id is NOT_FOUND or not item_id:
709709
logger.warning("Attempt to finish non-existent item")
710-
return
710+
return None
711711
url = uri_join(self.base_url_v2, "item", item_id)
712712
request_payload = ItemFinishRequest(
713713
end_time,
@@ -725,7 +725,7 @@ def finish_test_item(
725725
self.session.put, url=url, json=request_payload, verify_ssl=self.verify_ssl, http_timeout=self.http_timeout
726726
).make()
727727
if not response:
728-
return
728+
return None
729729
self._remove_current_item()
730730
logger.debug("finish_test_item - ID: %s", item_id)
731731
logger.debug("response message: %s", response.message)
@@ -748,7 +748,7 @@ def finish_launch(
748748
if self.use_own_launch:
749749
if self.launch_uuid is NOT_FOUND or not self.launch_uuid:
750750
logger.warning("Attempt to finish non-existent launch")
751-
return
751+
return None
752752
url = uri_join(self.base_url_v2, "launch", self.launch_uuid, "finish")
753753
request_payload = LaunchFinishRequest(
754754
end_time,
@@ -765,7 +765,7 @@ def finish_launch(
765765
http_timeout=self.http_timeout,
766766
).make()
767767
if not response:
768-
return
768+
return None
769769
logger.debug("finish_launch - ID: %s", self.launch_uuid)
770770
logger.debug("response message: %s", response.message)
771771
message = response.message
@@ -794,7 +794,7 @@ def update_test_item(
794794
self.session.put, url=url, json=data, verify_ssl=self.verify_ssl, http_timeout=self.http_timeout
795795
).make()
796796
if not response:
797-
return
797+
return None
798798
logger.debug("update_test_item - Item: %s", item_id)
799799
return response.message
800800

@@ -833,7 +833,7 @@ def log(
833833
"""
834834
if item_id is NOT_FOUND:
835835
logger.warning("Attempt to log to non-existent item")
836-
return
836+
return None
837837
rp_file = RPFile(**attachment) if attachment else None
838838
rp_log = RPRequestLog(self.launch_uuid, time, rp_file, item_id, level, message)
839839
return self._log(self._log_batcher.append(rp_log))
@@ -863,7 +863,7 @@ def get_launch_info(self) -> Optional[dict]:
863863
self.session.get, url=url, verify_ssl=self.verify_ssl, http_timeout=self.http_timeout
864864
).make()
865865
if not response:
866-
return
866+
return None
867867
launch_info = None
868868
if response.is_success:
869869
launch_info = response.json
@@ -888,7 +888,7 @@ def get_launch_ui_url(self) -> Optional[str]:
888888
launch_info = self.get_launch_info()
889889
ui_id = launch_info.get("id") if launch_info else None
890890
if not ui_id:
891-
return
891+
return None
892892
mode = launch_info.get("mode") if launch_info else None
893893
if not mode:
894894
mode = self.mode
@@ -925,7 +925,7 @@ def _remove_current_item(self) -> Optional[str]:
925925
try:
926926
return self._item_stack.get()
927927
except queue.Empty:
928-
return
928+
return None
929929

930930
def current_item(self) -> Optional[str]:
931931
"""Retrieve the last item reported by the client (based on the internal FILO queue).

0 commit comments

Comments
 (0)