Skip to content

Commit 0f90dbb

Browse files
committed
[UPD] Upgrade project template (v1.31 -> v1.42)
Changes applied by copier update: - Bump template version v1.31 -> v1.42 - Switch from flake8/black/isort/pyupgrade to ruff (ruff + ruff-format) - Remove .flake8, .isort.cfg - Add .ruff.toml (target py3.10, isort, pyupgrade, mccabe, line-length) - Remove autoflake, pyupgrade, isort, black, flake8 pre-commit hooks - Add ruff and ruff-format pre-commit hooks - Enable use_ruff=true, use_pyproject_toml=true in copier answers - Add .gitattributes (test-requirements.txt merge=union) - pre-commit-config.yaml: - maintainer-tools rev bump (f9b919b) - python default version: python3 -> python3.10 - Add whool-init hook (sbidoul/whool v1.3) - Add obsolete dotfiles check hook - Add oca-gen-external-dependencies hook - Add --convert-fragments-to-markdown to oca-gen-addon-readme - Remove setuptools-odoo (replaced by whool) - .github/workflows/pre-commit.yml: - python-version: 3.11 -> 3.10 - Add pip cache for setup-python - .github/workflows/test.yml: - postgres:12.0 -> postgres:12 - Add 'Upload screenshots from JS tests' artifact step on failure - .pylintrc / .pylintrc-mandatory: reorder enable= list (alpha-sort by group) - README.md: add OCA support banner, fill repo description
1 parent 6a3ee73 commit 0f90dbb

11 files changed

Lines changed: 133 additions & 140 deletions

File tree

.copier-answers.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Do NOT update manually; changes here will be overwritten by Copier
2-
_commit: v1.31
2+
_commit: v1.42
33
_src_path: gh:oca/oca-addons-repo-template
4-
ci: GitHub
5-
convert_readme_fragments_to_markdown: false
4+
additional_ruff_rules: []
5+
convert_readme_fragments_to_markdown: true
66
enable_checklog_odoo: false
77
generate_requirements_txt: true
88
github_check_license: true
@@ -19,10 +19,11 @@ org_slug: OCA
1919
rebel_module_groups:
2020
- crm_date_deadline_required
2121
- crm_partner_required
22-
repo_description: 'TODO: add repo description.'
22+
repo_description: 'Modules to extend and improve Odoo CRM features: opportunities,
23+
leads, sales activities, and related integrations.'
2324
repo_name: crm
2425
repo_slug: crm
2526
repo_website: https://github.com/OCA/crm
26-
use_pyproject_toml: false
27-
use_ruff: false
27+
use_pyproject_toml: true
28+
use_ruff: true
2829

.flake8

Lines changed: 0 additions & 12 deletions
This file was deleted.

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test-requirements.txt merge=union

.github/workflows/pre-commit.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
name: pre-commit
23

34
on:
@@ -16,7 +17,9 @@ jobs:
1617
- uses: actions/checkout@v4
1718
- uses: actions/setup-python@v5
1819
with:
19-
python-version: "3.11"
20+
python-version: "3.10"
21+
cache: 'pip'
22+
cache-dependency-path: '.pre-commit-config.yaml'
2023
- name: Get python version
2124
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
2225
- uses: actions/cache@v4

.github/workflows/test.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
makepot: "true"
5959
services:
6060
postgres:
61-
image: postgres:12.0
61+
image: postgres:12
6262
env:
6363
POSTGRES_USER: odoo
6464
POSTGRES_PASSWORD: odoo
@@ -82,6 +82,13 @@ jobs:
8282
run: oca_init_test_database
8383
- name: Run tests
8484
run: oca_run_tests
85+
- name: Upload screenshots from JS tests
86+
uses: actions/upload-artifact@v4
87+
if: ${{ failure() }}
88+
with:
89+
name: Screenshots of failed JS tests - ${{ matrix.name }}${{ join(matrix.include) }}
90+
path: /tmp/odoo_tests/${{ env.PGDATABASE }}
91+
if-no-files-found: ignore
8592
- uses: codecov/codecov-action@v4
8693
with:
8794
token: ${{ secrets.CODECOV_TOKEN }}

