repominer-GDeLuisi 0.1.0__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.
Files changed (22) hide show
  1. {repominer_gdeluisi-0.1.0 → repominer_gdeluisi-1.0.0}/PKG-INFO +1 -1
  2. {repominer_gdeluisi-0.1.0 → repominer_gdeluisi-1.0.0}/pyproject.toml +3 -3
  3. {repominer_gdeluisi-0.1.0 → repominer_gdeluisi-1.0.0}/src/repository_miner/git.py +2 -3
  4. {repominer_gdeluisi-0.1.0 → repominer_gdeluisi-1.0.0}/src/repository_miner/helper.py +1 -1
  5. {repominer_gdeluisi-0.1.0 → repominer_gdeluisi-1.0.0}/src/repository_miner/miner.py +1 -1
  6. {repominer_gdeluisi-0.1.0 → repominer_gdeluisi-1.0.0}/src/repository_miner/utility.py +0 -1
  7. {repominer_gdeluisi-0.1.0 → repominer_gdeluisi-1.0.0}/tests/test_git.py +9 -9
  8. {repominer_gdeluisi-0.1.0 → repominer_gdeluisi-1.0.0}/tests/test_miner.py +2 -2
  9. {repominer_gdeluisi-0.1.0 → repominer_gdeluisi-1.0.0}/.github/workflows/publish_pypi.yml +0 -0
  10. {repominer_gdeluisi-0.1.0 → repominer_gdeluisi-1.0.0}/.github/workflows/tag_on_merge.yaml +0 -0
  11. {repominer_gdeluisi-0.1.0 → repominer_gdeluisi-1.0.0}/.github/workflows/test-dev.yml +0 -0
  12. {repominer_gdeluisi-0.1.0 → repominer_gdeluisi-1.0.0}/.github/workflows/testpypi_publish.yml +0 -0
  13. {repominer_gdeluisi-0.1.0 → repominer_gdeluisi-1.0.0}/.gitignore +0 -0
  14. {repominer_gdeluisi-0.1.0 → repominer_gdeluisi-1.0.0}/.python-version +0 -0
  15. {repominer_gdeluisi-0.1.0 → repominer_gdeluisi-1.0.0}/LICENSE +0 -0
  16. {repominer_gdeluisi-0.1.0 → repominer_gdeluisi-1.0.0}/README.md +0 -0
  17. {repominer_gdeluisi-0.1.0 → repominer_gdeluisi-1.0.0}/requirements.txt +0 -0
  18. {repominer_gdeluisi-0.1.0 → repominer_gdeluisi-1.0.0}/src/repository_miner/__init__.py +0 -0
  19. {repominer_gdeluisi-0.1.0 → repominer_gdeluisi-1.0.0}/src/repository_miner/data_typing.py +0 -0
  20. {repominer_gdeluisi-0.1.0 → repominer_gdeluisi-1.0.0}/src/repository_miner/exceptions.py +0 -0
  21. {repominer_gdeluisi-0.1.0 → repominer_gdeluisi-1.0.0}/src/repository_miner/py.typed +0 -0
  22. {repominer_gdeluisi-0.1.0 → repominer_gdeluisi-1.0.0}/tests/test_helpers.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: repominer-GDeLuisi
3
- Version: 0.1.0
3
+ Version: 1.0.0
4
4
  Summary: Tool for mining git managed repositories
5
5
  Author: Gerardo De Luisi
6
6
  License-File: LICENSE
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "repominer-GDeLuisi"
3
- version = "0.1.0"
3
+ version = "1.0.0"
4
4
  description = "Tool for mining git managed repositories"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -21,7 +21,7 @@ keywords = ["git","projects","miner"]
21
21
  [tool.pytest.ini_options]
22
22
  testpaths = ["tests"]
23
23
  pythonpath = [
24
- ".", "src","src/repository-miner"
24
+ ".", "src","src/repository_miner"
25
25
  ]
26
26
  filterwarnings = "error"
27
27
  xfail_strict = true
@@ -34,4 +34,4 @@ omit = [
34
34
  requires = ["hatchling"]
35
35
  build-backend = "hatchling.build"
36
36
  [tool.hatch.build.targets.wheel]
37
- packages = ["src"]
37
+ packages = ["src/repository_miner"]
@@ -1,9 +1,8 @@
1
1
  from .utility import execute_command
2
- from .helper import cmd_builder,log_builder,rev_list_builder,get_head_commit,is_dir_a_repo,is_git_available
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,Optional
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='format:%H'"])
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")
@@ -1,5 +1,4 @@
1
1
  import subprocess
2
- from math import floor,ceil
3
2
  from typing import Iterable,Callable,Any
4
3
 
5
4
  class Call():
@@ -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
- 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)
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='format:%h'",text=True,shell=True).splitlines())
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"))