Skip to content

Commit 6b5928f

Browse files
committed
Merge PR #877 into 12.0
Signed-off-by simahawk
2 parents d1b78c7 + 0c1ab81 commit 6b5928f

File tree

116 files changed

+11609
-128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+11609
-128
lines changed

.copier-answers.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Do NOT update manually; changes here will be overwritten by Copier
2+
_commit: v1.19.2
3+
_src_path: https://github.com/OCA/oca-addons-repo-template.git
4+
ci: GitHub
5+
convert_readme_fragments_to_markdown: false
6+
generate_requirements_txt: false
7+
github_check_license: false
8+
github_ci_extra_env: {}
9+
github_enable_codecov: true
10+
github_enable_makepot: true
11+
github_enable_stale_action: true
12+
github_enforce_dev_status_compatibility: false
13+
include_wkhtmltopdf: false
14+
odoo_test_flavor: Both
15+
odoo_version: 12.0
16+
org_name: Odoo Community Association (OCA)
17+
org_slug: OCA
18+
rebel_module_groups: []
19+
repo_description: Electronic Data Interchange modules
20+
repo_name: Electronic Data Interchange modules
21+
repo_slug: edi
22+
repo_website: https://github.com/OCA/edi

.editorconfig

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ indent_style = space
77
insert_final_newline = true
88
trim_trailing_whitespace = true
99

10-
[.eslintrc,*.{json,yml,yaml,rst,md}]
10+
[*.{json,yml,yaml,rst,md}]
1111
indent_size = 2
1212

1313
# Do not configure editor for libs and autogenerated content
14-
[*/static/{lib,src/lib}/**,*/static/description/index.html,*/readme/../README.rst]
14+
[{*/static/{lib,src/lib}/**,*/static/description/index.html,*/readme/../README.rst}]
1515
charset = unset
1616
end_of_line = unset
1717
indent_size = unset

.flake8

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[flake8]
2+
# E123,E133,E226,E241,E242 are ignored by default by pep8 and flake8
3+
# F811 is legal in odoo 8 when we implement 2 interfaces for a method
4+
# F601 pylint support this case with expected tests
5+
# W503 changed by W504 and OCA prefers allow both
6+
# E203: whitespace before ':' (black behaviour and not pep8 compliant)
7+
ignore = E123,E133,E226,E241,E242,F811,F601,W503,W504,E203
8+
max-line-length = 88
9+
per-file-ignores=
10+
__init__.py:F401
11+

.github/workflows/pre-commit.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "12.0*"
7+
push:
8+
branches:
9+
- "12.0"
10+
- "12.0-ocabot-*"
11+
12+
jobs:
13+
pre-commit:
14+
runs-on: ubuntu-20.04
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-python@v2
18+
with:
19+
python-version: "3.6"
20+
- name: Get python version
21+
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
22+
- uses: actions/cache@v1
23+
with:
24+
path: ~/.cache/pre-commit
25+
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
26+
- name: Install pre-commit
27+
run: pip install pre-commit
28+
- name: Run pre-commit
29+
run: pre-commit run --all-files --show-diff-on-failure --color=always
30+
env:
31+
# Consider valid a PR that changes README fragments but doesn't
32+
# change the README.rst file itself. It's not really a problem
33+
# because the bot will update it anyway after merge. This way, we
34+
# lower the barrier for functional contributors that want to fix the
35+
# readme fragments, while still letting developers get README
36+
# auto-generated (which also helps functionals when using runboat).
37+
# DOCS https://pre-commit.com/#temporarily-disabling-hooks
38+
SKIP: oca-gen-addon-readme
39+
- name: Check that all files generated by pre-commit are in git
40+
run: |
41+
newfiles="$(git ls-files --others --exclude-from=.gitignore)"
42+
if [ "$newfiles" != "" ] ; then
43+
echo "Please check-in the following files:"
44+
echo "$newfiles"
45+
exit 1
46+
fi

