gOdoo-cli 0.13.1__tar.gz → 0.14.0__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 (113) hide show
  1. godoo_cli-0.14.0/.codecovrc +3 -0
  2. godoo_cli-0.14.0/.devcontainer/devcontainer.json +103 -0
  3. godoo_cli-0.14.0/.env.sample +42 -0
  4. godoo_cli-0.14.0/.eslintignore +2 -0
  5. godoo_cli-0.14.0/.eslintrc.yml +187 -0
  6. godoo_cli-0.14.0/.github/FUNDING.yml +3 -0
  7. godoo_cli-0.14.0/.github/workflows/README.md +85 -0
  8. godoo_cli-0.14.0/.github/workflows/quality.yml +112 -0
  9. godoo_cli-0.14.0/.github/workflows/version-bump.yml +138 -0
  10. godoo_cli-0.14.0/.github/workflows/version-publish.yml +75 -0
  11. godoo_cli-0.14.0/.gitignore +150 -0
  12. godoo_cli-0.14.0/.pre-commit-config.yaml +65 -0
  13. godoo_cli-0.14.0/.prettierrc.yml +7 -0
  14. godoo_cli-0.14.0/.vscode/launch.json +65 -0
  15. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/PKG-INFO +60 -41
  16. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/README.md +34 -0
  17. godoo_cli-0.14.0/addons/.gitkeep +1 -0
  18. godoo_cli-0.14.0/addons/godoo_test_succ_mod/__init__.py +1 -0
  19. godoo_cli-0.14.0/addons/godoo_test_succ_mod/__manifest__.py +12 -0
  20. godoo_cli-0.14.0/addons/godoo_test_succ_mod/models/__init__.py +4 -0
  21. godoo_cli-0.14.0/addons/godoo_test_succ_mod/tests/__init__.py +1 -0
  22. godoo_cli-0.14.0/addons/godoo_test_succ_mod/tests/data.py +10 -0
  23. godoo_cli-0.14.0/addons/godoo_test_succ_mod/tests/test_succ.py +6 -0
  24. godoo_cli-0.14.0/assets/godoo-main-cli.png +0 -0
  25. godoo_cli-0.14.0/assets/odoo_logo.png +0 -0
  26. godoo_cli-0.14.0/config/nginx.conf +86 -0
  27. godoo_cli-0.14.0/config/postgresql.conf +18 -0
  28. godoo_cli-0.14.0/config/supervisord.conf +23 -0
  29. godoo_cli-0.14.0/docker/Dockerfile +207 -0
  30. godoo_cli-0.14.0/docker/cups/Dockerfile +46 -0
  31. godoo_cli-0.14.0/docker/cups/config/cups-pdf.conf +306 -0
  32. godoo_cli-0.14.0/docker/cups/config/cupsd.conf +129 -0
  33. godoo_cli-0.14.0/docker/cups/cups_entrypoint.sh +17 -0
  34. godoo_cli-0.14.0/docker/depends_build.sh +33 -0
  35. godoo_cli-0.14.0/docker/depends_runtime.sh +33 -0
  36. godoo_cli-0.14.0/docker/docker-compose.base.yml +43 -0
  37. godoo_cli-0.14.0/docker/docker-compose.devcontainer-traefik.yml +25 -0
  38. godoo_cli-0.14.0/docker/docker-compose.devcontainer.yml +26 -0
  39. godoo_cli-0.14.0/docker/docker-compose.traefik.yml +16 -0
  40. godoo_cli-0.14.0/godoo_src.code-workspace +16 -0
  41. godoo_cli-0.14.0/makefile +30 -0
  42. godoo_cli-0.14.0/odoo_manifest.yml +20 -0
  43. godoo_cli-0.14.0/pyproject.toml +208 -0
  44. godoo_cli-0.14.0/scripts/container_requirements.sh +33 -0
  45. godoo_cli-0.14.0/scripts/launchodoo.sh +58 -0
  46. godoo_cli-0.14.0/scripts/migrations/development/shrink_database.py +43 -0
  47. godoo_cli-0.14.0/scripts/reset_devcontainer.sh +120 -0
  48. godoo_cli-0.14.0/src/godoo_cli/__about__.py +11 -0
  49. godoo_cli-0.14.0/src/godoo_cli/__init__.py +13 -0
  50. godoo_cli-0.14.0/src/godoo_cli/__main__.py +10 -0
  51. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/cli.py +49 -22
  52. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/cli_common.py +56 -66
  53. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/commands/__init__.py +12 -0
  54. godoo_cli-0.14.0/src/godoo_cli/commands/backup/__init__.py +10 -0
  55. godoo_cli-0.14.0/src/godoo_cli/commands/backup/cli.py +36 -0
  56. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/commands/backup/dump.py +28 -20
  57. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/commands/backup/load.py +11 -8
  58. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/commands/backup/pull.py +94 -13
  59. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/commands/backup/util.py +20 -5
  60. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/commands/bootstrap.py +61 -52
  61. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/commands/config.py +11 -11
  62. godoo_cli-0.14.0/src/godoo_cli/commands/db/__init__.py +10 -0
  63. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/commands/db/cli.py +14 -0
  64. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/commands/db/connection.py +65 -15
  65. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/commands/db/passwords.py +17 -11
  66. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/commands/db/query.py +53 -33
  67. godoo_cli-0.14.0/src/godoo_cli/commands/launch.py +362 -0
  68. godoo_cli-0.14.0/src/godoo_cli/commands/rpc/__init__.py +19 -0
  69. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/commands/rpc/cli.py +23 -0
  70. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/commands/rpc/config_parameters.py +19 -8
  71. godoo_cli-0.14.0/src/godoo_cli/commands/rpc/importer.py +80 -0
  72. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/commands/rpc/modules.py +46 -35
  73. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/commands/rpc/translations.py +26 -18
  74. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/commands/shell/scripts/odoo_banner.py +10 -0
  75. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/commands/shell/shell.py +68 -47
  76. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/commands/source_get.py +84 -70
  77. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/commands/test/__init__.py +3 -1
  78. godoo_cli-0.14.0/src/godoo_cli/commands/test/cli.py +31 -0
  79. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/commands/test/test_load_data.py +25 -24
  80. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/commands/test/test_run.py +31 -29
  81. godoo_cli-0.14.0/src/godoo_cli/git/__init__.py +13 -0
  82. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/git/git_odoo.py +20 -0
  83. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/git/git_odoo_addons.py +13 -5
  84. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/git/git_repo.py +10 -13
  85. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/git/git_url.py +65 -22
  86. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/git/zip_download.py +8 -1
  87. godoo_cli-0.14.0/src/godoo_cli/helpers/__init__.py +1 -0
  88. godoo_cli-0.14.0/src/godoo_cli/helpers/cli.py +28 -0
  89. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/helpers/modules.py +49 -23
  90. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/helpers/modules_git.py +2 -1
  91. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/helpers/modules_py.py +12 -4
  92. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/helpers/odoo_files.py +5 -3
  93. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/helpers/odoo_manifest.py +19 -9
  94. godoo_cli-0.14.0/src/godoo_cli/helpers/pip.py +82 -0
  95. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/src/godoo_cli/helpers/system.py +10 -87
  96. godoo_cli-0.14.0/src/tests/test_git_clone.py +29 -0
  97. godoo_cli-0.14.0/thirdparty/.gitkeep +2 -0
  98. godoo_cli-0.14.0/uv.lock +2212 -0
  99. godoo_cli-0.13.1/pyproject.toml +0 -170
  100. godoo_cli-0.13.1/src/godoo_cli/__init__.py +0 -2
  101. godoo_cli-0.13.1/src/godoo_cli/__main__.py +0 -5
  102. godoo_cli-0.13.1/src/godoo_cli/commands/backup/__init__.py +0 -1
  103. godoo_cli-0.13.1/src/godoo_cli/commands/backup/cli.py +0 -19
  104. godoo_cli-0.13.1/src/godoo_cli/commands/db/__init__.py +0 -1
  105. godoo_cli-0.13.1/src/godoo_cli/commands/launch.py +0 -328
  106. godoo_cli-0.13.1/src/godoo_cli/commands/rpc/__init__.py +0 -8
  107. godoo_cli-0.13.1/src/godoo_cli/commands/rpc/importer.py +0 -70
  108. godoo_cli-0.13.1/src/godoo_cli/commands/test/cli.py +0 -16
  109. godoo_cli-0.13.1/src/godoo_cli/git/__init__.py +0 -4
  110. godoo_cli-0.13.1/src/godoo_cli/helpers/__init__.py +0 -1
  111. godoo_cli-0.13.1/src/godoo_cli/helpers/cli.py +0 -15
  112. godoo_cli-0.13.1/src/godoo_cli/version.py +0 -1
  113. {godoo_cli-0.13.1 → godoo_cli-0.14.0}/LICENSE +0 -0
