cgitize 8.0.4__tar.gz → 8.0.6__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.4 → cgitize-8.0.6}/.github/workflows/ci.yml +15 -4
  2. {cgitize-8.0.4 → cgitize-8.0.6}/PKG-INFO +4 -10
  3. {cgitize-8.0.4 → cgitize-8.0.6}/README.md +2 -8
  4. {cgitize-8.0.4 → cgitize-8.0.6}/cgitize/cgit.py +1 -1
  5. {cgitize-8.0.4 → cgitize-8.0.6}/cgitize/repo.py +32 -29
  6. {cgitize-8.0.4 → cgitize-8.0.6}/cgitize/utils.py +0 -10
  7. {cgitize-8.0.4 → cgitize-8.0.6}/cgitize.egg-info/PKG-INFO +4 -10
  8. {cgitize-8.0.4 → cgitize-8.0.6}/cgitize.egg-info/SOURCES.txt +0 -1
  9. {cgitize-8.0.4 → cgitize-8.0.6}/cgitize.egg-info/scm_file_list.json +0 -1
  10. cgitize-8.0.6/cgitize.egg-info/scm_version.json +8 -0
  11. {cgitize-8.0.4 → cgitize-8.0.6}/docker/README.md +21 -19
  12. {cgitize-8.0.4 → cgitize-8.0.6}/pyproject.toml +15 -1
  13. {cgitize-8.0.4 → cgitize-8.0.6}/requirements.txt +2 -2
  14. cgitize-8.0.4/.pylintrc +0 -14
  15. cgitize-8.0.4/cgitize.egg-info/scm_version.json +0 -8
  16. {cgitize-8.0.4 → cgitize-8.0.6}/.dockerignore +0 -0
  17. {cgitize-8.0.4 → cgitize-8.0.6}/.git-blame-ignore-revs +0 -0
  18. {cgitize-8.0.4 → cgitize-8.0.6}/.gitattributes +0 -0
  19. {cgitize-8.0.4 → cgitize-8.0.6}/.github/dependabot.yml +0 -0
  20. {cgitize-8.0.4 → cgitize-8.0.6}/.github/workflows/maintenance.yml +0 -0
  21. {cgitize-8.0.4 → cgitize-8.0.6}/.gitignore +0 -0
  22. {cgitize-8.0.4 → cgitize-8.0.6}/.python-version +0 -0
  23. {cgitize-8.0.4 → cgitize-8.0.6}/DEVELOPMENT.md +0 -0
  24. {cgitize-8.0.4 → cgitize-8.0.6}/LICENSE.txt +0 -0
  25. {cgitize-8.0.4 → cgitize-8.0.6}/Makefile +0 -0
  26. {cgitize-8.0.4 → cgitize-8.0.6}/cgitize/__init__.py +0 -0
  27. {cgitize-8.0.4 → cgitize-8.0.6}/cgitize/bitbucket.py +0 -0
  28. {cgitize-8.0.4 → cgitize-8.0.6}/cgitize/config.py +0 -0
  29. {cgitize-8.0.4 → cgitize-8.0.6}/cgitize/git.py +0 -0
  30. {cgitize-8.0.4 → cgitize-8.0.6}/cgitize/github.py +0 -0
  31. {cgitize-8.0.4 → cgitize-8.0.6}/cgitize/gitlab.py +0 -0
  32. {cgitize-8.0.4 → cgitize-8.0.6}/cgitize/header.py +0 -0
  33. {cgitize-8.0.4 → cgitize-8.0.6}/cgitize/main.py +0 -0
  34. {cgitize-8.0.4 → cgitize-8.0.6}/cgitize/url.py +0 -0
  35. {cgitize-8.0.4 → cgitize-8.0.6}/cgitize/version.py +0 -0
  36. {cgitize-8.0.4 → cgitize-8.0.6}/cgitize.egg-info/dependency_links.txt +0 -0
  37. {cgitize-8.0.4 → cgitize-8.0.6}/cgitize.egg-info/entry_points.txt +0 -0
  38. {cgitize-8.0.4 → cgitize-8.0.6}/cgitize.egg-info/requires.txt +0 -0
  39. {cgitize-8.0.4 → cgitize-8.0.6}/cgitize.egg-info/top_level.txt +0 -0
  40. {cgitize-8.0.4 → cgitize-8.0.6}/docker/Dockerfile +0 -0
  41. {cgitize-8.0.4 → cgitize-8.0.6}/docker/cgitize.sh +0 -0
  42. {cgitize-8.0.4 → cgitize-8.0.6}/docker/frontend/Dockerfile +0 -0
  43. {cgitize-8.0.4 → cgitize-8.0.6}/docker/frontend/cmd.sh +0 -0
  44. {cgitize-8.0.4 → cgitize-8.0.6}/docker/frontend/etc/cgit/common +0 -0
  45. {cgitize-8.0.4 → cgitize-8.0.6}/docker/frontend/etc/cgitrc +0 -0
  46. {cgitize-8.0.4 → cgitize-8.0.6}/docker/frontend/etc/nginx/conf.d/default.conf +0 -0
  47. {cgitize-8.0.4 → cgitize-8.0.6}/docker/frontend/usr/lib/cgit/filters/about-formatting.sh +0 -0
  48. {cgitize-8.0.4 → cgitize-8.0.6}/docker/frontend/usr/lib/cgit/filters/html-converters/.gitattributes +0 -0
  49. {cgitize-8.0.4 → cgitize-8.0.6}/docker/frontend/usr/lib/cgit/filters/html-converters/md2html +0 -0
  50. {cgitize-8.0.4 → cgitize-8.0.6}/docker/get_output_dir.py +0 -0
  51. {cgitize-8.0.4 → cgitize-8.0.6}/docker/in_cron.sh +0 -0
  52. {cgitize-8.0.4 → cgitize-8.0.6}/docker-compose.yml +0 -0
  53. {cgitize-8.0.4 → cgitize-8.0.6}/docs/api.md +0 -0
  54. {cgitize-8.0.4 → cgitize-8.0.6}/docs/auth.md +0 -0
  55. {cgitize-8.0.4 → cgitize-8.0.6}/examples/cgitize.toml +0 -0
  56. {cgitize-8.0.4 → cgitize-8.0.6}/examples/docker/cgitize.toml +0 -0
  57. {cgitize-8.0.4 → cgitize-8.0.6}/prelude.mk +0 -0
  58. {cgitize-8.0.4 → cgitize-8.0.6}/setup.cfg +0 -0
  59. {cgitize-8.0.4 → cgitize-8.0.6}/test/__init__.py +0 -0
  60. {cgitize-8.0.4 → cgitize-8.0.6}/test/integration/docker/.dockerignore +0 -0
  61. {cgitize-8.0.4 → cgitize-8.0.6}/test/integration/docker/cgitize/.gitignore +0 -0
  62. {cgitize-8.0.4 → cgitize-8.0.6}/test/integration/docker/cgitize/etc/cgitize.toml +0 -0
  63. {cgitize-8.0.4 → cgitize-8.0.6}/test/integration/docker/docker-compose.yml +0 -0
  64. {cgitize-8.0.4 → cgitize-8.0.6}/test/integration/docker/git_server/Dockerfile +0 -0
  65. {cgitize-8.0.4 → cgitize-8.0.6}/test/integration/docker/git_server/setup_repo.sh +0 -0
  66. {cgitize-8.0.4 → cgitize-8.0.6}/test/integration/docker/test.sh +0 -0
  67. {cgitize-8.0.4 → cgitize-8.0.6}/test/integration/example/test.sh +0 -0
  68. {cgitize-8.0.4 → cgitize-8.0.6}/test/integration/local/test.sh +0 -0
  69. {cgitize-8.0.4 → cgitize-8.0.6}/test/set_credentials.sh +0 -0
  70. {cgitize-8.0.4 → cgitize-8.0.6}/test/unit/__init__.py +0 -0
  71. {cgitize-8.0.4 → cgitize-8.0.6}/test/unit/test_bitbucket.py +0 -0
  72. {cgitize-8.0.4 → cgitize-8.0.6}/test/unit/test_github.py +0 -0
  73. {cgitize-8.0.4 → cgitize-8.0.6}/test/unit/test_gitlab.py +0 -0