.github/workflows/stale.yml

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Mark stale issues and pull requests
2+
3+
on:
4+
schedule:
5+
- cron: "0 12 * * 0"
6+
7+
jobs:
8+
stale:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Stale PRs and issues policy
12+
uses: actions/stale@v4
13+
with:
14+
repo-token: ${{ secrets.GITHUB_TOKEN }}
15+
# General settings.
16+
ascending: true
17+
remove-stale-when-updated: true
18+
# Pull Requests settings.
19+
# 120+30 day stale policy for PRs
20+
# * Except PRs marked as "no stale"
21+
days-before-pr-stale: 120
22+
days-before-pr-close: 30
23+
exempt-pr-labels: "no stale"
24+
stale-pr-label: "stale"
25+
stale-pr-message: >
26+
There hasn't been any activity on this pull request in the past 4 months, so
27+
it has been marked as stale and it will be closed automatically if no
28+
further activity occurs in the next 30 days.
29+
30+
If you want this PR to never become stale, please ask a PSC member to apply
31+
the "no stale" label.
32+
# Issues settings.
33+
# 180+30 day stale policy for open issues
34+
# * Except Issues marked as "no stale"
35+
days-before-issue-stale: 180
36+
days-before-issue-close: 30
37+
exempt-issue-labels: "no stale,needs more information"
38+
stale-issue-label: "stale"
39+
stale-issue-message: >
40+
There hasn't been any activity on this issue in the past 6 months, so it has
41+
been marked as stale and it will be closed automatically if no further
42+
activity occurs in the next 30 days.
43+
44+
If you want this issue to never become stale, please ask a PSC member to
45+
apply the "no stale" label.
46+
47+
# 15+30 day stale policy for issues pending more information
48+
# * Issues that are pending more information
49+
# * Except Issues marked as "no stale"
50+
- name: Needs more information stale issues policy
51+
uses: actions/stale@v4
52+
with:
53+
repo-token: ${{ secrets.GITHUB_TOKEN }}
54+
ascending: true
55+
only-labels: "needs more information"
56+
exempt-issue-labels: "no stale"
57+
days-before-stale: 15
58+
days-before-close: 30
59+
days-before-pr-stale: -1
60+
days-before-pr-close: -1
61+
remove-stale-when-updated: true
62+
stale-issue-label: "stale"
63+
stale-issue-message: >
64+
This issue needs more information and there hasn't been any activity
65+
recently, so it has been marked as stale and it will be closed automatically
66+
if no further activity occurs in the next 30 days.
67+
68+
If you think this is a mistake, please ask a PSC member to remove the "needs
69+
more information" label.

.github/workflows/test.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "12.0*"
7+
push:
8+
branches:
9+
- "12.0"
10+
- "12.0-ocabot-*"
11+
12+
jobs:
13+
unreleased-deps:
14+
runs-on: ubuntu-latest
15+
name: Detect unreleased dependencies
16+
steps:
17+
- uses: actions/checkout@v3
18+
- run: |
19+
for reqfile in requirements.txt test-requirements.txt ; do
20+
if [ -f ${reqfile} ] ; then
21+
result=0
22+
# reject non-comment lines that contain a / (i.e. URLs, relative paths)
23+
grep "^[^#].*/" ${reqfile} || result=$?
24+
if [ $result -eq 0 ] ; then
25+
echo "Unreleased dependencies found in ${reqfile}."
26+
exit 1
27+
fi
28+
fi
29+
done
30+
test:
31+
runs-on: ubuntu-20.04
32+
container: ${{ matrix.container }}
33+
name: ${{ matrix.name }}
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
include:
38+
- container: ghcr.io/oca/oca-ci/py3.6-odoo12.0:latest
39+
name: test with Odoo
40+
- container: ghcr.io/oca/oca-ci/py3.6-ocb12.0:latest
41+
name: test with OCB
42+
makepot: "true"
43+
services:
44+
postgres:
45+
image: postgres:9.6
46+
env:
47+
POSTGRES_USER: odoo
48+
POSTGRES_PASSWORD: odoo
49+
POSTGRES_DB: odoo
50+
ports:
51+
- 5432:5432
52+
steps:
53+
- uses: actions/checkout@v3
54+
with:
55+
persist-credentials: false
56+
- name: Install addons and dependencies
57+
run: oca_install_addons
58+
- name: Check licenses
59+
run: manifestoo -d . check-licenses
60+
continue-on-error: true
61+
- name: Check development status
62+
run: manifestoo -d . check-dev-status --default-dev-status=Beta
63+
continue-on-error: true
64+
- name: Initialize test db
65+
run: oca_init_test_database
66+
- name: Run tests
67+
run: oca_run_tests
68+
- uses: codecov/codecov-action@v1
69+
- name: Update .pot files
70+
run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }}
71+
if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'OCA' }}