@@ -0,0 +1,3 @@
1
+ [run]
2
+ omit =
3
+ test_*.py
@@ -0,0 +1,103 @@
1
+ {
2
+ "workspaceFolder": "/odoo/godoo_workspace",
3
+ // Container Settings
4
+ "dockerComposeFile": [
5
+ "../docker/docker-compose.base.yml",
6
+ "../docker/docker-compose.traefik.yml",
7
+ "../docker/docker-compose.devcontainer.yml",
8
+ "../docker/docker-compose.devcontainer-traefik.yml"
9
+ ],
10
+ "service": "app",
11
+ "shutdownAction": "stopCompose",
12
+ "remoteUser": "ContainerUser",
13
+ "initializeCommand": "./scripts/container_requirements.sh",
14
+ "postCreateCommand": "pre-commit install --install-hooks && echo '####################################################\nPost Create Done'",
15
+ "remoteEnv": {
16
+ "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}/" // For Docker compose workspace bindmount
17
+ },
18
+ "customizations": {
19
+ "vscode": {
20
+ "extensions": [
21
+ // Python:
22
+ "ms-python.python",
23
+ "ms-python.pylint",
24
+ "charliermarsh.ruff",
25
+ "oderwat.indent-rainbow",
26
+ "njpwerner.autodocstring",
27
+ // Database:
28
+ "mtxr.sqltools",
29
+ "mtxr.sqltools-driver-pg",
30
+ // Odoo:
31
+ "jigar-patel.odoosnippets",
32
+ "trinhanhngoc.vscode-odoo",
33
+ "Odoo.owl-vision",
34
+ // Git Tools:
35
+ "eamodio.gitlens",
36
+ "mhutchie.git-graph",
37
+ "github.vscode-github-actions",
38
+ // XML:
39
+ "redhat.vscode-xml",
40
+ "formulahendry.auto-close-tag",
41
+ // CSV:
42
+ "mechatroner.rainbow-csv",
43
+ "janisdd.vscode-edit-csv",
44
+ // Misc:
45
+ "tamasfe.even-better-toml",
46
+ "gruntfuggly.todo-tree",
47
+ "naumovs.color-highlight",
48
+ "esbenp.prettier-vscode",
49
+ "yzhang.markdown-all-in-one",
50
+ "alefragnani.Bookmarks",
51
+ "stackbreak.comment-divider",
52
+ "tomoki1207.pdf",
53
+ "seatonjiang.gitmoji-vscode",
54
+ "bierner.markdown-mermaid",
55
+ // Copilot:
56
+ "github.copilot",
57
+ "github.copilot-chat"
58
+ ],
59
+ "settings": {
60
+ // General Settings:
61
+ "files.insertFinalNewline": true,
62
+ "editor.formatOnSave": true,
63
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
64
+ "terminal.integrated.scrollback": 10000,
65
+ // Python Settings:
66
+ "python.pythonPath": "/odoo/venv/bin/python",
67
+ "python.defaultInterpreterPath": "/odoo/venv/bin/python",
68
+ "python.languageServer": "None", // Disable because of Odoo IDE Extension
69
+ "[python]": {
70
+ "editor.defaultFormatter": "charliermarsh.ruff",
71
+ "editor.codeActionsOnSave": {
72
+ "source.fixAll": "explicit",
73
+ "source.organizeImports": "explicit"
74
+ }
75
+ },
76
+ // XML Settings:
77
+ "xml.format.preserveAttributeLineBreaks": false,
78
+ "xml.format.joinCommentLines": false,
79
+ "xml.format.maxLineWidth": 0,
80
+ "[xml]": {
81
+ "editor.defaultFormatter": "redhat.vscode-xml"
82
+ },
83
+ // SQL Tools with Connection to db devcontainer:
84
+ "sqltools.connections": [
85
+ {
86
+ "name": "OdooDB",
87
+ "driver": "PostgreSQL",
88
+ "server": "db",
89
+ "port": 5432,
90
+ "database": "odoo",
91
+ "username": "odoo_user",
92
+ "password": "odoo"
93
+ }
94
+ ],
95
+ "sqltools.autoOpenSessionFiles": false,
96
+ "sqltools.highlightQuery": true,
97
+ // Misc Addons Settings:
98
+ "todo-tree.general.tags": ["BUG", "HACK", "FIXME", "TODO", "XXX", "[ ]", "[x]", "V16"],
99
+ "bookmarks.sideBar.expanded": true
100
+ }
101
+ }
102
+ }
103
+ }
@@ -0,0 +1,42 @@
1
+ # ---------------------------------------------------
2
+ # Docker Options
3
+ WORKSPACE_IS_DEV=true # Unlock Make Reset
4
+ TZ="Europe/Berlin"
5
+ COMPOSE_FILE=docker-compose.base.yml:docker-compose.traefik.yml
6
+
7
+ # Webserver Config:
8
+ TRAEFIK_HOST_REGEX='godoo\.(docker\.localhost|jk\.otherdomain\.local)'
9
+
10
+ # ---------------------------------------------------
11
+ # Banner configuration that gets set on Make Stg using OdooRPC.
12
+ #ODOO_BANNER_BG_COLOR='rgba(250, 132, 38,.6)''
13
+ #ODOO_BANNER_TEXT="Development 1"
14
+
15
+ # ---------------------------------------------------
16
+ # Which modules not to test on "godoo test all".
17
+ # oca stock_picking_invoicing has demo data incompatability with MRP.
18
+ # ODOO_TEST_SKIP_MODULES="addon_name,addon_name"
19
+
20
+ # ---------------------------------------------------
21
+ # Godoo RPC Connection Values. (Login data for Odoo)
22
+ ODOO_RPC_HOST=http://localhost:8069
23
+ ODOO_RPC_USER=admin
24
+ ODOO_RPC_PASSWORD=admin
25
+
26
+ # ---------------------------------------------------
27
+ # Paths (Optional):
28
+ # ODOO_MAIN_FOLDER=/odoo/odoo
29
+ # ODOO_MANIFEST=ODOO_MANIFEST.yml
30
+ # ODOO_CONF_PATH=config/odoo.conf
31
+ # ODOO_WORKSPACE_ADDON_LOCATION=addons
32
+ # ODOO_THIRDPARTY_LOCATION=/odoo/thirdparty
33
+ # ODOO_THIRDPARTY_ZIP_LOCATION=./thirdparty
34
+
35
+ # ---------------------------------------------------
36
+ # Database:
37
+ ODOO_MAIN_DB=odoo
38
+ ODOO_DB_FILTER=odoo
39
+ ODOO_DB_PASSWORD=odoo
40
+ ODOO_DB_USER=odoo_user
41
+ ODOO_DB_HOST=db
42
+ ODOO_DB_PORT=5432
@@ -0,0 +1,2 @@
1
+ **/lib/**/*.js
2
+ **/vendor/**/*.js
@@ -0,0 +1,187 @@
1
+ env:
2
+ browser: true
3
+ es6: true
4
+
5
+ # See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449
6
+ parserOptions:
7
+ ecmaVersion: 2019
8
+
9
+ overrides:
10
+ - files:
11
+ - "**/*.esm.js"
12
+ parserOptions:
13
+ sourceType: module
14
+
15
+ # Globals available in Odoo that shouldn't produce errorings
16
+ globals:
17
+ _: readonly
18
+ $: readonly
19
+ fuzzy: readonly
20
+ jQuery: readonly
21
+ moment: readonly
22
+ odoo: readonly
23
+ openerp: readonly
24
+ owl: readonly
25
+
26
+ # Styling is handled by Prettier, so we only need to enable AST rules;
27
+ # see https://github.com/OCA/maintainer-quality-tools/pull/618#issuecomment-558576890
28
+ rules:
29
+ accessor-pairs: warn
30
+ array-callback-return: warn
31
+ callback-return: warn
32
+ capitalized-comments:
33
+ - warn
34
+ - always
35
+ - ignoreConsecutiveComments: true
36
+ ignoreInlineComments: true
37
+ complexity:
38
+ - warn
39
+ - 15
40
+ constructor-super: warn
41
+ dot-notation: warn
42
+ eqeqeq: warn
43
+ global-require: warn
44
+ handle-callback-err: warn
45
+ id-blacklist: warn
46
+ id-match: warn
47
+ init-declarations: error
48
+ max-depth: warn
49
+ max-nested-callbacks: warn
50
+ max-statements-per-line: warn
51
+ no-alert: warn
52
+ no-array-constructor: warn
53
+ no-caller: warn
54
+ no-case-declarations: warn
55
+ no-class-assign: warn
56
+ no-cond-assign: error
57
+ no-const-assign: error
58
+ no-constant-condition: warn
59
+ no-control-regex: warn
60
+ no-debugger: error
61
+ no-delete-var: warn
62
+ no-div-regex: warn
63
+ no-dupe-args: error
64
+ no-dupe-class-members: error
65
+ no-dupe-keys: error
66
+ no-duplicate-case: error
67
+ no-duplicate-imports: error
68
+ no-else-return: warn
69
+ no-empty-character-class: warn
70
+ no-empty-function: error
71
+ no-empty-pattern: error
72
+ no-empty: warn
73
+ no-eq-null: error
74
+ no-eval: error
75
+ no-ex-assign: error
76
+ no-extend-native: warn
77
+ no-extra-bind: warn
78
+ no-extra-boolean-cast: warn
79
+ no-extra-label: warn
80
+ no-fallthrough: warn
81
+ no-func-assign: error
82
+ no-global-assign: error
83
+ no-implicit-coercion:
84
+ - warn
85
+ - allow: ["~"]
86
+ no-implicit-globals: warn
87
+ no-implied-eval: warn
88
+ no-inline-comments: warn
89
+ no-inner-declarations: warn
90
+ no-invalid-regexp: warn
91
+ no-irregular-whitespace: warn
92
+ no-iterator: warn
93
+ no-label-var: warn
94
+ no-labels: warn
95
+ no-lone-blocks: warn
96
+ no-lonely-if: error
97
+ no-mixed-requires: error
98
+ no-multi-str: warn
99
+ no-native-reassign: error
100
+ no-negated-condition: warn
101
+ no-negated-in-lhs: error
102
+ no-new-func: warn
103
+ no-new-object: warn
104
+ no-new-require: warn
105
+ no-new-symbol: warn
106
+ no-new-wrappers: warn
107
+ no-new: warn
108
+ no-obj-calls: warn
109
+ no-octal-escape: warn
110
+ no-octal: warn
111
+ no-param-reassign: warn
112
+ no-path-concat: warn
113
+ no-process-env: warn
114
+ no-process-exit: warn
115
+ no-proto: warn
116
+ no-prototype-builtins: warn
117
+ no-redeclare: warn
118
+ no-regex-spaces: warn
119
+ no-restricted-globals: warn
120
+ no-restricted-imports: warn
121
+ no-restricted-modules: warn
122
+ no-restricted-syntax: warn
123
+ no-return-assign: error
124
+ no-script-url: warn
125
+ no-self-assign: warn
126
+ no-self-compare: warn
127
+ no-sequences: warn
128
+ no-shadow-restricted-names: warn
129
+ no-shadow: warn
130
+ no-sparse-arrays: warn
131
+ no-sync: warn
132
+ no-this-before-super: warn
133
+ no-throw-literal: warn
134
+ no-undef-init: warn
135
+ no-undef: error
136
+ no-unmodified-loop-condition: warn
137
+ no-unneeded-ternary: error
138
+ no-unreachable: error
139
+ no-unsafe-finally: error
140
+ no-unused-expressions: error
141
+ no-unused-labels: error
142
+ no-unused-vars: error
143
+ no-use-before-define: error
144
+ no-useless-call: warn
145
+ no-useless-computed-key: warn
146
+ no-useless-concat: warn
147
+ no-useless-constructor: warn
148
+ no-useless-escape: warn
149
+ no-useless-rename: warn
150
+ no-void: warn
151
+ no-with: warn
152
+ operator-assignment: [error, always]
153
+ prefer-const: warn
154
+ radix: warn
155
+ require-yield: warn
156
+ sort-imports: warn
157
+ spaced-comment: [error, always]
158
+ strict: [error, function]
159
+ use-isnan: error
160
+ valid-jsdoc:
161
+ - warn
162
+ - prefer:
163
+ arg: param
164
+ argument: param
165
+ augments: extends
166
+ constructor: class
167
+ exception: throws
168
+ func: function
169
+ method: function
170
+ prop: property
171
+ return: returns
172
+ virtual: abstract
173
+ yield: yields
174
+ preferType:
175
+ array: Array
176
+ bool: Boolean
177
+ boolean: Boolean
178
+ number: Number
179
+ object: Object
180
+ str: String
181
+ string: String
182
+ requireParamDescription: false
183
+ requireReturn: false
184
+ requireReturnDescription: false
185
+ requireReturnType: false
186
+ valid-typeof: warn
187
+ yoda: warn
@@ -0,0 +1,3 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: joshkreud
@@ -0,0 +1,85 @@
1
+ # 🔄 GitHub Workflows
2
+
3
+ This directory contains the GitHub Actions workflows for the gOdoo project.
4
+
5
+ ## 📊 Workflow Overview
6
+
7
+ ```mermaid
8
+ flowchart LR
9
+ A[PR/Push] -->|Triggers| B[quality.yml]
10
+ C[Manual Trigger] -->|Triggers| D[version-bump.yml]
11
+ D -->|Creates| E[Release PR]
12
+ E -->|Triggers| B
13
+ E -->|When Merged| F[version-publish.yml]
14
+ F -->|Creates| G[Tag & Release]
15
+ F -->|Publishes| H[PyPI Package]
16
+ ```
17
+
18
+ ## 📋 Workflow Details
19
+
20
+ ### ✅ quality.yml
21
+ - **Triggers**: PR events, push to main, manual dispatch
22
+ - **Actions**:
23
+ - Runs on Python 3.9, 3.11, and 3.12 matrix
24
+ - Executes formatter and linters with Hatch
25
+ - Runs tests with coverage reporting to Codecov
26
+ - Builds Docker image on main branch pushes
27
+ - Uses BuildX caching for efficient Docker builds
28
+
29
+ ### 🔢 version-bump.yml
30
+ - **Trigger**: Manual workflow dispatch
31
+ - **Inputs**: patch, minor, major, alpha, beta, rc
32
+ - **Actions**:
33
+ - Gets current version using Hatch
34
+ - Bumps version according to input type
35
+ - Creates release branch
36
+ - Generates commit history as release notes
37
+ - Opens PR with release notes and proper labels
38
+
39
+ ### 📦 version-publish.yml
40
+ - **Trigger**: Merged PR with 'release' label
41
+ - **Actions**:
42
+ - Verifies proper merge state
43
+ - Creates Git tag with version from Hatch
44
+ - Creates GitHub release (prerelease for alpha/beta/rc)
45
+ - Builds package with Hatch
46
+ - Publishes to PyPI using token authentication
47
+
48
+ ## 🔧 Implementation Details
49
+
50
+ ### Python Environment
51
+ - Uses `actions/setup-python@v5` with Hatch for dependency management
52
+ - Handles version bumping through Hatch's versioning tools
53
+ - Runs quality checks in consistent environments
54
+
55
+ ### Docker Building
56
+ - Uses Docker BuildX with layer caching
57
+ - Publishes to GitHub Container Registry
58
+ - Optimized cache handling to speed up builds
59
+
60
+ ### CI Optimizations
61
+ - Concurrency controls to cancel redundant workflow runs
62
+ - Shallow clones when appropriate
63
+ - Strategic caching of dependencies and build artifacts
64
+
65
+ ## 📝 Automated Processes
66
+
67
+ ```mermaid
68
+ flowchart TD
69
+ A[Manual Trigger] -->|version-bump.yml| B[Create Release Branch]
70
+ B --> C[Bump Version in Package]
71
+ C --> D[Extract Changes from Git Log]
72
+ D --> E[Create PR with Release Notes]
73
+ E --> F[Quality Checks Run]
74
+ F --> G[PR Review and Merge]
75
+ G -->|version-publish.yml| H[Create Git Tag]
76
+ H --> I[Create GitHub Release]
77
+ I --> J[Publish to PyPI]
78
+ ```
79
+
80
+ ## 🔑 Key Points
81
+ - ✅ Quality checks run automatically on every PR and push to main
82
+ - 🔖 Version bumping requires manual trigger by maintainers
83
+ - 🚀 Release publishing is automated after PR merge
84
+ - 🔒 Secure token handling for PyPI publishing
85
+ - 🐳 Docker images use multi-stage builds for optimization
@@ -0,0 +1,112 @@
1
+ name: Quality
2
+
3
+ concurrency:
4
+ # Cancel any running workflow for the same PR/branch
5
+ group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
6
+ cancel-in-progress: true
7
+
8
+ on:
9
+ workflow_dispatch:
10
+ push:
11
+ branches:
12
+ - main
13
+ pull_request:
14
+ types: [opened, synchronize, ready_for_review, auto_merge_enabled]
15
+
16
+ env:
17
+ PYTHON_VERSION: "3.9"
18
+ REGISTRY: ghcr.io
19
+ IMAGE_NAME: "${{ github.repository }}"
20
+
21
+ jobs:
22
+ QualityChecks:
23
+ runs-on: ubuntu-latest
24
+ strategy:
25
+ matrix:
26
+ python-version: ["3.9", "3.11", "3.12"]
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+
30
+ - name: Install UV
31
+ uses: astral-sh/setup-uv@v2
32
+ with:
33
+ enable-cache: true
34
+ cache-dependency-glob: "pyproject.toml"
35
+
36
+ - name: Set up Python ${{ matrix.python-version }}
37
+ run: uv python install ${{ matrix.python-version }}
38
+
39
+ - name: Install Project Dependencies
40
+ run: uv sync --all-extras
41
+
42
+ - name: Run Quality Checks
43
+ run: uv run hatch run dev:ci
44
+
45
+ - name: Upload Coverage
46
+ uses: codecov/codecov-action@v5
47
+ if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
48
+ with:
49
+ files: ./coverage.xml
50
+ fail_ci_if_error: true
51
+ token: ${{ secrets.CODECOV_TOKEN }}
52
+
53
+ - name: Upload test results to Codecov
54
+ if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
55
+ uses: codecov/test-results-action@v1
56
+ with:
57
+ token: ${{ secrets.CODECOV_TOKEN }}
58
+
59
+ docker-build:
60
+ runs-on: ubuntu-latest
61
+ needs: QualityChecks
62
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
63
+
64
+ permissions:
65
+ contents: read
66
+ packages: write
67
+
68
+ steps:
69
+ - uses: actions/checkout@v4
70
+ with:
71
+ fetch-depth: 1 # Shallow clone sufficient for build
72
+
73
+ - name: Set up Docker Buildx
74
+ uses: docker/setup-buildx-action@v3
75
+
76
+ - name: Cache Docker layers
77
+ uses: actions/cache@v4
78
+ with:
79
+ path: /tmp/.buildx-cache
80
+ key: ${{ runner.os }}-buildx-${{ github.sha }}
81
+ restore-keys: |
82
+ ${{ runner.os }}-buildx-
83
+
84
+ - name: Login to Container registry
85
+ uses: docker/login-action@v3
86
+ with:
87
+ registry: ${{ env.REGISTRY }}
88
+ username: ${{ github.actor }}
89
+ password: ${{ secrets.GITHUB_TOKEN }}
90
+
91
+ - name: Extract Docker metadata
92
+ id: meta
93
+ uses: docker/metadata-action@v4
94
+ with:
95
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
96
+
97
+ - name: Build and push Docker image
98
+ uses: docker/build-push-action@v6
99
+ with:
100
+ context: .
101
+ file: "./docker/Dockerfile"
102
+ platforms: "linux/amd64"
103
+ push: true
104
+ tags: ${{ steps.meta.outputs.tags }}
105
+ labels: ${{ steps.meta.outputs.labels }}
106
+ cache-from: type=local,src=/tmp/.buildx-cache
107
+ cache-to: type=local,dest=/tmp/.buildx-cache-new
108
+
109
+ - name: Move cache
110
+ run: |
111
+ rm -rf /tmp/.buildx-cache
112
+ mv /tmp/.buildx-cache-new /tmp/.buildx-cache
@@ -0,0 +1,138 @@
1
+ name: Version Bump
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ bump_type:
7
+ description: "Version bump type"
8
+ required: true
9
+ type: choice
10
+ options:
11
+ - patch
12
+ - minor
13
+ - major
14
+ - rc
15
+ - beta
16
+ - alpha
17
+
18
+ permissions:
19
+ contents: write
20
+ pull-requests: write
21
+
22
+ jobs:
23
+ create-bump-pr:
24
+ name: Create Version Bump PR
25
+ runs-on: ubuntu-latest
26
+ env:
27
+ REPO_URL: ${{ github.server_url }}/${{ github.repository }}
28
+ PYTHON_VERSION: "3.12"
29
+
30
+ steps:
31
+ - uses: actions/checkout@v4
32
+ with:
33
+ fetch-depth: 0
34
+ ref: main
35
+
36
+ - name: Set up Python
37
+ uses: actions/setup-python@v5
38
+ with:
39
+ python-version: ${{ env.PYTHON_VERSION }}
40
+
41
+ - name: Install Hatch
42
+ uses: pypa/hatch@install
43
+
44
+ - name: Initialize Version Info
45
+ id: version_info
46
+ run: |
47
+ # Get current version
48
+ CURRENT_VERSION=$(hatch version)
49
+ echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_OUTPUT
50
+
51
+ - name: Setup Git
52
+ run: |
53
+ git config user.name "github-actions[bot]"
54
+ git config user.email "github-actions[bot]@users.noreply.github.com"
55
+
56
+ - name: Bump Version and Push
57
+ id: bump_version
58
+ run: |
59
+ # Get new version number first
60
+ hatch version ${{ inputs.bump_type }}
61
+ NEW_VERSION=$(hatch version)
62
+ echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_OUTPUT
63
+
64
+ # Create release branch with new version
65
+ RELEASE_BRANCH="release/${NEW_VERSION}"
66
+ echo "RELEASE_BRANCH=$RELEASE_BRANCH" >> $GITHUB_ENV
67
+ git checkout -b "$RELEASE_BRANCH"
68
+
69
+ # Commit and push the changes
70
+ git add -A
71
+ git commit -m "🔖 Bump version ${{ steps.version_info.outputs.CURRENT_VERSION }} → $NEW_VERSION"
72
+ git push --force origin "$RELEASE_BRANCH"
73
+
74
+ - name: Generate Release Notes
75
+ id: changelog
76
+ env:
77
+ NEW_VERSION: ${{ steps.bump_version.outputs.NEW_VERSION }}
78
+ CURRENT_VERSION: ${{ steps.version_info.outputs.CURRENT_VERSION }}
79
+ run: |
80
+ # Function to get commit history
81
+ get_commit_history() {
82
+ local range="$1"
83
+ git log --pretty=format:"- [%s]($REPO_URL/commit/%H)" --no-merges "$range" --invert-grep --grep="Bump version" || echo "No commits found"
84
+ }
85
+
86
+ # Get the last version tag
87
+ LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
88
+
89
+ # Start generating release notes
90
+ {
91
+ echo "CONTENT<<EOF"
92
+ echo "# 🔖 New Release: $NEW_VERSION"
93
+
94
+ if [ -z "$LAST_TAG" ]; then
95
+ echo "Previous version: None (First Release)"
96
+ COMMITS=$(get_commit_history "HEAD^..HEAD")
97
+ else
98
+ echo "Previous version: [$LAST_TAG]($REPO_URL/releases/tag/$LAST_TAG)"
99
+ COMMITS=$(get_commit_history "$LAST_TAG..HEAD")
100
+ fi
101
+
102
+ echo
103
+ echo "## 📝 Summary"
104
+ echo
105
+ echo "<if this is here i was lazy>"
106
+ echo
107
+ echo "## 📝 What's new?"
108
+ echo
109
+ echo "$COMMITS"
110
+ echo
111
+ echo "EOF"
112
+ } >> $GITHUB_OUTPUT
113
+
114
+ - name: Create Pull Request
115
+ uses: actions/github-script@v7
116
+ with:
117
+ script: |
118
+ const { repo, owner } = context.repo;
119
+ const result = await github.rest.pulls.create({
120
+ owner,
121
+ repo,
122
+ head: process.env.RELEASE_BRANCH,
123
+ base: 'main',
124
+ title: `🔖 Release ${process.env.NEW_VERSION}`,
125
+ body: process.env.CONTENT,
126
+ maintainer_can_modify: true
127
+ });
128
+
129
+ // Add labels to the PR
130
+ await github.rest.issues.addLabels({
131
+ owner,
132
+ repo,
133
+ issue_number: result.data.number,
134
+ labels: ['release', 'automated pr']
135
+ });
136
+ env:
137
+ NEW_VERSION: ${{ steps.bump_version.outputs.NEW_VERSION }}
138
+ CONTENT: ${{ steps.changelog.outputs.CONTENT }}