repominer-GDeLuisi 0.1.1__tar.gz → 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {repominer_gdeluisi-0.1.1 → repominer_gdeluisi-1.0.0}/PKG-INFO +1 -1
- {repominer_gdeluisi-0.1.1 → repominer_gdeluisi-1.0.0}/pyproject.toml +1 -1
- {repominer_gdeluisi-0.1.1 → repominer_gdeluisi-1.0.0}/src/repository_miner/git.py +2 -3
- {repominer_gdeluisi-0.1.1 → repominer_gdeluisi-1.0.0}/src/repository_miner/helper.py +1 -1
- {repominer_gdeluisi-0.1.1 → repominer_gdeluisi-1.0.0}/src/repository_miner/miner.py +1 -1
- {repominer_gdeluisi-0.1.1 → repominer_gdeluisi-1.0.0}/src/repository_miner/utility.py +0 -1
- {repominer_gdeluisi-0.1.1 → repominer_gdeluisi-1.0.0}/tests/test_git.py +9 -9
- {repominer_gdeluisi-0.1.1 → repominer_gdeluisi-1.0.0}/tests/test_miner.py +2 -2
- {repominer_gdeluisi-0.1.1 → repominer_gdeluisi-1.0.0}/.github/workflows/publish_pypi.yml +0 -0
- {repominer_gdeluisi-0.1.1 → repominer_gdeluisi-1.0.0}/.github/workflows/tag_on_merge.yaml +0 -0
- {repominer_gdeluisi-0.1.1 → repominer_gdeluisi-1.0.0}/.github/workflows/test-dev.yml +0 -0
- {repominer_gdeluisi-0.1.1 → repominer_gdeluisi-1.0.0}/.github/workflows/testpypi_publish.yml +0 -0
- {repominer_gdeluisi-0.1.1 → repominer_gdeluisi-1.0.0}/.gitignore +0 -0
- {repominer_gdeluisi-0.1.1 → repominer_gdeluisi-1.0.0}/.python-version +0 -0
- {repominer_gdeluisi-0.1.1 → repominer_gdeluisi-1.0.0}/LICENSE +0 -0
- {repominer_gdeluisi-0.1.1 → repominer_gdeluisi-1.0.0}/README.md +0 -0
- {repominer_gdeluisi-0.1.1 → repominer_gdeluisi-1.0.0}/requirements.txt +0 -0
- {repominer_gdeluisi-0.1.1 → repominer_gdeluisi-1.0.0}/src/repository_miner/__init__.py +0 -0
- {repominer_gdeluisi-0.1.1 → repominer_gdeluisi-1.0.0}/src/repository_miner/data_typing.py +0 -0
- {repominer_gdeluisi-0.1.1 → repominer_gdeluisi-1.0.0}/src/repository_miner/exceptions.py +0 -0
- {repominer_gdeluisi-0.1.1 → repominer_gdeluisi-1.0.0}/src/repository_miner/py.typed +0 -0
- {repominer_gdeluisi-0.1.1 → repominer_gdeluisi-1.0.0}/tests/test_helpers.py +0 -0
@@ -1,9 +1,8 @@
|
|
1
1
|
from .utility import execute_command
|
2
|
-
from .helper import cmd_builder,
|
2
|
+
from .helper import cmd_builder,is_dir_a_repo,is_git_available
|
3
3
|
from .exceptions import *
|
4
4
|
from functools import partial
|
5
|
-
from typing import Iterable
|
6
|
-
from datetime import datetime
|
5
|
+
from typing import Iterable
|
7
6
|
from subprocess import CalledProcessError
|
8
7
|
class Git():
|
9
8
|
def __init__(self,path:str):
|
@@ -137,7 +137,7 @@ def is_dir_a_repo(path:str)->bool:
|
|
137
137
|
"""
|
138
138
|
cmd = f"git -C {Path(path).resolve().as_posix()} rev-parse HEAD"
|
139
139
|
try:
|
140
|
-
subprocess.check_call(cmd,shell=True)
|
140
|
+
subprocess.check_call(cmd,shell=True,stdout=subprocess.DEVNULL)
|
141
141
|
return True
|
142
142
|
except subprocess.CalledProcessError:
|
143
143
|
return False
|
@@ -74,7 +74,7 @@ class RepoMiner():
|
|
74
74
|
def authors(self)->set[Author]:
|
75
75
|
pattern=re.compile(r'([A-Za-zÀ-ÖØ-öø-ÿé\s]+) <([a-z0-9A-ZÀ-ÖØ-öø-ÿé!#$%@.&*+\/=?^_{|}~-]+)> \(\d+\)')
|
76
76
|
authors=set()
|
77
|
-
res=self.git.shortlog(["-e","--all","--pretty
|
77
|
+
res=self.git.shortlog(["-e","--all","--pretty=\"format:%H\""])
|
78
78
|
res=res.split("\n\n")[:-1]
|
79
79
|
for a_block in res:
|
80
80
|
tmp=a_block.split("\n")
|
@@ -7,15 +7,15 @@ main_path=Path.cwd()
|
|
7
7
|
def git():
|
8
8
|
return Git(main_path.as_posix())
|
9
9
|
|
10
|
-
@mark.parametrize("args,expected",[
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
])
|
16
|
-
def test_any_cmd(git,args,expected):
|
17
|
-
|
18
|
-
|
10
|
+
# @mark.parametrize("args,expected",[
|
11
|
+
# param("rev_parse",execute_command(cmd_builder("rev-parse",main_path.as_posix(),"HEAD")).strip()),
|
12
|
+
# param("rev_pars",None,marks=mark.xfail),
|
13
|
+
# param("",None,marks=mark.xfail),
|
14
|
+
# param(None,None,marks=mark.xfail),
|
15
|
+
# ])
|
16
|
+
# def test_any_cmd(git,args,expected):
|
17
|
+
# assert git.__getattr__(args)(["HEAD"])==expected
|
18
|
+
# # print(res)
|
19
19
|
|
20
20
|
@mark.parametrize("args,expected",[
|
21
21
|
param([r"--pretty='format:%ad'","--numstat"],execute_command(cmd_builder("log",main_path.as_posix(),r"--pretty='format:%ad'","--numstat"))),
|
@@ -36,7 +36,7 @@ def test_local_branches(git):
|
|
36
36
|
assert set(res)==set(map(lambda h:h.name,heads))
|
37
37
|
assert set(res_hashes)==set(map(lambda h:h.hash,heads))
|
38
38
|
for head in heads:
|
39
|
-
res=len(check_output(f"git -C {main_path.as_posix()} log {head.name} --pretty
|
39
|
+
res=len(check_output(f"git -C {main_path.as_posix()} log {head.name} --pretty=\"format:%h\"",text=True,shell=True).splitlines())
|
40
40
|
assert res==len(list(head.traverse_commits()))
|
41
41
|
|
42
42
|
def test_tree(git):
|
@@ -51,7 +51,7 @@ def test_tree(git):
|
|
51
51
|
tree=git.tree("askjbdkasdba")
|
52
52
|
|
53
53
|
def test_author(git):
|
54
|
-
git.authors()
|
54
|
+
print(git.authors())
|
55
55
|
|
56
56
|
def test_get_commit(git):
|
57
57
|
print(git.get_commit("HEAD"))
|
File without changes
|
File without changes
|
File without changes
|
{repominer_gdeluisi-0.1.1 → repominer_gdeluisi-1.0.0}/.github/workflows/testpypi_publish.yml
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|