.gitignore

+19-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Byte-compiled / optimized / DLL files
22
__pycache__/
33
*.py[cod]
4+
/.venv
5+
/.pytest_cache
6+
/.ruff_cache
47

58
# C extensions
69
*.so
@@ -13,14 +16,14 @@ build/
1316
develop-eggs/
1417
dist/
1518
eggs/
16-
lib/
1719
lib64/
1820
parts/
1921
sdist/
2022
var/
2123
*.egg-info/
2224
.installed.cfg
2325
*.egg
26+
*.eggs
2427

2528
# Installer logs
2629
pip-log.txt
@@ -40,6 +43,19 @@ coverage.xml
4043
# Pycharm
4144
.idea
4245

46+
# Eclipse
47+
.settings
48+
49+
# Visual Studio cache/options directory
50+
.vs/
51+
.vscode
52+
53+
# OSX Files
54+
.DS_Store
55+
56+
# Django stuff:
57+
*.log
58+
4359
# Mr Developer
4460
.mr.developer.cfg
4561
.project
@@ -55,5 +71,5 @@ docs/_build/
5571
*~
5672
*.swp
5773

58-
# OSX Files
59-
*.DS_Store
74+
# OCA rules
75+
!static/lib/

.pre-commit-config.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
exclude: |
2+
(?x)
3+
# NOT INSTALLABLE ADDONS
4+
# END NOT INSTALLABLE ADDONS
5+
# Files and folders generated by bots, to avoid loops
6+
^setup/|/static/description/index\.html$|
7+
# We don't want to mess with tool-generated files
8+
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|
9+
# Maybe reactivate this when all README files include prettier ignore tags?
10+
^README\.md$|
11+
# Library files can have extraneous formatting (even minimized)
12+
/static/(src/)?lib/|
13+
# Repos using Sphinx to generate docs don't need prettying
14+
^docs/_templates/.*\.html$|
15+
# You don't usually want a bot to modify your legal texts
16+
(LICENSE.*|COPYING.*)
17+
default_language_version:
18+
python: python3.6
19+
repos:
20+
- repo: https://github.com/oca/maintainer-tools
21+
rev: ab1d7f6
22+
hooks:
23+
# update the NOT INSTALLABLE ADDONS section above
24+
- id: oca-update-pre-commit-excluded-addons
25+
- id: oca-fix-manifest-website
26+
args: ["https://github.com/OCA/edi"]
27+
- repo: https://github.com/acsone/setuptools-odoo
28+
rev: 3.1.8
29+
hooks:
30+
- id: setuptools-odoo-make-default
31+
- repo: https://github.com/OCA/mirrors-flake8
32+
rev: v3.4.1
33+
hooks:
34+
- id: flake8
35+
name: flake8 excluding __init__.py
36+
exclude: __init__\.py
37+
- repo: https://github.com/pre-commit/mirrors-pylint
38+
rev: v2.5.3
39+
hooks:
40+
- id: pylint
41+
name: pylint with optional checks
42+
args:
43+
- --rcfile=.pylintrc
44+
- --exit-zero
45+
verbose: true
46+
additional_dependencies: &pylint_deps
47+
- pylint-odoo==3.5.0
48+
- id: pylint
49+
name: pylint with mandatory checks
50+
args:
51+
- --rcfile=.pylintrc-mandatory
52+
additional_dependencies: *pylint_deps

0 commit comments

Comments
 (0)