@@ -25,7 +25,11 @@ jobs:
25
25
  runs-on: ubuntu-latest
26
26
  strategy:
27
27
  matrix:
28
- python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
28
+ python-version:
29
+ - '3.11'
30
+ - '3.12'
31
+ - '3.13'
32
+ - '3.14'
29
33
  name: 'Test / ${{ matrix.python-version }}'
30
34
  env:
31
35
  CGITIZE_GITHUB_USERNAME: '${{ secrets.CGITIZE_GITHUB_USERNAME }}'
@@ -61,7 +65,9 @@ jobs:
61
65
  run: sudo make test/docker
62
66
 
63
67
  test_example_config:
64
- needs: [test_local, test_docker]
68
+ needs:
69
+ - test_local
70
+ - test_docker
65
71
  runs-on: ubuntu-latest
66
72
  name: 'Test / example config'
67
73
  env:
@@ -88,7 +94,11 @@ jobs:
88
94
  run: make test/example
89
95
 
90
96
  publish_docker:
91
- needs: [lint, test_local, test_example_config, test_docker]
97
+ needs:
98
+ - lint
99
+ - test_local
100
+ - test_example_config
101
+ - test_docker
92
102
  runs-on: ubuntu-latest
93
103
  strategy:
94
104
  matrix:
