cgitize 8.0.5__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 (71) hide show
  1. {cgitize-8.0.5 → cgitize-8.0.6}/.github/workflows/ci.yml +15 -4
  2. {cgitize-8.0.5 → cgitize-8.0.6}/PKG-INFO +2 -2
  3. {cgitize-8.0.5 → cgitize-8.0.6}/cgitize/cgit.py +1 -1
  4. {cgitize-8.0.5 → cgitize-8.0.6}/cgitize/repo.py +32 -29
  5. {cgitize-8.0.5 → cgitize-8.0.6}/cgitize/utils.py +0 -10
  6. {cgitize-8.0.5 → cgitize-8.0.6}/cgitize.egg-info/PKG-INFO +2 -2
  7. {cgitize-8.0.5 → cgitize-8.0.6}/cgitize.egg-info/scm_version.json +2 -2
  8. {cgitize-8.0.5 → cgitize-8.0.6}/pyproject.toml +2 -1
  9. {cgitize-8.0.5 → cgitize-8.0.6}/.dockerignore +0 -0
  10. {cgitize-8.0.5 → cgitize-8.0.6}/.git-blame-ignore-revs +0 -0
  11. {cgitize-8.0.5 → cgitize-8.0.6}/.gitattributes +0 -0
  12. {cgitize-8.0.5 → cgitize-8.0.6}/.github/dependabot.yml +0 -0
  13. {cgitize-8.0.5 → cgitize-8.0.6}/.github/workflows/maintenance.yml +0 -0
  14. {cgitize-8.0.5 → cgitize-8.0.6}/.gitignore +0 -0
  15. {cgitize-8.0.5 → cgitize-8.0.6}/.python-version +0 -0
  16. {cgitize-8.0.5 → cgitize-8.0.6}/DEVELOPMENT.md +0 -0
  17. {cgitize-8.0.5 → cgitize-8.0.6}/LICENSE.txt +0 -0
  18. {cgitize-8.0.5 → cgitize-8.0.6}/Makefile +0 -0
  19. {cgitize-8.0.5 → cgitize-8.0.6}/README.md +0 -0
  20. {cgitize-8.0.5 → cgitize-8.0.6}/cgitize/__init__.py +0 -0
  21. {cgitize-8.0.5 → cgitize-8.0.6}/cgitize/bitbucket.py +0 -0
  22. {cgitize-8.0.5 → cgitize-8.0.6}/cgitize/config.py +0 -0
  23. {cgitize-8.0.5 → cgitize-8.0.6}/cgitize/git.py +0 -0
  24. {cgitize-8.0.5 → cgitize-8.0.6}/cgitize/github.py +0 -0
  25. {cgitize-8.0.5 → cgitize-8.0.6}/cgitize/gitlab.py +0 -0
  26. {cgitize-8.0.5 → cgitize-8.0.6}/cgitize/header.py +0 -0
  27. {cgitize-8.0.5 → cgitize-8.0.6}/cgitize/main.py +0 -0
  28. {cgitize-8.0.5 → cgitize-8.0.6}/cgitize/url.py +0 -0
  29. {cgitize-8.0.5 → cgitize-8.0.6}/cgitize/version.py +0 -0
  30. {cgitize-8.0.5 → cgitize-8.0.6}/cgitize.egg-info/SOURCES.txt +0 -0
  31. {cgitize-8.0.5 → cgitize-8.0.6}/cgitize.egg-info/dependency_links.txt +0 -0
  32. {cgitize-8.0.5 → cgitize-8.0.6}/cgitize.egg-info/entry_points.txt +0 -0
  33. {cgitize-8.0.5 → cgitize-8.0.6}/cgitize.egg-info/requires.txt +0 -0
  34. {cgitize-8.0.5 → cgitize-8.0.6}/cgitize.egg-info/scm_file_list.json +0 -0
  35. {cgitize-8.0.5 → cgitize-8.0.6}/cgitize.egg-info/top_level.txt +0 -0
  36. {cgitize-8.0.5 → cgitize-8.0.6}/docker/Dockerfile +0 -0
  37. {cgitize-8.0.5 → cgitize-8.0.6}/docker/README.md +0 -0
  38. {cgitize-8.0.5 → cgitize-8.0.6}/docker/cgitize.sh +0 -0
  39. {cgitize-8.0.5 → cgitize-8.0.6}/docker/frontend/Dockerfile +0 -0
  40. {cgitize-8.0.5 → cgitize-8.0.6}/docker/frontend/cmd.sh +0 -0
  41. {cgitize-8.0.5 → cgitize-8.0.6}/docker/frontend/etc/cgit/common +0 -0
  42. {cgitize-8.0.5 → cgitize-8.0.6}/docker/frontend/etc/cgitrc +0 -0
  43. {cgitize-8.0.5 → cgitize-8.0.6}/docker/frontend/etc/nginx/conf.d/default.conf +0 -0
  44. {cgitize-8.0.5 → cgitize-8.0.6}/docker/frontend/usr/lib/cgit/filters/about-formatting.sh +0 -0
  45. {cgitize-8.0.5 → cgitize-8.0.6}/docker/frontend/usr/lib/cgit/filters/html-converters/.gitattributes +0 -0
  46. {cgitize-8.0.5 → cgitize-8.0.6}/docker/frontend/usr/lib/cgit/filters/html-converters/md2html +0 -0
  47. {cgitize-8.0.5 → cgitize-8.0.6}/docker/get_output_dir.py +0 -0
  48. {cgitize-8.0.5 → cgitize-8.0.6}/docker/in_cron.sh +0 -0
  49. {cgitize-8.0.5 → cgitize-8.0.6}/docker-compose.yml +0 -0
  50. {cgitize-8.0.5 → cgitize-8.0.6}/docs/api.md +0 -0
  51. {cgitize-8.0.5 → cgitize-8.0.6}/docs/auth.md +0 -0
  52. {cgitize-8.0.5 → cgitize-8.0.6}/examples/cgitize.toml +0 -0
  53. {cgitize-8.0.5 → cgitize-8.0.6}/examples/docker/cgitize.toml +0 -0
  54. {cgitize-8.0.5 → cgitize-8.0.6}/prelude.mk +0 -0
  55. {cgitize-8.0.5 → cgitize-8.0.6}/requirements.txt +0 -0
  56. {cgitize-8.0.5 → cgitize-8.0.6}/setup.cfg +0 -0
  57. {cgitize-8.0.5 → cgitize-8.0.6}/test/__init__.py +0 -0
  58. {cgitize-8.0.5 → cgitize-8.0.6}/test/integration/docker/.dockerignore +0 -0
  59. {cgitize-8.0.5 → cgitize-8.0.6}/test/integration/docker/cgitize/.gitignore +0 -0
  60. {cgitize-8.0.5 → cgitize-8.0.6}/test/integration/docker/cgitize/etc/cgitize.toml +0 -0
  61. {cgitize-8.0.5 → cgitize-8.0.6}/test/integration/docker/docker-compose.yml +0 -0
  62. {cgitize-8.0.5 → cgitize-8.0.6}/test/integration/docker/git_server/Dockerfile +0 -0
  63. {cgitize-8.0.5 → cgitize-8.0.6}/test/integration/docker/git_server/setup_repo.sh +0 -0
  64. {cgitize-8.0.5 → cgitize-8.0.6}/test/integration/docker/test.sh +0 -0
  65. {cgitize-8.0.5 → cgitize-8.0.6}/test/integration/example/test.sh +0 -0
  66. {cgitize-8.0.5 → cgitize-8.0.6}/test/integration/local/test.sh +0 -0
  67. {cgitize-8.0.5 → cgitize-8.0.6}/test/set_credentials.sh +0 -0
  68. {cgitize-8.0.5 → cgitize-8.0.6}/test/unit/__init__.py +0 -0
  69. {cgitize-8.0.5 → cgitize-8.0.6}/test/unit/test_bitbucket.py +0 -0
  70. {cgitize-8.0.5 → cgitize-8.0.6}/test/unit/test_github.py +0 -0
  71. {cgitize-8.0.5 → 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.5
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
@@ -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.5
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
@@ -1,7 +1,7 @@
1
1
  {
2
- "tag": "8.0.5",
2
+ "tag": "8.0.6",
3
3
  "distance": 0,
4
- "node": "ga96d5e0f409c764f259df0963319ae4155436f12",
4
+ "node": "g0ccb470486d0c01ce1f8442e4298b91c84dfc973",
5
5
  "dirty": false,
6
6
  "branch": "HEAD",
7
7
  "node_date": "2026-10-12"
@@ -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",
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
File without changes
File without changes
File without changes