Skip to content

Commit

Permalink
code.misc>new: add msg to show rate of process in convert command
Browse files Browse the repository at this point in the history
  • Loading branch information
pwnfan committed May 19, 2023
1 parent 5199240 commit 112eeda
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ We welcome you to join the development of tagmark. Please see [contributing docu
## TODO

- [x] lib.data: skip dumping some tagmark item according to user input
- [ ] Tagmark.get_github_repo_infos add condition filter
- [ ] add msg to show rate of process in `convert` command becuase it may be slow when there are a plenty of github repo urls
- [x] Tagmark.get_github_repo_infos add condition filter
- [x] add msg to show rate of process in `convert` command becuase it may be slow when there are a plenty of github repo urls
- [ ] lib.data: add github repo licence info into TagmarkItem
- [ ] validate url availability and set TagmarkItem.valid according to the result

Expand Down
23 changes: 22 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ requests = "^2.28.2"
structlog = "^23.1.0"
click = "^8.1.3"
python-dotenv = "^1.0.0"
tqdm = "^4.65.0"


[tool.poetry.group.test.dependencies]
Expand Down
7 changes: 6 additions & 1 deletion tagmark/core/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from pathlib import Path
from typing import Iterable, NewType

from tqdm import tqdm

from tagmark.core.github import (
GithubApiLimitReachedError,
GithubRepoInfo,
Expand Down Expand Up @@ -157,7 +159,10 @@ def get_github_repo_infos(
raise GithubApiLimitReachedError(
f"API limit reached, needs {self.count_github_url}, remaining {_github_api_remaining}"
)
for _tagmark_item in self.tagmark_items:
for _tagmark_item in tqdm(
iterable=self.tagmark_items,
desc="retrieving Github repository information",
):
if not _tagmark_item.is_github_url:
continue
elif (
Expand Down
2 changes: 1 addition & 1 deletion tests/core/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def test_get_github_repo_infos(
assert github_repo_info.count_tag is None # TODO
assert github_repo_info.count_release is None # TODO
assert github_repo_info.count_conributor is None # TODO

github_repo_info: GithubRepoInfo = self.tagit.tagmark_items[-1].github_repo_info
assert not github_repo_info

Expand Down

0 comments on commit 112eeda

Please sign in to comment.