@@ -149,7 +159,8 @@ jobs:
149
159
  tags: '${{ steps.meta.outputs.tags }}'
150
160
 
151
161
  publish_pypi:
152
- needs: [publish_docker]
162
+ needs:
163
+ - publish_docker
153
164
  runs-on: ubuntu-latest
154
165
  name: 'Publish / PyPI'
155
166
  steps:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cgitize
3
- Version: 8.0.4
3
+ Version: 8.0.6
4
4
  Summary: Self-host your repositories using cgit
5
5
  Author-email: Egor Tensin <egor@tensin.name>
6
6
  License-Expression: MIT
@@ -9,7 +9,7 @@ Project-URL: Bug Tracker, https://github.com/egor-tensin/cgitize/issues
9
9
  Classifier: Development Status :: 5 - Production/Stable
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Topic :: Software Development :: Version Control :: Git
12
- Requires-Python: >=3.9
12
+ Requires-Python: >=3.11
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE.txt
15
15
  Requires-Dist: atlassian-python-api~=4.0
@@ -37,7 +37,8 @@ Example output can be found at https://git.tensin.name/.
37
37
  Installation
38
38
  ------------
39
39
 
40
- pip install cgitize
40
+ * Python: [PyPI](https://pypi.org/project/cgitize/)
41
+ * Docker: see [docker/README.md](docker/README.md).
41
42
 
42
43
  Usage
43
44
  -----
@@ -55,13 +56,6 @@ access tokens/application passwords).
55
56
 
56
57
  [examples/cgitize.toml]: examples/cgitize.toml
57
58
 
58
- ### Docker
59
-
60
- You can run `cgitize` in a Docker container.
61
- A separate image includes a web server with a configured cgit installation.
62
-
63
- Please see [docker/README.md](docker/README.md) for details.
64
-
65
59
  Mirror maintenance
66
60
  ------------------
67
61
 
@@ -16,7 +16,8 @@ Example output can be found at https://git.tensin.name/.
16
16
  Installation
17
17
  ------------
18
18
 