.isort.cfg

Lines changed: 0 additions & 13 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 18 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ exclude: |
2121
# You don't usually want a bot to modify your legal texts
2222
(LICENSE.*|COPYING.*)
2323
default_language_version:
24-
python: python3
24+
python: python3.10
2525
node: "16.17.0"
2626
repos:
2727
- repo: local
@@ -38,8 +38,17 @@ repos:
3838
entry: found a en.po file
3939
language: fail
4040
files: '[a-zA-Z0-9_]*/i18n/en\.po$'
41+
- id: obsolete dotfiles
42+
name: obsolete dotfiles
43+
entry: found obsolete files; remove them
44+
files: '^(\.travis\.yml|\.t2d\.yml|CONTRIBUTING\.md)$'
45+
language: fail
46+
- repo: https://github.com/sbidoul/whool
47+
rev: v1.3
48+
hooks:
49+
- id: whool-init
4150
- repo: https://github.com/oca/maintainer-tools
42-
rev: d5fab7ee87fceee858a3d01048c78a548974d935
51+
rev: f9b919b9868143135a9c9cb03021089cabba8223
4352
hooks:
4453
# update the NOT INSTALLABLE ADDONS section above
4554
- id: oca-update-pre-commit-excluded-addons
@@ -53,28 +62,15 @@ repos:
5362
- --repo-name=crm
5463
- --if-source-changed
5564
- --keep-source-digest
65+
- --convert-fragments-to-markdown
66+
- id: oca-gen-external-dependencies
5667
- repo: https://github.com/OCA/odoo-pre-commit-hooks
5768
rev: v0.0.25
5869
hooks:
5970
- id: oca-checks-odoo-module
6071
- id: oca-checks-po
6172
args:
6273
- --disable=po-pretty-format
63-
- repo: https://github.com/myint/autoflake
64-
rev: v1.6.1
65-
hooks:
66-
- id: autoflake
67-
args:
68-
- --expand-star-imports
69-
- --ignore-init-module-imports
70-
- --in-place
71-
- --remove-all-unused-imports
72-
- --remove-duplicate-keys
73-
- --remove-unused-variables
74-
- repo: https://github.com/psf/black
75-
rev: 22.8.0
76-
hooks:
77-
- id: black
7874
- repo: local
7975
hooks:
8076
- id: prettier
@@ -127,35 +123,12 @@ repos:
127123
- id: check-xml
128124
- id: mixed-line-ending
129125
args: ["--fix=lf"]
130-
- repo: https://github.com/asottile/pyupgrade
131-
rev: v2.38.2
132-
hooks:
133-
- id: pyupgrade
134-
args: ["--keep-percent-format"]
135-
- repo: https://github.com/PyCQA/isort
136-
rev: 5.12.0
137-
hooks:
138-
- id: isort
139-
name: isort except __init__.py
140-
args:
141-
- --settings=.
142-
exclude: /__init__\.py$
143-
- repo: https://github.com/acsone/setuptools-odoo
144-
rev: 3.1.8
145-
hooks:
146-
- id: setuptools-odoo-make-default
147-
- id: setuptools-odoo-get-requirements
148-
args:
149-
- --output
150-
- requirements.txt
151-
- --header
152-
- "# generated from manifests external_dependencies"
153-
- repo: https://github.com/PyCQA/flake8
154-
rev: 5.0.0
126+
- repo: https://github.com/astral-sh/ruff-pre-commit
127+
rev: v0.1.3
155128
hooks:
156-
- id: flake8
157-
name: flake8
158-
additional_dependencies: ["flake8-bugbear==21.9.2"]
129+
- id: ruff
130+
args: [--fix, --exit-non-zero-on-fix]
131+
- id: ruff-format
159132
- repo: https://github.com/OCA/pylint-odoo
160133
rev: v8.0.19
161134
hooks:

