mkdocs-git-authors-plugin 0.9.3__tar.gz → 0.9.4__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 (26) hide show
  1. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4}/PKG-INFO +2 -2
  2. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4}/README.md +1 -1
  3. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4}/pyproject.toml +4 -1
  4. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4/src}/mkdocs_git_authors_plugin/plugin.py +23 -12
  5. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4/src}/mkdocs_git_authors_plugin.egg-info/PKG-INFO +2 -2
  6. mkdocs_git_authors_plugin-0.9.4/src/mkdocs_git_authors_plugin.egg-info/SOURCES.txt +23 -0
  7. mkdocs_git_authors_plugin-0.9.3/mkdocs_git_authors_plugin.egg-info/SOURCES.txt +0 -23
  8. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4}/LICENSE +0 -0
  9. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4}/setup.cfg +0 -0
  10. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4/src}/mkdocs_git_authors_plugin/__init__.py +0 -0
  11. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4/src}/mkdocs_git_authors_plugin/ci.py +0 -0
  12. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4/src}/mkdocs_git_authors_plugin/config.py +0 -0
  13. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4/src}/mkdocs_git_authors_plugin/exclude.py +0 -0
  14. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4/src}/mkdocs_git_authors_plugin/git/__init__.py +0 -0
  15. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4/src}/mkdocs_git_authors_plugin/git/author.py +0 -0
  16. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4/src}/mkdocs_git_authors_plugin/git/command.py +0 -0
  17. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4/src}/mkdocs_git_authors_plugin/git/commit.py +0 -0
  18. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4/src}/mkdocs_git_authors_plugin/git/page.py +0 -0
  19. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4/src}/mkdocs_git_authors_plugin/git/repo.py +0 -0
  20. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4/src}/mkdocs_git_authors_plugin/util.py +0 -0
  21. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4/src}/mkdocs_git_authors_plugin.egg-info/dependency_links.txt +0 -0
  22. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4/src}/mkdocs_git_authors_plugin.egg-info/entry_points.txt +0 -0
  23. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4/src}/mkdocs_git_authors_plugin.egg-info/requires.txt +0 -0
  24. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4/src}/mkdocs_git_authors_plugin.egg-info/top_level.txt +0 -0
  25. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4}/tests/test_basic.py +0 -0
  26. {mkdocs_git_authors_plugin-0.9.3 → mkdocs_git_authors_plugin-0.9.4}/tests/test_util.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: mkdocs-git-authors-plugin
3
- Version: 0.9.3
3
+ Version: 0.9.4
4
4
  Summary: Mkdocs plugin to display git authors of a page
5
5
  Author-email: Tim Vink <vinktim@gmail.com>
6
6
  License: MIT
@@ -72,7 +72,7 @@ This plugin needs access to the last commit that touched a specific file to be a
72
72
  <summary>Change your CI settings</summary>
73
73
 