19
- pip install cgitize
19
+ * Python: [PyPI](https://pypi.org/project/cgitize/)
20
+ * Docker: see [docker/README.md](docker/README.md).
20
21
 
21
22
  Usage
22
23
  -----
@@ -34,13 +35,6 @@ access tokens/application passwords).
34
35
 
35
36
  [examples/cgitize.toml]: examples/cgitize.toml
36
37
 
37
- ### Docker
38
-
39
- You can run `cgitize` in a Docker container.
40
- A separate image includes a web server with a configured cgit installation.
41
-
42
- Please see [docker/README.md](docker/README.md) for details.
43
-
44
38
  Mirror maintenance
45
39
  ------------------
46
40
 
@@ -3,12 +3,12 @@
3
3
  # For details, see https://github.com/egor-tensin/cgitize
4
4
  # Distributed under the MIT License.
5
5
 
6
+ from contextlib import chdir
6
7
  import logging
7
8
  import os
8
9
  import shutil
9
10
 
10
11
  from cgitize.git import Git
11
- from cgitize.utils import chdir
12
12
 
13
13
 
14
14
  class CGitServer:
@@ -3,19 +3,16 @@
3
3
  # For details, see https://github.com/egor-tensin/cgitize
4
4
  # Distributed under the MIT License.
5
5
 
6
- from enum import Enum
6
+ from enum import auto, StrEnum
7
7
  import os.path
8
8
 
9
9
  from cgitize import url
10
10
 
11
11
 
12
- class Visibility(Enum):
13
- ALL = "all"
14
- PUBLIC = "public"
15
- PRIVATE = "private"
16
-
17
- def __str__(self):
18
- return self.name
12
+ class Visibility(StrEnum):
13
+ ALL = auto()
14
+ PUBLIC = auto()
15
+ PRIVATE = auto()
19
16
 
20
17
  @staticmethod
21
18
  def from_config(public, private):
@@ -32,33 +29,39 @@ class Visibility(Enum):
32
29
  def to_bitbucket_arg(self):
33
30
  # https://developer.atlassian.com/cloud/bitbucket/rest/intro/#filtering
34
31
  # https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-group-repositories
35
- if self is Visibility.ALL:
36
- return None
37
- if self is Visibility.PUBLIC:
38
- return "is_private=False"
39
- if self is Visibility.PRIVATE:
40
- return "is_private=True"
41
- raise NotImplementedError(f"not implemented visibility level: {self}")
32
+ match self:
33
+ case Visibility.ALL:
34
+ return None
35
+ case Visibility.PUBLIC:
36
+ return "is_private=False"
37
+ case Visibility.PRIVATE:
38
+ return "is_private=True"
39
+ case _:
40
+ raise NotImplementedError(f"not implemented visibility level: {self}")
42
41
 
43
42
  def to_github_arg(self):
44
43
  # https://docs.github.com/en/rest/repos/repos?apiVersion=2026-03-10#list-repositories-for-the-authenticated-user
45
- if self is Visibility.ALL:
46
- return None
47
- if self is Visibility.PUBLIC:
48
- return "public"
49
- if self is Visibility.PRIVATE:
50
- return "private"
51
- raise NotImplementedError(f"not implemented visibility level: {self}")
44
+ match self:
45
+ case Visibility.ALL:
46
+ return None
47
+ case Visibility.PUBLIC:
48
+ return "public"
49
+ case Visibility.PRIVATE:
50
+ return "private"
51
+ case _:
52
+ raise NotImplementedError(f"not implemented visibility level: {self}")
52
53
 
53
54
  def to_gitlab_arg(self):
54
55
  # https://python-gitlab.readthedocs.io/en/stable/gl_objects/projects.html#projects