.pylintrc

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,25 @@ disable=all
2525
enable=anomalous-backslash-in-string,
2626
api-one-deprecated,
2727
api-one-multi-together,
28-
assignment-from-none,
29-
attribute-deprecated,
3028
class-camelcase,
31-
dangerous-default-value,
3229
dangerous-view-replace-wo-priority,
33-
development-status-allowed,
3430
duplicate-id-csv,
35-
duplicate-key,
3631
duplicate-xml-fields,
3732
duplicate-xml-record-id,
3833
eval-referenced,
39-
eval-used,
4034
incoherent-interpreter-exec-perm,
35+
openerp-exception-warning,
36+
redundant-modulename-xml,
37+
relative-import,
38+
rst-syntax-error,
39+
wrong-tabs-instead-of-spaces,
40+
xml-syntax-error,
41+
assignment-from-none,
42+
attribute-deprecated,
43+
dangerous-default-value,
44+
development-status-allowed,
45+
duplicate-key,
46+
eval-used,
4147
license-allowed,
4248
manifest-author-string,
4349
manifest-deprecated-key,
@@ -48,73 +54,68 @@ enable=anomalous-backslash-in-string,
4854
method-inverse,
4955
method-required-super,
5056
method-search,
51-
openerp-exception-warning,
5257
pointless-statement,
5358
pointless-string-statement,
5459
print-used,
5560
redundant-keyword-arg,
56-
redundant-modulename-xml,
5761
reimported,
58-
relative-import,
5962
return-in-init,
60-
rst-syntax-error,
6163
sql-injection,
6264
too-few-format-args,
6365
translation-field,
6466
translation-required,
6567
unreachable,
6668
use-vim-comment,
67-
wrong-tabs-instead-of-spaces,
68-
xml-syntax-error,
69-
attribute-string-redundant,
7069
character-not-valid-in-resource-link,
71-
consider-merging-classes-inherited,
72-
context-overridden,
7370
create-user-wo-reset-password,
7471
dangerous-filter-wo-user,
7572
dangerous-qweb-replace-wo-priority,
7673
deprecated-data-xml-node,
7774
deprecated-openerp-xml-node,
7875
duplicate-po-message-definition,
79-
except-pass,
8076
file-not-used,
77+
missing-newline-extrafiles,
78+
old-api7-method-defined,
79+
po-msgstr-variables,
80+
po-syntax-error,
81+
str-format-used,
82+
unnecessary-utf8-coding-comment,
83+
xml-attribute-translatable,
84+
xml-deprecated-qweb-directive,
85+
xml-deprecated-tree-attribute,
86+
attribute-string-redundant,
87+
consider-merging-classes-inherited,
88+
context-overridden,
89+
except-pass,
8190
invalid-commit,
8291
manifest-maintainers-list,
83-
missing-newline-extrafiles,
8492
missing-readme,
8593
missing-return,
8694
odoo-addons-relative-import,
87-
old-api7-method-defined,
88-
po-msgstr-variables,
89-
po-syntax-error,
9095
renamed-field-parameter,
9196
resource-not-exist,
92-
str-format-used,
9397
test-folder-imported,
9498
translation-contains-variable,
9599
translation-positional-used,
96-
unnecessary-utf8-coding-comment,
97100
website-manifest-key-not-valid-uri,
98-
xml-attribute-translatable,
99-
xml-deprecated-qweb-directive,
100-
xml-deprecated-tree-attribute,
101101
external-request-timeout,
102-
# messages that do not cause the lint step to fail
103-
consider-merging-classes-inherited,
102+
missing-manifest-dependency,
103+
too-complex,,
104104
create-user-wo-reset-password,
105105
dangerous-filter-wo-user,
106-
deprecated-module,
107106
file-not-used,
108-
invalid-commit,
109-
missing-manifest-dependency,
110107
missing-newline-extrafiles,
111-
missing-readme,
112108
no-utf8-coding-comment,
113-
odoo-addons-relative-import,
114109
old-api7-method-defined,
110+
unnecessary-utf8-coding-comment,
111+
# messages that do not cause the lint step to fail
112+
consider-merging-classes-inherited,
113+
deprecated-module,
114+
invalid-commit,
115+
missing-readme,
116+
odoo-addons-relative-import,
115117
redefined-builtin,
116-
too-complex,
117-
unnecessary-utf8-coding-comment
118+
manifest-external-assets
118119

119120

120121
[REPORTS]

0 commit comments

Comments
 (0)