mangono-odoo-clevercloud 1.0.2__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.
- mangono_odoo_clevercloud-1.0.2/.gitignore +242 -0
- mangono_odoo_clevercloud-1.0.2/.gitlab-ci.yml +94 -0
- mangono_odoo_clevercloud-1.0.2/.idea/.gitignore +8 -0
- mangono_odoo_clevercloud-1.0.2/.idea/inspectionProfiles/Project_Default.xml +16 -0
- mangono_odoo_clevercloud-1.0.2/.idea/inspectionProfiles/profiles_settings.xml +6 -0
- mangono_odoo_clevercloud-1.0.2/.idea/misc.xml +7 -0
- mangono_odoo_clevercloud-1.0.2/.idea/modules.xml +8 -0
- mangono_odoo_clevercloud-1.0.2/.idea/odoo-clevercloud.iml +15 -0
- mangono_odoo_clevercloud-1.0.2/.idea/ruff.xml +6 -0
- mangono_odoo_clevercloud-1.0.2/.idea/vcs.xml +7 -0
- mangono_odoo_clevercloud-1.0.2/.pre-commit-config.yaml +21 -0
- mangono_odoo_clevercloud-1.0.2/PKG-INFO +26 -0
- mangono_odoo_clevercloud-1.0.2/README.md +3 -0
- mangono_odoo_clevercloud-1.0.2/pyproject.toml +45 -0
- mangono_odoo_clevercloud-1.0.2/ruff.toml +22 -0
- mangono_odoo_clevercloud-1.0.2/src/mangono_odoo_clevercloud/__init__.py +0 -0
- mangono_odoo_clevercloud-1.0.2/src/mangono_odoo_clevercloud/extensions/__init__.py +0 -0
- mangono_odoo_clevercloud-1.0.2/src/mangono_odoo_clevercloud/extensions/cc_auto_config.py +33 -0
- mangono_odoo_clevercloud-1.0.2/src/mangono_odoo_clevercloud/mappers/__init__.py +0 -0
- mangono_odoo_clevercloud-1.0.2/src/mangono_odoo_clevercloud/mappers/cc_postgresql.py +24 -0
- mangono_odoo_clevercloud-1.0.2/tests/__init__.py +0 -0
- mangono_odoo_clevercloud-1.0.2/tests/test_autoconfig.py +73 -0
- mangono_odoo_clevercloud-1.0.2/tests/test_db_clever.env +5 -0
- mangono_odoo_clevercloud-1.0.2/tests/test_db_clever_direct.env +2 -0
- mangono_odoo_clevercloud-1.0.2/tests/test_mapper_clever_cloud_postgres.py +333 -0
- mangono_odoo_clevercloud-1.0.2/tests/test_mapper_ep.py +35 -0
- mangono_odoo_clevercloud-1.0.2/uv.lock +755 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
### JetBrains template
|
|
2
|
+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
|
|
3
|
+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
|
4
|
+
|
|
5
|
+
# User-specific stuff
|
|
6
|
+
.idea/**/workspace.xml
|
|
7
|
+
.idea/**/tasks.xml
|
|
8
|
+
.idea/**/usage.statistics.xml
|
|
9
|
+
.idea/**/dictionaries
|
|
10
|
+
.idea/**/shelf
|
|
11
|
+
|
|
12
|
+
# AWS User-specific
|
|
13
|
+
.idea/**/aws.xml
|
|
14
|
+
|
|
15
|
+
# Generated files
|
|
16
|
+
.idea/**/contentModel.xml
|
|
17
|
+
|
|
18
|
+
# Sensitive or high-churn files
|
|
19
|
+
.idea/**/dataSources/
|
|
20
|
+
.idea/**/dataSources.ids
|
|
21
|
+
.idea/**/dataSources.local.xml
|
|
22
|
+
.idea/**/sqlDataSources.xml
|
|
23
|
+
.idea/**/dynamic.xml
|
|
24
|
+
.idea/**/uiDesigner.xml
|
|
25
|
+
.idea/**/dbnavigator.xml
|
|
26
|
+
|
|
27
|
+
# Gradle
|
|
28
|
+
.idea/**/gradle.xml
|
|
29
|
+
.idea/**/libraries
|
|
30
|
+
|
|
31
|
+
# Gradle and Maven with auto-import
|
|
32
|
+
# When using Gradle or Maven with auto-import, you should exclude module files,
|
|
33
|
+
# since they will be recreated, and may cause churn. Uncomment if using
|
|
34
|
+
# auto-import.
|
|
35
|
+
# .idea/artifacts
|
|
36
|
+
# .idea/compiler.xml
|
|
37
|
+
# .idea/jarRepositories.xml
|
|
38
|
+
# .idea/modules.xml
|
|
39
|
+
# .idea/*.iml
|
|
40
|
+
# .idea/modules
|
|
41
|
+
# *.iml
|
|
42
|
+
# *.ipr
|
|
43
|
+
|
|
44
|
+
# CMake
|
|
45
|
+
cmake-build-*/
|
|
46
|
+
|
|
47
|
+
# Mongo Explorer plugin
|
|
48
|
+
.idea/**/mongoSettings.xml
|
|
49
|
+
|
|
50
|
+
# File-based project format
|
|
51
|
+
*.iws
|
|
52
|
+
|
|
53
|
+
# IntelliJ
|
|
54
|
+
out/
|
|
55
|
+
|
|
56
|
+
# mpeltonen/sbt-idea plugin
|
|
57
|
+
.idea_modules/
|
|
58
|
+
|
|
59
|
+
# JIRA plugin
|
|
60
|
+
atlassian-ide-plugin.xml
|
|
61
|
+
|
|
62
|
+
# Cursive Clojure plugin
|
|
63
|
+
.idea/replstate.xml
|
|
64
|
+
|
|
65
|
+
# SonarLint plugin
|
|
66
|
+
.idea/sonarlint/
|
|
67
|
+
|
|
68
|
+
# Crashlytics plugin (for Android Studio and IntelliJ)
|
|
69
|
+
com_crashlytics_export_strings.xml
|
|
70
|
+
crashlytics.properties
|
|
71
|
+
crashlytics-build.properties
|
|
72
|
+
fabric.properties
|
|
73
|
+
|
|
74
|
+
# Editor-based Rest Client
|
|
75
|
+
.idea/httpRequests
|
|
76
|
+
|
|
77
|
+
# Android studio 3.1+ serialized cache file
|
|
78
|
+
.idea/caches/build_file_checksums.ser
|
|
79
|
+
|
|
80
|
+
### Python template
|
|
81
|
+
# Byte-compiled / optimized / DLL files
|
|
82
|
+
__pycache__/
|
|
83
|
+
*.py[cod]
|
|
84
|
+
*$py.class
|
|
85
|
+
|
|
86
|
+
# C extensions
|
|
87
|
+
*.so
|
|
88
|
+
|
|
89
|
+
# Distribution / packaging
|
|
90
|
+
.Python
|
|
91
|
+
build/
|
|
92
|
+
develop-eggs/
|
|
93
|
+
dist/
|
|
94
|
+
downloads/
|
|
95
|
+
eggs/
|
|
96
|
+
.eggs/
|
|
97
|
+
lib/
|
|
98
|
+
lib64/
|
|
99
|
+
parts/
|
|
100
|
+
sdist/
|
|
101
|
+
var/
|
|
102
|
+
wheels/
|
|
103
|
+
share/python-wheels/
|
|
104
|
+
*.egg-info/
|
|
105
|
+
.installed.cfg
|
|
106
|
+
*.egg
|
|
107
|
+
MANIFEST
|
|
108
|
+
|
|
109
|
+
# PyInstaller
|
|
110
|
+
# Usually these files are written by a python script from a template
|
|
111
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
112
|
+
*.manifest
|
|
113
|
+
*.spec
|
|
114
|
+
|
|
115
|
+
# Installer logs
|
|
116
|
+
pip-log.txt
|
|
117
|
+
pip-delete-this-directory.txt
|
|
118
|
+
|
|
119
|
+
# Unit test / coverage reports
|
|
120
|
+
htmlcov/
|
|
121
|
+
.tox/
|
|
122
|
+
.nox/
|
|
123
|
+
.coverage
|
|
124
|
+
.coverage.*
|
|
125
|
+
.cache
|
|
126
|
+
nosetests.xml
|
|
127
|
+
coverage.xml
|
|
128
|
+
*.cover
|
|
129
|
+
*.py,cover
|
|
130
|
+
.hypothesis/
|
|
131
|
+
.pytest_cache/
|
|
132
|
+
cover/
|
|
133
|
+
|
|
134
|
+
# Translations
|
|
135
|
+
*.mo
|
|
136
|
+
*.pot
|
|
137
|
+
|
|
138
|
+
# Django stuff:
|
|
139
|
+
*.log
|
|
140
|
+
local_settings.py
|
|
141
|
+
db.sqlite3
|
|
142
|
+
db.sqlite3-journal
|
|
143
|
+
|
|
144
|
+
# Flask stuff:
|
|
145
|
+
instance/
|
|
146
|
+
.webassets-cache
|
|
147
|
+
|
|
148
|
+
# Scrapy stuff:
|
|
149
|
+
.scrapy
|
|
150
|
+
|
|
151
|
+
# Sphinx documentation
|
|
152
|
+
docs/_build/
|
|
153
|
+
|
|
154
|
+
# PyBuilder
|
|
155
|
+
.pybuilder/
|
|
156
|
+
target/
|
|
157
|
+
|
|
158
|
+
# Jupyter Notebook
|
|
159
|
+
.ipynb_checkpoints
|
|
160
|
+
|
|
161
|
+
# IPython
|
|
162
|
+
profile_default/
|
|
163
|
+
ipython_config.py
|
|
164
|
+
|
|
165
|
+
# pyenv
|
|
166
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
167
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
168
|
+
# .python-version
|
|
169
|
+
|
|
170
|
+
# pipenv
|
|
171
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
172
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
173
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
174
|
+
# install all needed dependencies.
|
|
175
|
+
#Pipfile.lock
|
|
176
|
+
|
|
177
|
+
# poetry
|
|
178
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
179
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
180
|
+
# commonly ignored for libraries.
|
|
181
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
182
|
+
#poetry.lock
|
|
183
|
+
|
|
184
|
+
# pdm
|
|
185
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
186
|
+
#pdm.lock
|
|
187
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
188
|
+
# in version control.
|
|
189
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
190
|
+
.pdm.toml
|
|
191
|
+
.pdm-python
|
|
192
|
+
.pdm-build/
|
|
193
|
+
|
|
194
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
195
|
+
__pypackages__/
|
|
196
|
+
|
|
197
|
+
# Celery stuff
|
|
198
|
+
celerybeat-schedule
|
|
199
|
+
celerybeat.pid
|
|
200
|
+
|
|
201
|
+
# SageMath parsed files
|
|
202
|
+
*.sage.py
|
|
203
|
+
|
|
204
|
+
# Environments
|
|
205
|
+
.env
|
|
206
|
+
.venv
|
|
207
|
+
env/
|
|
208
|
+
venv/
|
|
209
|
+
ENV/
|
|
210
|
+
env.bak/
|
|
211
|
+
venv.bak/
|
|
212
|
+
|
|
213
|
+
# Spyder project settings
|
|
214
|
+
.spyderproject
|
|
215
|
+
.spyproject
|
|
216
|
+
|
|
217
|
+
# Rope project settings
|
|
218
|
+
.ropeproject
|
|
219
|
+
|
|
220
|
+
# mkdocs documentation
|
|
221
|
+
/site
|
|
222
|
+
|
|
223
|
+
# mypy
|
|
224
|
+
.mypy_cache/
|
|
225
|
+
.dmypy.json
|
|
226
|
+
dmypy.json
|
|
227
|
+
|
|
228
|
+
# Pyre type checker
|
|
229
|
+
.pyre/
|
|
230
|
+
|
|
231
|
+
# pytype static type analyzer
|
|
232
|
+
.pytype/
|
|
233
|
+
|
|
234
|
+
# Cython debug symbols
|
|
235
|
+
cython_debug/
|
|
236
|
+
|
|
237
|
+
# PyCharm
|
|
238
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
239
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
240
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
241
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
242
|
+
#.idea/
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# This module is only available for the container image
|
|
2
|
+
|
|
3
|
+
include:
|
|
4
|
+
- component: $CI_SERVER_FQDN/gitlab-ci/code-quality/ruff@~latest
|
|
5
|
+
- component: $CI_SERVER_FQDN/python-libs/ci-component/pytest@~latest
|
|
6
|
+
inputs:
|
|
7
|
+
python_version: "3.8"
|
|
8
|
+
- component: $CI_SERVER_FQDN/python-libs/ci-component/pytest@~latest
|
|
9
|
+
inputs:
|
|
10
|
+
python_version: "3.9"
|
|
11
|
+
- component: $CI_SERVER_FQDN/python-libs/ci-component/pytest@~latest
|
|
12
|
+
inputs:
|
|
13
|
+
python_version: "3.10"
|
|
14
|
+
- component: $CI_SERVER_FQDN/python-libs/ci-component/pytest@~latest
|
|
15
|
+
inputs:
|
|
16
|
+
python_version: "3.11"
|
|
17
|
+
- component: $CI_SERVER_FQDN/python-libs/ci-component/pytest@~latest
|
|
18
|
+
inputs:
|
|
19
|
+
python_version: "3.12"
|
|
20
|
+
- component: $CI_SERVER_FQDN/python-libs/ci-component/pytest@~latest
|
|
21
|
+
inputs:
|
|
22
|
+
python_version: "3.13"
|
|
23
|
+
- component: $CI_SERVER_FQDN/python-libs/ci-component/build@~latest
|
|
24
|
+
inputs:
|
|
25
|
+
python_version: "3.13"
|
|
26
|
+
- component: $CI_SERVER_FQDN/python-libs/ci-component/upload-pypi@~latest
|
|
27
|
+
rules:
|
|
28
|
+
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $CI_COMMIT_TAG == null
|
|
29
|
+
inputs:
|
|
30
|
+
registry_token_var: $TESTPYPI_REGISTRY_TOKEN
|
|
31
|
+
dependencies: [ "build:python" ]
|
|
32
|
+
registry_name: "testpypi"
|
|
33
|
+
- component: $CI_SERVER_FQDN/python-libs/ci-component/upload-pypi@~latest
|
|
34
|
+
rules:
|
|
35
|
+
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED
|
|
36
|
+
inputs:
|
|
37
|
+
registry_token_var: $PYPI_REGISTRY_TOKEN
|
|
38
|
+
registry_name: "pypi"
|
|
39
|
+
dependencies: [ "build:python" ]
|
|
40
|
+
- component: $CI_SERVER_FQDN/python-libs/ci-component/upload-pypi@~latest
|
|
41
|
+
rules:
|
|
42
|
+
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED && $CI_SERVER_HOST
|
|
43
|
+
inputs:
|
|
44
|
+
registry_token_var: $CI_JOB_TOKEN
|
|
45
|
+
registry_name: "$CI_SERVER_HOST"
|
|
46
|
+
dependencies: [ "build:python" ]
|
|
47
|
+
|
|
48
|
+
# Only run pipeline if a merge request is open or run on a protected ref
|
|
49
|
+
workflow:
|
|
50
|
+
rules:
|
|
51
|
+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
52
|
+
- if: $CI_COMMIT_TAG
|
|
53
|
+
- if: $CI_COMMIT_REF_PROTECTED == "true"
|
|
54
|
+
|
|
55
|
+
"test:odoo:all":
|
|
56
|
+
tags:
|
|
57
|
+
- odoo
|
|
58
|
+
parallel:
|
|
59
|
+
matrix:
|
|
60
|
+
- ODOO_VERSION:
|
|
61
|
+
- "12.0"
|
|
62
|
+
- "13.0"
|
|
63
|
+
- "14.0"
|
|
64
|
+
- "15.0"
|
|
65
|
+
- "16.0"
|
|
66
|
+
- "17.0"
|
|
67
|
+
- "18.0"
|
|
68
|
+
image:
|
|
69
|
+
name: registry.mangono.io/odoo-cloud/container:$ODOO_VERSION
|
|
70
|
+
entrypoint: [ "" ]
|
|
71
|
+
before_script:
|
|
72
|
+
- pip install pytest pytest-cov pytest-mock
|
|
73
|
+
script:
|
|
74
|
+
- pip install .
|
|
75
|
+
- pytest --cov --cov-report=xml --no-cov-on-fail --junit-xml=report.xml
|
|
76
|
+
artifacts:
|
|
77
|
+
reports:
|
|
78
|
+
coverage_report:
|
|
79
|
+
coverage_format: cobertura
|
|
80
|
+
path: ./coverage.xml
|
|
81
|
+
junit: report.xml
|
|
82
|
+
|
|
83
|
+
# If we are tagging a release with a specific convention ("v" + number) and all
|
|
84
|
+
# previous checks succeeded, we proceed with creating a release automatically.
|
|
85
|
+
publish:release:
|
|
86
|
+
tags: ["lint"]
|
|
87
|
+
stage: deploy
|
|
88
|
+
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
|
89
|
+
script: echo "Creating release $CI_COMMIT_TAG"
|
|
90
|
+
rules:
|
|
91
|
+
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED
|
|
92
|
+
release:
|
|
93
|
+
tag_name: $CI_COMMIT_TAG
|
|
94
|
+
description: "Release $CI_COMMIT_TAG of components repository $CI_PROJECT_PATH"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<component name="InspectionProjectProfileManager">
|
|
2
|
+
<profile version="1.0">
|
|
3
|
+
<option name="myName" value="Project Default" />
|
|
4
|
+
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
|
5
|
+
<inspection_tool class="PyCompatibilityInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
|
6
|
+
<option name="ourVersions">
|
|
7
|
+
<value>
|
|
8
|
+
<list size="2">
|
|
9
|
+
<item index="0" class="java.lang.String" itemvalue="3.13" />
|
|
10
|
+
<item index="1" class="java.lang.String" itemvalue="3.8" />
|
|
11
|
+
</list>
|
|
12
|
+
</value>
|
|
13
|
+
</option>
|
|
14
|
+
</inspection_tool>
|
|
15
|
+
</profile>
|
|
16
|
+
</component>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="Black">
|
|
4
|
+
<option name="sdkName" value="Python 3.12 (odoo-clevercloud)" />
|
|
5
|
+
</component>
|
|
6
|
+
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12 (odoo-clevercloud)" project-jdk-type="Python SDK" />
|
|
7
|
+
</project>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/odoo-clevercloud.iml" filepath="$PROJECT_DIR$/.idea/odoo-clevercloud.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="PYTHON_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$">
|
|
5
|
+
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
|
6
|
+
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
|
7
|
+
</content>
|
|
8
|
+
<orderEntry type="jdk" jdkName="Python 3.12 (odoo-clevercloud)" jdkType="Python SDK" />
|
|
9
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
10
|
+
</component>
|
|
11
|
+
<component name="PyDocumentationSettings">
|
|
12
|
+
<option name="format" value="PLAIN" />
|
|
13
|
+
<option name="myDocStringFormat" value="Plain" />
|
|
14
|
+
</component>
|
|
15
|
+
</module>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v6.0.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: check-xml
|
|
6
|
+
- id: check-merge-conflict
|
|
7
|
+
- id: check-json
|
|
8
|
+
- id: check-toml
|
|
9
|
+
- id: check-yaml
|
|
10
|
+
args: [--allow-multiple-documents]
|
|
11
|
+
- id: end-of-file-fixer
|
|
12
|
+
- id: trailing-whitespace
|
|
13
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
14
|
+
# Ruff version.
|
|
15
|
+
rev: v0.14.7
|
|
16
|
+
hooks:
|
|
17
|
+
# Run the linter.
|
|
18
|
+
- id: ruff
|
|
19
|
+
args: [ --fix ]
|
|
20
|
+
# Run the formatter.
|
|
21
|
+
- id: ruff-format
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mangono-odoo-clevercloud
|
|
3
|
+
Version: 1.0.2
|
|
4
|
+
Classifier: Framework :: Odoo
|
|
5
|
+
Classifier: Framework :: Odoo :: 12.0
|
|
6
|
+
Classifier: Framework :: Odoo :: 13.0
|
|
7
|
+
Classifier: Framework :: Odoo :: 14.0
|
|
8
|
+
Classifier: Framework :: Odoo :: 15.0
|
|
9
|
+
Classifier: Framework :: Odoo :: 16.0
|
|
10
|
+
Classifier: Framework :: Odoo :: 17.0
|
|
11
|
+
Classifier: Framework :: Odoo :: 18.0
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Typing :: Typed
|
|
20
|
+
Requires-Python: >=3.8
|
|
21
|
+
Requires-Dist: environ-odoo-config>=0.6.5
|
|
22
|
+
Requires-Dist: importlib-metadata>=6.7.0
|
|
23
|
+
Requires-Dist: mangono-addon-odoo-cron-patch==0.1.1
|
|
24
|
+
Requires-Dist: mangono-addon-odoo-custom-server~=1.2.0
|
|
25
|
+
Requires-Dist: mangono-addon-odoo-filestore-s3~=2.2.0
|
|
26
|
+
Requires-Dist: mangono-addon-redis-session-store~=2.2.0
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "mangono-odoo-clevercloud"
|
|
7
|
+
version = "1.0.2"
|
|
8
|
+
requires-python = ">=3.8"
|
|
9
|
+
classifiers = [
|
|
10
|
+
"Programming Language :: Python :: 3",
|
|
11
|
+
'Programming Language :: Python :: 3.8',
|
|
12
|
+
'Programming Language :: Python :: 3.9',
|
|
13
|
+
'Programming Language :: Python :: 3.10',
|
|
14
|
+
'Programming Language :: Python :: 3.11',
|
|
15
|
+
'Programming Language :: Python :: 3.12',
|
|
16
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
17
|
+
"Framework :: Odoo",
|
|
18
|
+
"Framework :: Odoo :: 12.0",
|
|
19
|
+
"Framework :: Odoo :: 13.0",
|
|
20
|
+
"Framework :: Odoo :: 14.0",
|
|
21
|
+
"Framework :: Odoo :: 15.0",
|
|
22
|
+
"Framework :: Odoo :: 16.0",
|
|
23
|
+
"Framework :: Odoo :: 17.0",
|
|
24
|
+
"Framework :: Odoo :: 18.0",
|
|
25
|
+
"Typing :: Typed",
|
|
26
|
+
]
|
|
27
|
+
dependencies = [
|
|
28
|
+
"environ-odoo-config>=0.6.5",
|
|
29
|
+
"mangono_addon-odoo_custom_server~=1.2.0",
|
|
30
|
+
"mangono-addon-odoo_filestore_s3~=2.2.0",
|
|
31
|
+
"mangono-addon-redis-session-store~=2.2.0",
|
|
32
|
+
"mangono-addon-odoo_cron_patch==0.1.1",
|
|
33
|
+
"importlib-metadata>=6.7.0",
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
[project.entry-points."environ_odoo_config.extension"]
|
|
37
|
+
cc_autoconfig = "mangono_odoo_clevercloud.extensions.cc_auto_config:CleverCloudAutoConfig"
|
|
38
|
+
|
|
39
|
+
#[project.entry-points."environ_odoo_config.auto_server_wide_module"]
|
|
40
|
+
|
|
41
|
+
[project.entry-points."environ_odoo_config.mapper"]
|
|
42
|
+
clevercloud_postgresql = "mangono_odoo_clevercloud.mappers.cc_postgresql:clevercloud_postgresql"
|
|
43
|
+
|
|
44
|
+
[tool.hatch.build.targets.wheel]
|
|
45
|
+
packages = ["src/mangono_odoo_clevercloud"]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
line-length = 120 # Allow lines to be as long as 120 characters
|
|
2
|
+
show-fixes = true # By default, always enumerate fixed violations
|
|
3
|
+
output-format = "full" # Always show source code snippets
|
|
4
|
+
target-version = "py38"
|
|
5
|
+
fix = true
|
|
6
|
+
exclude = ["tests", "generate_adoc.py"]
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
[format]
|
|
11
|
+
# Enable reformatting of code snippets in docstrings.
|
|
12
|
+
docstring-code-format = true
|
|
13
|
+
|
|
14
|
+
[lint]
|
|
15
|
+
extend-select = ["I", "C901", "PLR", "E", "A", "SIM"]
|
|
16
|
+
|
|
17
|
+
[lint.mccabe]
|
|
18
|
+
# Flag errors (`C901`) whenever the complexity level exceeds 5.
|
|
19
|
+
max-complexity = 10
|
|
20
|
+
|
|
21
|
+
[lint.pydocstyle]
|
|
22
|
+
convention = "google"
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
from environ_odoo_config.config_section.api import SimpleKey
|
|
6
|
+
from environ_odoo_config.environ import Environ
|
|
7
|
+
from environ_odoo_config.odoo_config import OdooConfigExtension, OdooEnvConfig
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class CleverCloudAutoConfig(OdooConfigExtension):
|
|
11
|
+
_order = 999
|
|
12
|
+
|
|
13
|
+
app_id: str = SimpleKey("CC_APP_ID")
|
|
14
|
+
app_name: str = SimpleKey("CC_APP_NAME")
|
|
15
|
+
commit_id: str = SimpleKey("CC_COMMIT_ID")
|
|
16
|
+
deployment_id: str = SimpleKey("CC_DEPLOYMENT_ID")
|
|
17
|
+
instance_type: str = SimpleKey("INSTANCE_TYPE")
|
|
18
|
+
app_home: Path = SimpleKey("APP_HOME")
|
|
19
|
+
|
|
20
|
+
def apply_extension(self, environ: Environ, odoo_config: OdooEnvConfig):
|
|
21
|
+
super().apply_extension(environ, odoo_config)
|
|
22
|
+
if not self.app_id:
|
|
23
|
+
return
|
|
24
|
+
|
|
25
|
+
odoo_config.misc.config_file = self.app_home / "odoo-config.ini"
|
|
26
|
+
odoo_config.misc.data_dir = self.app_home / "datas"
|
|
27
|
+
odoo_config.misc.pidfile = self.app_home / "odoo.pid"
|
|
28
|
+
odoo_config.http.proxy_mode = True
|
|
29
|
+
if not odoo_config.http.port:
|
|
30
|
+
odoo_config.http.port = 8080 # Default listen http port of clevercloud
|
|
31
|
+
|
|
32
|
+
if self.instance_type == "production" and not environ.get("LIST_DB"):
|
|
33
|
+
odoo_config.database.list_db = False
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from environ_odoo_config.environ import Environ
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def clevercloud_postgresql(curr_env: Environ) -> Environ:
|
|
5
|
+
return clevercloud_postgresql_classic(clevercloud_direct_host(curr_env))
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def clevercloud_postgresql_classic(curr_env: Environ) -> Environ:
|
|
9
|
+
""" """
|
|
10
|
+
return curr_env + {
|
|
11
|
+
"DB_NAME": curr_env.gets("DB_NAME", "POSTGRESQL_ADDON_DB"),
|
|
12
|
+
"DB_HOST": curr_env.gets("DB_HOST", "POSTGRESQL_ADDON_HOST"),
|
|
13
|
+
"DB_PORT": curr_env.gets("DB_PORT", "POSTGRESQL_ADDON_PORT"),
|
|
14
|
+
"DB_USER": curr_env.gets("DB_USER", "POSTGRESQL_ADDON_USER"),
|
|
15
|
+
"DB_PASSWORD": curr_env.gets("DB_PASSWORD", "POSTGRESQL_ADDON_PASSWORD"),
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def clevercloud_direct_host(curr_env: Environ) -> Environ:
|
|
20
|
+
""" """
|
|
21
|
+
return curr_env + {
|
|
22
|
+
"DB_HOST": curr_env.gets("DB_HOST", "POSTGRESQL_ADDON_DIRECT_HOST"),
|
|
23
|
+
"DB_PORT": curr_env.gets("DB_PORT", "POSTGRESQL_ADDON_DIRECT_PORT"),
|
|
24
|
+
}
|
|
File without changes
|