74
74
  - github actions: set `fetch_depth` to `0` ([docs](https://github.com/actions/checkout))
75
- - gitlab runners: set `GIT_DEPTH` to `1000` ([docs](https://docs.gitlab.com/ee/user/project/pipelines/settings.html#git-shallow-clone))
75
+ - gitlab runners: set `GIT_DEPTH` to `0` ([docs](https://docs.gitlab.com/ee/ci/pipelines/settings.html#limit-the-number-of-changes-fetched-during-clone))
76
76
  - bitbucket pipelines: set `clone: depth: full` ([docs](https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/))
77
77
  </details>
78
78
 
@@ -46,7 +46,7 @@ This plugin needs access to the last commit that touched a specific file to be a
46
46
  <summary>Change your CI settings</summary>
47
47
 
48
48
  - github actions: set `fetch_depth` to `0` ([docs](https://github.com/actions/checkout))
49
- - gitlab runners: set `GIT_DEPTH` to `1000` ([docs](https://docs.gitlab.com/ee/user/project/pipelines/settings.html#git-shallow-clone))
49
+ - gitlab runners: set `GIT_DEPTH` to `0` ([docs](https://docs.gitlab.com/ee/ci/pipelines/settings.html#limit-the-number-of-changes-fetched-during-clone))
50
50
  - bitbucket pipelines: set `clone: depth: full` ([docs](https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/))
51
51
  </details>
52
52
 
@@ -12,7 +12,7 @@ authors = [
12
12
  ]
13
13
  keywords = ["mkdocs", "git", "contributors", "committers", "authors", "plugin"]
14
14
  urls = {Homepage = "https://github.com/timvink/mkdocs-git-authors-plugin"}
15
- version = "0.9.3"
15
+ version = "0.9.4"
16
16
  requires-python = ">=3.8"
17
17
  dependencies = ["mkdocs>=1.0"]
18
18
  classifiers = [
@@ -34,6 +34,9 @@ classifiers = [
34
34
  [project.entry-points."mkdocs.plugins"]
35
35
  git-authors = "mkdocs_git_authors_plugin.plugin:GitAuthorsPlugin"
36
36
 
37
+ [tool.setuptools]
38
+ package-dir = {"" = "src"}
39
+
37
40
  [dependency-groups]
38
41
  dev = [
39
42
  "click>=8.1.8",
@@ -58,21 +58,32 @@ class GitAuthorsPlugin(BasePlugin[GitAuthorsPluginConfig]):
58
58
  assert self.config.authorship_threshold_percent >= 0
59
59
  assert self.config.authorship_threshold_percent <= 100
60
60
 
61
+ self._fallback = False
62
+ # Find the git repository in the current working directory
61
63
  try:
62
- with working_directory(config.get("docs_dir",".")):
63
- self._repo = Repo()
64
- self._fallback = False
64
+ self._repo = Repo()
65
+ except GitCommandError:
66
+ self._repo = None
67
+
68
+ # Try finding the git repository inside the documentation directory
69
+ if self._repo is None:
70
+ try:
71
+ with working_directory(config.get("docs_dir", ".")):
72
+ self._repo = Repo()
73
+ except GitCommandError:
74
+ if self.config.fallback_to_empty:
75
+ self._fallback = True
76
+ logger.warning(
77
+ "[git-authors-plugin] Unable to find a git directory and/or git is not installed."
78
+ " Option 'fallback_to_empty' set to 'true': Falling back to empty authors list"
79
+ )
80
+ else:
81
+ raise
82
+
83
+ if self._repo is not None:
65
84
  self.repo().set_config(self.config)
66
85
  raise_ci_warnings(path=self.repo()._root)
67
- except GitCommandError:
68
- if self.config.fallback_to_empty:
69
- self._fallback = True
70
- logger.warning(
71
- "[git-authors-plugin] Unable to find a git directory and/or git is not installed."
72
- " Option 'fallback_to_empty' set to 'true': Falling back to empty authors list"
73
- )
74
- else:
75
- raise
86
+
76
87
 
77
88
  def on_files(
78
89
  self, files: Files, *, config: MkDocsConfig, **kwargs
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: mkdocs-git-authors-plugin
3
- Version: 0.9.3
3
+ Version: 0.9.4
4
4
  Summary: Mkdocs plugin to display git authors of a page
5
5
  Author-email: Tim Vink <vinktim@gmail.com>
6
6
  License: MIT
@@ -72,7 +72,7 @@ This plugin needs access to the last commit that touched a specific file to be a
72
72
  <summary>Change your CI settings</summary>
73
73
 
74
74
  - github actions: set `fetch_depth` to `0` ([docs](https://github.com/actions/checkout))
75
- - gitlab runners: set `GIT_DEPTH` to `1000` ([docs](https://docs.gitlab.com/ee/user/project/pipelines/settings.html#git-shallow-clone))
75
+ - gitlab runners: set `GIT_DEPTH` to `0` ([docs](https://docs.gitlab.com/ee/ci/pipelines/settings.html#limit-the-number-of-changes-fetched-during-clone))
76
76
  - bitbucket pipelines: set `clone: depth: full` ([docs](https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/))
77
77
  </details>
78
78
 
@@ -0,0 +1,23 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/mkdocs_git_authors_plugin/__init__.py
5
+ src/mkdocs_git_authors_plugin/ci.py
6
+ src/mkdocs_git_authors_plugin/config.py
7
+ src/mkdocs_git_authors_plugin/exclude.py
8
+ src/mkdocs_git_authors_plugin/plugin.py
9
+ src/mkdocs_git_authors_plugin/util.py
10
+ src/mkdocs_git_authors_plugin.egg-info/PKG-INFO
11
+ src/mkdocs_git_authors_plugin.egg-info/SOURCES.txt
12
+ src/mkdocs_git_authors_plugin.egg-info/dependency_links.txt
13
+ src/mkdocs_git_authors_plugin.egg-info/entry_points.txt
14
+ src/mkdocs_git_authors_plugin.egg-info/requires.txt
15
+ src/mkdocs_git_authors_plugin.egg-info/top_level.txt
16
+ src/mkdocs_git_authors_plugin/git/__init__.py
17
+ src/mkdocs_git_authors_plugin/git/author.py
18
+ src/mkdocs_git_authors_plugin/git/command.py
19
+ src/mkdocs_git_authors_plugin/git/commit.py
20
+ src/mkdocs_git_authors_plugin/git/page.py
21
+ src/mkdocs_git_authors_plugin/git/repo.py
22
+ tests/test_basic.py
23
+ tests/test_util.py
@@ -1,23 +0,0 @@
1
- LICENSE
2
- README.md
3
- pyproject.toml
4
- mkdocs_git_authors_plugin/__init__.py
5
- mkdocs_git_authors_plugin/ci.py
6
- mkdocs_git_authors_plugin/config.py
7
- mkdocs_git_authors_plugin/exclude.py
8
- mkdocs_git_authors_plugin/plugin.py
9
- mkdocs_git_authors_plugin/util.py
10
- mkdocs_git_authors_plugin.egg-info/PKG-INFO
11
- mkdocs_git_authors_plugin.egg-info/SOURCES.txt
12
- mkdocs_git_authors_plugin.egg-info/dependency_links.txt
13
- mkdocs_git_authors_plugin.egg-info/entry_points.txt
14
- mkdocs_git_authors_plugin.egg-info/requires.txt
15
- mkdocs_git_authors_plugin.egg-info/top_level.txt
16
- mkdocs_git_authors_plugin/git/__init__.py
17
- mkdocs_git_authors_plugin/git/author.py
18
- mkdocs_git_authors_plugin/git/command.py
19
- mkdocs_git_authors_plugin/git/commit.py
20
- mkdocs_git_authors_plugin/git/page.py
21
- mkdocs_git_authors_plugin/git/repo.py
22
- tests/test_basic.py
23
- tests/test_util.py