55
- if self is Visibility.ALL:
56
- return None
57
- if self is Visibility.PUBLIC:
58
- return "public"
59
- if self is Visibility.PRIVATE:
60
- return "private"
61
- raise NotImplementedError(f"not implemented visibility level: {self}")
56
+ match self:
57
+ case Visibility.ALL:
58
+ return None
59
+ case Visibility.PUBLIC:
60
+ return "public"
61
+ case Visibility.PRIVATE:
62
+ return "private"
63
+ case _:
64
+ raise NotImplementedError(f"not implemented visibility level: {self}")
62
65
 
63
66
 
64
67
  class Repo:
@@ -77,16 +77,6 @@ def try_capture(*args, **kwargs):
77
77
  return e.returncode == 0, e.output
78
78
 
79
79
 
80
- @contextmanager
81
- def chdir(new_cwd):
82
- old_cwd = os.getcwd()
83
- os.chdir(new_cwd)
84
- try:
85
- yield
86
- finally:
87
- os.chdir(old_cwd)
88
-
89
-
90
80
  @contextmanager
91
81
  def protected_file(path):
92
82
  # 0600:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cgitize
3
- Version: 8.0.4
3
+ Version: 8.0.6
4
4
  Summary: Self-host your repositories using cgit
5
5
  Author-email: Egor Tensin <egor@tensin.name>
6
6
  License-Expression: MIT
@@ -9,7 +9,7 @@ Project-URL: Bug Tracker, https://github.com/egor-tensin/cgitize/issues
9
9
  Classifier: Development Status :: 5 - Production/Stable
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Topic :: Software Development :: Version Control :: Git
12
- Requires-Python: >=3.9
12
+ Requires-Python: >=3.11
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE.txt
15
15
  Requires-Dist: atlassian-python-api~=4.0
@@ -37,7 +37,8 @@ Example output can be found at https://git.tensin.name/.
37
37
  Installation
38
38
  ------------
39
39
 
40
- pip install cgitize
40
+ * Python: [PyPI](https://pypi.org/project/cgitize/)
41
+ * Docker: see [docker/README.md](docker/README.md).
41
42
 
42
43
  Usage
43
44
  -----
@@ -55,13 +56,6 @@ access tokens/application passwords).
55
56
 
56
57
  [examples/cgitize.toml]: examples/cgitize.toml
57
58
 
58
- ### Docker
59
-
60
- You can run `cgitize` in a Docker container.
61
- A separate image includes a web server with a configured cgit installation.
62
-
63
- Please see [docker/README.md](docker/README.md) for details.
64
-
65
59
  Mirror maintenance
66
60
  ------------------
67
61
 
@@ -2,7 +2,6 @@
2
2
  .git-blame-ignore-revs
3
3
  .gitattributes
4
4
  .gitignore
5
- .pylintrc
6
5
  .python-version
7
6
  DEVELOPMENT.md
8
7
  LICENSE.txt
@@ -7,7 +7,6 @@
7
7
  ".github/workflows/ci.yml",
8
8
  ".github/workflows/maintenance.yml",
9
9
  ".gitignore",
10
- ".pylintrc",
11
10
  ".python-version",
12
11
  "DEVELOPMENT.md",
13
12
  "LICENSE.txt",
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "8.0.6",
3
+ "distance": 0,
4
+ "node": "g0ccb470486d0c01ce1f8442e4298b91c84dfc973",
5
+ "dirty": false,
6
+ "branch": "HEAD",
7
+ "node_date": "2026-10-12"
8
+ }
@@ -41,25 +41,27 @@ Compose
41
41
 
42
42
  Here's an example docker-compose.yml file:
43
43
 
