py2docfx 0.1.10rc1880180__py3-none-any.whl → 0.1.11__py3-none-any.whl

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.
@@ -4,6 +4,17 @@ from urllib.parse import urlparse
4
4
 
5
5
  repoMap = {}
6
6
 
7
+ def get_extra_header(repo_location: str, extra_token: str):
8
+ if "github.com" in repo_location.lower(): # github app token needs to use Basic
9
+ return [
10
+ "-c",
11
+ "http.extraHeader=Authorization: Basic {}".format(extra_token),
12
+ ]
13
+ else:
14
+ return [
15
+ "-c",
16
+ "http.extraHeader=Authorization: Bearer {}".format(extra_token),
17
+ ]
7
18
 
8
19
  def clone(repo_location, branch, folder, extra_token=None):
9
20
  """
@@ -31,10 +42,7 @@ def clone(repo_location, branch, folder, extra_token=None):
31
42
 
32
43
  check_params = ["git", "ls-remote", "--heads", repo_location, branch]
33
44
  if extra_token:
34
- check_params[1:1] = [
35
- "-c",
36
- "http.extraHeader=Authorization: Basic {}".format(extra_token),
37
- ]
45
+ check_params[1:1] = get_extra_header(repo_location, extra_token)
38
46
 
39
47
  check_br = subprocess.check_output(check_params)
40
48
 
@@ -50,12 +58,7 @@ def clone(repo_location, branch, folder, extra_token=None):
50
58
  branch,
51
59
  ]
52
60
  if extra_token:
53
- clone_params[1:1] = [
54
- "-c",
55
- "http.extraHeader=Authorization: Basic {}".format(
56
- extra_token
57
- ),
58
- ]
61
+ clone_params[1:1] = get_extra_header(repo_location, extra_token)
59
62
  subprocess.run(clone_params, check=True)
60
63
  repoMap[pureURL] = folder
61
64
  print(
@@ -80,10 +83,7 @@ def test_url(url, extraHeader):
80
83
  params = ["git", "ls-remote", url]
81
84
  if extraHeader:
82
85
  print("Using extra header to test git repo url.")
83
- params[1:1] = [
84
- "-c",
85
- "http.extraHeader=Authorization: Basic {}".format(extraHeader),
86
- ]
86
+ params[1:1] = get_extra_header(url, extraHeader)
87
87
  try:
88
88
  subprocess.check_output(params)
89
89
  return True
@@ -103,10 +103,7 @@ def convertBranch(repo_url, branch, extraHeader):
103
103
  if result == "master":
104
104
  check_params = ["git", "ls-remote", "--heads", repo_url, "refs/heads/main"]
105
105
  if extraHeader:
106
- check_params[1:1] = [
107
- "-c",
108
- "http.extraHeader=Authorization: Basic {}".format(extraHeader),
109
- ]
106
+ check_params[1:1] = get_extra_header(repo_url, extraHeader)
110
107
 
111
108
  checkBr = subprocess.check_output(check_params)
112
109
  if checkBr:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py2docfx
3
- Version: 0.1.10rc1880180
3
+ Version: 0.1.11
4
4
  Summary: A package built based on Sphinx which download source code package and generate yaml files supported by docfx.
5
5
  Author: Microsoft Corporation
6
6
  License: MIT License
@@ -5,7 +5,7 @@ py2docfx/convert_prepare/environment.py,sha256=AwS4c4OSwVdxlExBLVo310HrVhFMhWQ2W
5
5
  py2docfx/convert_prepare/generate_conf.py,sha256=wqs6iyElzJarH-20_qEL9zvZvt5xfBMsGXSXPSZy6wg,2295
6
6
  py2docfx/convert_prepare/generate_document.py,sha256=wkZvdSFT32u6lgAlrL-PmrvVb5sFPq8pue804QVQ75A,2432
7
7
  py2docfx/convert_prepare/get_source.py,sha256=o13Ka_zBjekF_7lhHkyi6GSy4E5cWTnnItbf60JwylI,4954
8
- py2docfx/convert_prepare/git.py,sha256=xGJp2nDWLfVljrxyPnFKPoLIqmBh6by-QdITogIuxi0,5893
8
+ py2docfx/convert_prepare/git.py,sha256=WYCmX77l9VHASEvnsFEXAsE6PcgIRIusRwbmQydXSgg,5952
9
9
  py2docfx/convert_prepare/install_package.py,sha256=hATmgazcSX7k2n4jQXh9sQMyNUc1k1YqHv5K5UMALq4,262
10
10
  py2docfx/convert_prepare/pack.py,sha256=vZS67_GzEhUmZWHU1dxm8gnWyRBs-kB6-KjX1d_FdOU,1260
11
11
  py2docfx/convert_prepare/package_info.py,sha256=vRkFKuBxxIm4yyb2daWTzdISma8pL-RMqu3cp5Kx1Fg,7328
@@ -123,7 +123,7 @@ py2docfx/docfx_yaml/tests/roots/test-writer-uri/conf.py,sha256=avcbnIOV2mlGQwhMQ
123
123
  py2docfx/docfx_yaml/tests/roots/test-writer-versions/code_with_version_directives.py,sha256=UuizbrJPaG_PcaH18BvbI9KQevOaLd4SslpnzMSqcrE,1030
124
124
  py2docfx/docfx_yaml/tests/roots/test-writer-versions/conf.py,sha256=SCEKrm9VigArfdgf-GAieJD-40d0ctT6urmGIjFOZLM,404
125
125
  py2docfx/docfx_yaml/tests/utils/test_utils.py,sha256=d0OYSUQ6NyoZx5mlLdNGGNhiNmmQhjVT4hQ6jY3VE_M,3383
126
- py2docfx-0.1.10rc1880180.dist-info/METADATA,sha256=6vb8Y8DkN2MBlnD6ccUjc5YtkGcHqbdFEhXZ5mW06xQ,599
127
- py2docfx-0.1.10rc1880180.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
128
- py2docfx-0.1.10rc1880180.dist-info/top_level.txt,sha256=5dH2uP81dczt_qQJ38wiZ-gzoVWasfiJALWRSjdbnYU,9
129
- py2docfx-0.1.10rc1880180.dist-info/RECORD,,
126
+ py2docfx-0.1.11.dist-info/METADATA,sha256=YA8t6DNQvAE2mpP4W6lLTztzesy4YjIAdU_uqHkBJf0,590
127
+ py2docfx-0.1.11.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
128
+ py2docfx-0.1.11.dist-info/top_level.txt,sha256=5dH2uP81dczt_qQJ38wiZ-gzoVWasfiJALWRSjdbnYU,9
129
+ py2docfx-0.1.11.dist-info/RECORD,,