cgitize 8.0.3__tar.gz → 8.0.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.
- {cgitize-8.0.3 → cgitize-8.0.4}/DEVELOPMENT.md +3 -3
- {cgitize-8.0.3 → cgitize-8.0.4}/PKG-INFO +1 -1
- {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/cgit.py +2 -2
- {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/config.py +0 -1
- {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/github.py +1 -2
- {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/header.py +1 -1
- {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/main.py +17 -4
- {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/repo.py +3 -3
- cgitize-8.0.4/cgitize/url.py +29 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/utils.py +1 -25
- {cgitize-8.0.3 → cgitize-8.0.4}/cgitize.egg-info/PKG-INFO +1 -1
- {cgitize-8.0.3 → cgitize-8.0.4}/cgitize.egg-info/SOURCES.txt +1 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/cgitize.egg-info/scm_file_list.json +1 -0
- cgitize-8.0.4/cgitize.egg-info/scm_version.json +8 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/prelude.mk +6 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/requirements.txt +7 -7
- cgitize-8.0.3/cgitize.egg-info/scm_version.json +0 -8
- {cgitize-8.0.3 → cgitize-8.0.4}/.dockerignore +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/.git-blame-ignore-revs +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/.gitattributes +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/.github/dependabot.yml +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/.github/workflows/ci.yml +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/.github/workflows/maintenance.yml +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/.gitignore +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/.pylintrc +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/.python-version +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/LICENSE.txt +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/Makefile +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/README.md +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/__init__.py +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/bitbucket.py +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/git.py +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/gitlab.py +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/version.py +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/cgitize.egg-info/dependency_links.txt +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/cgitize.egg-info/entry_points.txt +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/cgitize.egg-info/requires.txt +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/cgitize.egg-info/top_level.txt +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/docker/Dockerfile +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/docker/README.md +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/docker/cgitize.sh +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/docker/frontend/Dockerfile +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/docker/frontend/cmd.sh +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/docker/frontend/etc/cgit/common +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/docker/frontend/etc/cgitrc +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/docker/frontend/etc/nginx/conf.d/default.conf +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/docker/frontend/usr/lib/cgit/filters/about-formatting.sh +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/docker/frontend/usr/lib/cgit/filters/html-converters/.gitattributes +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/docker/frontend/usr/lib/cgit/filters/html-converters/md2html +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/docker/get_output_dir.py +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/docker/in_cron.sh +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/docker-compose.yml +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/docs/api.md +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/docs/auth.md +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/examples/cgitize.toml +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/examples/docker/cgitize.toml +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/pyproject.toml +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/setup.cfg +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/test/__init__.py +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/test/integration/docker/.dockerignore +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/test/integration/docker/cgitize/.gitignore +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/test/integration/docker/cgitize/etc/cgitize.toml +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/test/integration/docker/docker-compose.yml +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/test/integration/docker/git_server/Dockerfile +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/test/integration/docker/git_server/setup_repo.sh +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/test/integration/docker/test.sh +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/test/integration/example/test.sh +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/test/integration/local/test.sh +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/test/set_credentials.sh +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/test/unit/__init__.py +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/test/unit/test_bitbucket.py +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/test/unit/test_github.py +0 -0
- {cgitize-8.0.3 → cgitize-8.0.4}/test/unit/test_gitlab.py +0 -0
|
@@ -61,9 +61,9 @@ Upgrading dependencies
|
|
|
61
61
|
Releases
|
|
62
62
|
--------
|
|
63
63
|
|
|
64
|
-
* Make a new tag using the semantic versioning policy (you can use [
|
|
65
|
-
do that), review and push it.
|
|
64
|
+
* Make a new tag using the semantic versioning policy (you can use [tag-release]
|
|
65
|
+
to do that), review and push it.
|
|
66
66
|
* For a new major version, update the version in the docker-compose definition
|
|
67
67
|
in docker/README.md.
|
|
68
68
|
|
|
69
|
-
[
|
|
69
|
+
[tag-release]: https://github.com/egor-tensin/tag-release
|
|
@@ -30,7 +30,7 @@ class CGitRCWriter:
|
|
|
30
30
|
return os.path.join(repo_dir, "cgitrc")
|
|
31
31
|
|
|
32
32
|
def write(self, repo_dir, repo):
|
|
33
|
-
with open(self.get_path(repo_dir), "w") as fd:
|
|
33
|
+
with open(self.get_path(repo_dir), "w", encoding="utf-8") as fd:
|
|
34
34
|
self._write_field(fd, "clone-url", self._build_clone_url(repo))
|
|
35
35
|
self._write_field(fd, "owner", repo.owner)
|
|
36
36
|
self._write_field(fd, "desc", repo.desc)
|
|
@@ -61,7 +61,7 @@ class AgeFile:
|
|
|
61
61
|
timestamp = AgeFile.get_age(repo_dir)
|
|
62
62
|
if timestamp:
|
|
63
63
|
os.makedirs(AgeFile.get_dir(repo_dir), exist_ok=True)
|
|
64
|
-
with open(AgeFile.get_path(repo_dir), mode="w") as fd:
|
|
64
|
+
with open(AgeFile.get_path(repo_dir), mode="w", encoding="utf-8") as fd:
|
|
65
65
|
fd.write(f"{timestamp}")
|
|
66
66
|
|
|
67
67
|
@staticmethod
|
|
@@ -41,8 +41,7 @@ class GitHub:
|
|
|
41
41
|
# To get private repositories, get_user() must be called
|
|
42
42
|
# without arguments:
|
|
43
43
|
return self._impl.get_user().get_repos(affiliation="owner", **kwargs)
|
|
44
|
-
|
|
45
|
-
return self._impl.get_user(user.name).get_repos(**kwargs)
|
|
44
|
+
return self._impl.get_user(user.name).get_repos(**kwargs)
|
|
46
45
|
except GithubException:
|
|
47
46
|
logging.error("Couldn't fetch user repositories: %s", user.name)
|
|
48
47
|
raise
|
|
@@ -26,16 +26,29 @@ def parse_args(argv=None):
|
|
|
26
26
|
help="config file path",
|
|
27
27
|
)
|
|
28
28
|
parser.add_argument(
|
|
29
|
-
"--repo",
|
|
29
|
+
"--repo",
|
|
30
|
+
metavar="REPO_ID",
|
|
31
|
+
nargs="*",
|
|
32
|
+
dest="repos",
|
|
33
|
+
help="repos to pull",
|
|
30
34
|
)
|
|
31
35
|
parser.add_argument(
|
|
32
|
-
"--force",
|
|
36
|
+
"--force",
|
|
37
|
+
"-f",
|
|
38
|
+
action="store_true",
|
|
39
|
+
help="overwrite existing repositories",
|
|
33
40
|
)
|
|
34
41
|
parser.add_argument(
|
|
35
|
-
"--verbose",
|
|
42
|
+
"--verbose",
|
|
43
|
+
"-v",
|
|
44
|
+
action="store_true",
|
|
45
|
+
help="verbose log output",
|
|
36
46
|
)
|
|
37
47
|
parser.add_argument(
|
|
38
|
-
"--version",
|
|
48
|
+
"--version",
|
|
49
|
+
"-V",
|
|
50
|
+
action="version",
|
|
51
|
+
version=f"%(prog)s {__version__}",
|
|
39
52
|
)
|
|
40
53
|
return parser.parse_args(argv)
|
|
41
54
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
from enum import Enum
|
|
7
7
|
import os.path
|
|
8
8
|
|
|
9
|
-
from cgitize
|
|
9
|
+
from cgitize import url
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class Visibility(Enum):
|
|
@@ -117,7 +117,7 @@ class Repo:
|
|
|
117
117
|
if len(https_urls) != 1:
|
|
118
118
|
raise RuntimeError(f"no https:// clone URL for repository '{name}'?!")
|
|
119
119
|
# Bitbucket leaves the username in the URL... Sigh.
|
|
120
|
-
api_auth, https_url =
|
|
120
|
+
api_auth, https_url = url.remove_auth(https_urls[0]["href"])
|
|
121
121
|
|
|
122
122
|
ssh_urls = [
|
|
123
123
|
link for link in src.data["links"]["clone"] if link["name"] == "ssh"
|
|
@@ -231,7 +231,7 @@ class Repo:
|
|
|
231
231
|
def clone_url_with_auth(self):
|
|
232
232
|
if not self.url_auth:
|
|
233
233
|
return self.clone_url
|
|
234
|
-
return
|
|
234
|
+
return url.replace_auth(self.clone_url, self.url_auth)
|
|
235
235
|
|
|
236
236
|
def _with_dir(self, s):
|
|
237
237
|
if self._dir is None:
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Copyright (c) 2026 Egor Tensin <egor@tensin.name>
|
|
2
|
+
# This file is part of the "cgitize" project.
|
|
3
|
+
# For details, see https://github.com/egor-tensin/cgitize
|
|
4
|
+
# Distributed under the MIT License.
|
|
5
|
+
|
|
6
|
+
from urllib.parse import quote, urlsplit, urlunsplit
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def replace_auth(url, auth):
|
|
10
|
+
username, password = auth
|
|
11
|
+
parts = urlsplit(url)
|
|
12
|
+
netloc = quote(username)
|
|
13
|
+
if password is not None:
|
|
14
|
+
netloc += f":{quote(password)}"
|
|
15
|
+
netloc += f"@{parts.hostname}"
|
|
16
|
+
if parts.port is not None:
|
|
17
|
+
netloc += f":{parts.port}"
|
|
18
|
+
parts = parts._replace(netloc=netloc)
|
|
19
|
+
return urlunsplit(parts)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def remove_auth(url):
|
|
23
|
+
parts = urlsplit(url)
|
|
24
|
+
auth = parts.username, parts.password
|
|
25
|
+
netloc = parts.hostname
|
|
26
|
+
if parts.port is not None:
|
|
27
|
+
netloc += f":{parts.port}"
|
|
28
|
+
parts = parts._replace(netloc=netloc)
|
|
29
|
+
return auth, urlunsplit(parts)
|
|
@@ -9,7 +9,6 @@ import os
|
|
|
9
9
|
import stat
|
|
10
10
|
import subprocess
|
|
11
11
|
import sys
|
|
12
|
-
from urllib.parse import quote, urlsplit, urlunsplit
|
|
13
12
|
|
|
14
13
|
|
|
15
14
|
@contextmanager
|
|
@@ -100,33 +99,10 @@ def protected_file(path):
|
|
|
100
99
|
finally:
|
|
101
100
|
os.chmod(path, old_permissions)
|
|
102
101
|
else:
|
|
103
|
-
with open(path, mode="w"):
|
|
102
|
+
with open(path, mode="w", encoding="utf-8"):
|
|
104
103
|
pass
|
|
105
104
|
os.chmod(path, new_permissions)
|
|
106
105
|
try:
|
|
107
106
|
yield
|
|
108
107
|
finally:
|
|
109
108
|
os.unlink(path)
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
def url_replace_auth(url, auth):
|
|
113
|
-
username, password = auth
|
|
114
|
-
parts = urlsplit(url)
|
|
115
|
-
netloc = quote(username)
|
|
116
|
-
if password is not None:
|
|
117
|
-
netloc += f":{quote(password)}"
|
|
118
|
-
netloc += f"@{parts.hostname}"
|
|
119
|
-
if parts.port is not None:
|
|
120
|
-
netloc += f":{parts.port}"
|
|
121
|
-
parts = parts._replace(netloc=netloc)
|
|
122
|
-
return urlunsplit(parts)
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
def url_remove_auth(url):
|
|
126
|
-
parts = urlsplit(url)
|
|
127
|
-
auth = parts.username, parts.password
|
|
128
|
-
netloc = parts.hostname
|
|
129
|
-
if parts.port is not None:
|
|
130
|
-
netloc += f":{parts.port}"
|
|
131
|
-
parts = parts._replace(netloc=netloc)
|
|
132
|
-
return auth, urlunsplit(parts)
|
|
@@ -21,3 +21,9 @@ ifeq ($$(origin $(1)),command line)
|
|
|
21
21
|
override $(1) := $$(value $(1))
|
|
22
22
|
endif
|
|
23
23
|
endef
|
|
24
|
+
|
|
25
|
+
# A helper target to force execution of pattern rules (works like .PHONY for
|
|
26
|
+
# them): https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
|
|
27
|
+
#
|
|
28
|
+
.PHONY: DO
|
|
29
|
+
DO:
|
|
@@ -2,22 +2,22 @@ atlassian-python-api==4.0.7
|
|
|
2
2
|
beautifulsoup4==4.15.0
|
|
3
3
|
certifi==2026.7.22
|
|
4
4
|
cffi==2.1.1
|
|
5
|
-
charset-normalizer==3.5.
|
|
6
|
-
cryptography==50.0.
|
|
7
|
-
Deprecated==
|
|
5
|
+
charset-normalizer==3.5.2
|
|
6
|
+
cryptography==50.0.2
|
|
7
|
+
Deprecated==3.0.0
|
|
8
8
|
idna==3.20
|
|
9
9
|
jmespath==1.1.0
|
|
10
|
-
oauthlib==
|
|
10
|
+
oauthlib==4.0.0
|
|
11
11
|
pycparser==3.0
|
|
12
12
|
PyGithub==2.10.0
|
|
13
|
-
PyJWT==2.
|
|
13
|
+
PyJWT==2.15.1
|
|
14
14
|
PyNaCl==1.6.2
|
|
15
15
|
python-gitlab==6.5.0
|
|
16
16
|
requests==2.34.2
|
|
17
17
|
requests-oauthlib==2.0.0
|
|
18
18
|
requests-toolbelt==1.0.0
|
|
19
|
-
soupsieve==2.
|
|
19
|
+
soupsieve==2.10
|
|
20
20
|
tomli==2.4.1
|
|
21
21
|
typing_extensions==4.16.0
|
|
22
22
|
urllib3==2.8.0
|
|
23
|
-
wrapt==2.
|
|
23
|
+
wrapt==2.5.0
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cgitize-8.0.3 → cgitize-8.0.4}/docker/frontend/usr/lib/cgit/filters/html-converters/.gitattributes
RENAMED
|
File without changes
|
{cgitize-8.0.3 → cgitize-8.0.4}/docker/frontend/usr/lib/cgit/filters/html-converters/md2html
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|