44
- services:
45
- cgitize:
46
- environment:
47
- # Every 3 hours:
48
- SCHEDULE: '0 */3 * * *'
49
- # Set CGITIZE_{GITHUB,BITBUCKET,GITLAB}_{USERNAME,TOKEN} variables
50
- # here or in the config file.
51
- image: egortensin/cgitize:8
52
- restart: unless-stopped
53
- volumes:
54
- - ./example.toml:/etc/cgitize/cgitize.toml:ro
55
- - /srv/volumes/cgitize:/mnt/cgitize
56
- frontend:
57
- image: egortensin/cgitize-frontend:8
58
- ports:
59
- - '127.0.0.1:80:80'
60
- restart: unless-stopped
61
- volumes:
62
- - /srv/volumes/cgitize:/mnt/cgitize:ro
44
+ ```yaml
45
+ services:
46
+ cgitize:
47
+ environment:
48
+ # Every 3 hours:
49
+ SCHEDULE: '0 */3 * * *'
50
+ # Set CGITIZE_{GITHUB,BITBUCKET,GITLAB}_{USERNAME,TOKEN} variables
51
+ # here or in the config file.
52
+ image: egortensin/cgitize:8
53
+ restart: unless-stopped
54
+ volumes:
55
+ - ./example.toml:/etc/cgitize/cgitize.toml:ro
56
+ - /srv/volumes/cgitize:/mnt/cgitize
57
+ frontend:
58
+ image: egortensin/cgitize-frontend:8
59
+ ports:
60
+ - '127.0.0.1:80:80'
61
+ restart: unless-stopped
62
+ volumes:
63
+ - /srv/volumes/cgitize:/mnt/cgitize:ro
64
+ ```
63
65
 
64
66
  In this configuration, cgitize pulls repositories defined in example.toml every
65
67
  3 hours and puts them to /srv/volumes/cgitize on the host.
@@ -12,7 +12,8 @@ license-files = ["LICENSE.txt"]
12
12
  dynamic = ["version"]
13
13
  authors = [{name = "Egor Tensin", email = "egor@tensin.name"}]
14
14
  readme = "README.md"
15
- requires-python = ">=3.9"
15
+ requires-python = ">=3.11"
16
+ # ^^^ For enum.StrEnum/contextlib.chdir, at least?
16
17
 
17
18
  dependencies = [
18
19
  "atlassian-python-api ~= 4.0",
@@ -39,3 +40,16 @@ cgitize = "cgitize.main:main"
39
40
  packages = ["cgitize"]
40
41
 
41
42
  [tool.setuptools_scm]
43
+
44
+ [tool.pylint.main]
45
+ # Enable Pylint to be run in the venv:
46
+ init-hook = """
47
+ try: import pylint_venv
48
+ except ImportError: pass
49
+ else: pylint_venv.inithook()
50
+ """
51
+
52
+ [tool.pylint."messages control"]
53
+ disable = [
54
+ "missing-docstring",
55
+ ]
@@ -8,7 +8,7 @@ Deprecated==3.0.0
8
8
  idna==3.20
9
9
  jmespath==1.1.0
10
10
  oauthlib==4.0.0
11
- pycparser==3.0
11
+ pycparser==3.1
12
12
  PyGithub==2.10.0
13
13
  PyJWT==2.15.1
14
14
  PyNaCl==1.6.2
@@ -17,7 +17,7 @@ requests==2.34.2
17
17
  requests-oauthlib==2.0.0
18
18
  requests-toolbelt==1.0.0
19
19
  soupsieve==2.10
20
- tomli==2.4.1
20
+ tomli==2.5.0
21
21
  typing_extensions==4.16.0
22
22
  urllib3==2.8.0
23
23
  wrapt==2.5.0
cgitize-8.0.4/.pylintrc DELETED
@@ -1,14 +0,0 @@
1
- [MAIN]
2
- # Enable Pylint to be run in the venv:
3
- init-hook=
4
- try: import pylint_venv
5
- except ImportError: pass
6
- else: pylint_venv.inithook()
7
-
8
- [MESSAGES CONTROL]
9
-
10
- disable=
11
- invalid-name,
12
- missing-docstring,
13
- too-few-public-methods,
14
- too-many-arguments,
@@ -1,8 +0,0 @@
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
- }
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
File without changes
File without changes