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.
Files changed (73) hide show
  1. {cgitize-8.0.3 → cgitize-8.0.4}/DEVELOPMENT.md +3 -3
  2. {cgitize-8.0.3 → cgitize-8.0.4}/PKG-INFO +1 -1
  3. {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/cgit.py +2 -2
  4. {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/config.py +0 -1
  5. {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/github.py +1 -2
  6. {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/header.py +1 -1
  7. {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/main.py +17 -4
  8. {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/repo.py +3 -3
  9. cgitize-8.0.4/cgitize/url.py +29 -0
  10. {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/utils.py +1 -25
  11. {cgitize-8.0.3 → cgitize-8.0.4}/cgitize.egg-info/PKG-INFO +1 -1
  12. {cgitize-8.0.3 → cgitize-8.0.4}/cgitize.egg-info/SOURCES.txt +1 -0
  13. {cgitize-8.0.3 → cgitize-8.0.4}/cgitize.egg-info/scm_file_list.json +1 -0
  14. cgitize-8.0.4/cgitize.egg-info/scm_version.json +8 -0
  15. {cgitize-8.0.3 → cgitize-8.0.4}/prelude.mk +6 -0
  16. {cgitize-8.0.3 → cgitize-8.0.4}/requirements.txt +7 -7
  17. cgitize-8.0.3/cgitize.egg-info/scm_version.json +0 -8
  18. {cgitize-8.0.3 → cgitize-8.0.4}/.dockerignore +0 -0
  19. {cgitize-8.0.3 → cgitize-8.0.4}/.git-blame-ignore-revs +0 -0
  20. {cgitize-8.0.3 → cgitize-8.0.4}/.gitattributes +0 -0
  21. {cgitize-8.0.3 → cgitize-8.0.4}/.github/dependabot.yml +0 -0
  22. {cgitize-8.0.3 → cgitize-8.0.4}/.github/workflows/ci.yml +0 -0
  23. {cgitize-8.0.3 → cgitize-8.0.4}/.github/workflows/maintenance.yml +0 -0
  24. {cgitize-8.0.3 → cgitize-8.0.4}/.gitignore +0 -0
  25. {cgitize-8.0.3 → cgitize-8.0.4}/.pylintrc +0 -0
  26. {cgitize-8.0.3 → cgitize-8.0.4}/.python-version +0 -0
  27. {cgitize-8.0.3 → cgitize-8.0.4}/LICENSE.txt +0 -0
  28. {cgitize-8.0.3 → cgitize-8.0.4}/Makefile +0 -0
  29. {cgitize-8.0.3 → cgitize-8.0.4}/README.md +0 -0
  30. {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/__init__.py +0 -0
  31. {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/bitbucket.py +0 -0
  32. {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/git.py +0 -0
  33. {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/gitlab.py +0 -0
  34. {cgitize-8.0.3 → cgitize-8.0.4}/cgitize/version.py +0 -0
  35. {cgitize-8.0.3 → cgitize-8.0.4}/cgitize.egg-info/dependency_links.txt +0 -0
  36. {cgitize-8.0.3 → cgitize-8.0.4}/cgitize.egg-info/entry_points.txt +0 -0
  37. {cgitize-8.0.3 → cgitize-8.0.4}/cgitize.egg-info/requires.txt +0 -0
  38. {cgitize-8.0.3 → cgitize-8.0.4}/cgitize.egg-info/top_level.txt +0 -0
  39. {cgitize-8.0.3 → cgitize-8.0.4}/docker/Dockerfile +0 -0
  40. {cgitize-8.0.3 → cgitize-8.0.4}/docker/README.md +0 -0
  41. {cgitize-8.0.3 → cgitize-8.0.4}/docker/cgitize.sh +0 -0
  42. {cgitize-8.0.3 → cgitize-8.0.4}/docker/frontend/Dockerfile +0 -0
  43. {cgitize-8.0.3 → cgitize-8.0.4}/docker/frontend/cmd.sh +0 -0
  44. {cgitize-8.0.3 → cgitize-8.0.4}/docker/frontend/etc/cgit/common +0 -0
  45. {cgitize-8.0.3 → cgitize-8.0.4}/docker/frontend/etc/cgitrc +0 -0
  46. {cgitize-8.0.3 → cgitize-8.0.4}/docker/frontend/etc/nginx/conf.d/default.conf +0 -0
  47. {cgitize-8.0.3 → cgitize-8.0.4}/docker/frontend/usr/lib/cgit/filters/about-formatting.sh +0 -0
  48. {cgitize-8.0.3 → cgitize-8.0.4}/docker/frontend/usr/lib/cgit/filters/html-converters/.gitattributes +0 -0
  49. {cgitize-8.0.3 → cgitize-8.0.4}/docker/frontend/usr/lib/cgit/filters/html-converters/md2html +0 -0
  50. {cgitize-8.0.3 → cgitize-8.0.4}/docker/get_output_dir.py +0 -0
  51. {cgitize-8.0.3 → cgitize-8.0.4}/docker/in_cron.sh +0 -0
  52. {cgitize-8.0.3 → cgitize-8.0.4}/docker-compose.yml +0 -0
  53. {cgitize-8.0.3 → cgitize-8.0.4}/docs/api.md +0 -0
  54. {cgitize-8.0.3 → cgitize-8.0.4}/docs/auth.md +0 -0
  55. {cgitize-8.0.3 → cgitize-8.0.4}/examples/cgitize.toml +0 -0
  56. {cgitize-8.0.3 → cgitize-8.0.4}/examples/docker/cgitize.toml +0 -0
  57. {cgitize-8.0.3 → cgitize-8.0.4}/pyproject.toml +0 -0
  58. {cgitize-8.0.3 → cgitize-8.0.4}/setup.cfg +0 -0
  59. {cgitize-8.0.3 → cgitize-8.0.4}/test/__init__.py +0 -0
  60. {cgitize-8.0.3 → cgitize-8.0.4}/test/integration/docker/.dockerignore +0 -0
  61. {cgitize-8.0.3 → cgitize-8.0.4}/test/integration/docker/cgitize/.gitignore +0 -0
  62. {cgitize-8.0.3 → cgitize-8.0.4}/test/integration/docker/cgitize/etc/cgitize.toml +0 -0
  63. {cgitize-8.0.3 → cgitize-8.0.4}/test/integration/docker/docker-compose.yml +0 -0
  64. {cgitize-8.0.3 → cgitize-8.0.4}/test/integration/docker/git_server/Dockerfile +0 -0
  65. {cgitize-8.0.3 → cgitize-8.0.4}/test/integration/docker/git_server/setup_repo.sh +0 -0
  66. {cgitize-8.0.3 → cgitize-8.0.4}/test/integration/docker/test.sh +0 -0
  67. {cgitize-8.0.3 → cgitize-8.0.4}/test/integration/example/test.sh +0 -0
  68. {cgitize-8.0.3 → cgitize-8.0.4}/test/integration/local/test.sh +0 -0
  69. {cgitize-8.0.3 → cgitize-8.0.4}/test/set_credentials.sh +0 -0
  70. {cgitize-8.0.3 → cgitize-8.0.4}/test/unit/__init__.py +0 -0
  71. {cgitize-8.0.3 → cgitize-8.0.4}/test/unit/test_bitbucket.py +0 -0
  72. {cgitize-8.0.3 → cgitize-8.0.4}/test/unit/test_github.py +0 -0
  73. {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 [tagger] to
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
- [tagger]: https://github.com/egor-tensin/tagger
69
+ [tag-release]: https://github.com/egor-tensin/tag-release
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cgitize
3
- Version: 8.0.3
3
+ Version: 8.0.4
4
4
  Summary: Self-host your repositories using cgit
5
5
  Author-email: Egor Tensin <egor@tensin.name>
6
6
  License-Expression: MIT
@@ -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
@@ -5,7 +5,6 @@
5
5
 
6
6
  from abc import ABC, abstractmethod
7
7
  import os
8
- from urllib.parse import quote
9
8
 
10
9
  import tomli
11
10
 
@@ -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
- else:
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
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
  def update(path, success, error=None):
8
- with open(path, "w") as file:
8
+ with open(path, "w", encoding="utf-8") as file:
9
9
  contents = ""
10
10
  if not success:
11
11
  contents = (
@@ -26,16 +26,29 @@ def parse_args(argv=None):
26
26
  help="config file path",
27
27
  )
28
28
  parser.add_argument(
29
- "--repo", metavar="REPO_ID", nargs="*", dest="repos", help="repos to pull"
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", "-f", action="store_true", help="overwrite existing repositories"
36
+ "--force",
37
+ "-f",
38
+ action="store_true",
39
+ help="overwrite existing repositories",
33
40
  )
34
41
  parser.add_argument(
35
- "--verbose", "-v", action="store_true", help="verbose log output"
42
+ "--verbose",
43
+ "-v",
44
+ action="store_true",
45
+ help="verbose log output",
36
46
  )
37
47
  parser.add_argument(
38
- "--version", "-V", action="version", version=f"%(prog)s {__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.utils import url_remove_auth, url_replace_auth
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 = url_remove_auth(https_urls[0]["href"])
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 url_replace_auth(self.clone_url, self.url_auth)
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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cgitize
3
- Version: 8.0.3
3
+ Version: 8.0.4
4
4
  Summary: Self-host your repositories using cgit
5
5
  Author-email: Egor Tensin <egor@tensin.name>
6
6
  License-Expression: MIT
@@ -25,6 +25,7 @@ cgitize/gitlab.py
25
25
  cgitize/header.py
26
26
  cgitize/main.py
27
27
  cgitize/repo.py
28
+ cgitize/url.py
28
29
  cgitize/utils.py
29
30
  cgitize/version.py
30
31
  cgitize.egg-info/PKG-INFO
@@ -23,6 +23,7 @@
23
23
  "cgitize/header.py",
24
24
  "cgitize/main.py",
25
25
  "cgitize/repo.py",
26
+ "cgitize/url.py",
26
27
  "cgitize/utils.py",
27
28
  "cgitize/version.py",
28
29
  "docker-compose.yml",
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "8.0.4",
3
+ "distance": 0,
4
+ "node": "g4925d9d261794df05efc594a275754eee29d4a63",
5
+ "dirty": false,
6
+ "branch": "HEAD",
7
+ "node_date": "2026-10-05"
8
+ }
@@ -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.1
6
- cryptography==50.0.1
7
- Deprecated==1.3.1
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==3.3.1
10
+ oauthlib==4.0.0
11
11
  pycparser==3.0
12
12
  PyGithub==2.10.0
13
- PyJWT==2.14.0
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.9.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.4.1
23
+ wrapt==2.5.0
@@ -1,8 +0,0 @@
1
- {
2
- "tag": "8.0.3",
3
- "distance": 0,
4
- "node": "g8c5b3e9e8c8585beaf2efce2f46beb3ec3e786ca",
5
- "dirty": false,
6
- "branch": "HEAD",
7
- "node_date": "2026-09-21"
8
- }
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