Skip to content

Commit d9ec25d

Browse files
committed
Add copier template
1 parent f084d7e commit d9ec25d

27 files changed

+402
-188
lines changed

.copier-answers.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Do NOT update manually; changes here will be overwritten by Copier
2+
_commit: v1.5.2
3+
_src_path: https://github.com/OCA/oca-addons-repo-template.git
4+
ci: GitHub
5+
dependency_installation_mode: PIP
6+
generate_requirements_txt: true
7+
include_wkhtmltopdf: false
8+
odoo_version: 13.0
9+
org_name: Odoo Community Association (OCA)
10+
org_slug: OCA
11+
rebel_module_groups: []
12+
repo_description: Advanced async job management for Odoo
13+
repo_name: Odoo Queue Modules
14+
repo_slug: queue
15+
repo_website: https://github.com/OCA/queue
16+
travis_apt_packages: []
17+
travis_apt_sources: []

.eslintrc.yml

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
env:
22
browser: true
3+
es6: true
34

45
# See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449
56
parserOptions:
6-
ecmaVersion: 2017
7+
ecmaVersion: 2019
8+
9+
overrides:
10+
- files:
11+
- "**/*.esm.js"
12+
parserOptions:
13+
sourceType: module
714

815
# Globals available in Odoo that shouldn't produce errorings
916
globals:
@@ -14,7 +21,7 @@ globals:
1421
moment: readonly
1522
odoo: readonly
1623
openerp: readonly
17-
Promise: readonly
24+
owl: readonly
1825

1926
# Styling is handled by Prettier, so we only need to enable AST rules;
2027
# see https://github.com/OCA/maintainer-quality-tools/pull/618#issuecomment-558576890

.flake8

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[flake8]
2-
max-line-length = 80
2+
max-line-length = 88
33
max-complexity = 16
44
# B = bugbear
55
# B9 = bugbear opinionated (incl line length)
@@ -8,3 +8,5 @@ select = C,E,F,W,B,B9
88
# E501: flake8 line length (covered by bugbear B950)
99
# W503: line break before binary operator (black behaviour)
1010
ignore = E203,E501,W503
11+
per-file-ignores=
12+
__init__.py:F401

.github/workflows/pre-commit.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "13.0*"
7+
push:
8+
branches:
9+
- "13.0"
10+
- "13.0-ocabot-*"
11+
12+
jobs:
13+
pre-commit:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: actions/setup-python@v2
18+
with:
19+
# The pylint-odoo version we use here does not support python 3.10
20+
# https://github.com/OCA/oca-addons-repo-template/issues/80
21+
# We also need to pin to an older version of python for older odoo versions
22+
# where we are not using black > 21. Older black versions won't work with
23+
# Python 3.9.8+, and we can't bump black without reformatting.
24+
python-version: "3.9.7"
25+
- name: Get python version
26+
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
27+
- uses: actions/cache@v1
28+
with:
29+
path: ~/.cache/pre-commit
30+
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
31+
- name: Install pre-commit
32+
run: pip install pre-commit
33+
- name: Run pre-commit
34+
run: pre-commit run --all-files --show-diff-on-failure --color=always
35+
- name: Check that all files generated by pre-commit are in git
36+
run: |
37+
newfiles="$(git ls-files --others --exclude-from=.gitignore)"
38+
if [ "$newfiles" != "" ] ; then
39+
echo "Please check-in the following files:"
40+
echo "$newfiles"
41+
exit 1
42+
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

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "13.0*"
7+
push:
8+
branches:
9+
- "13.0"
10+
- "13.0-ocabot-*"
11+
12+
jobs:
13+
unreleased-deps:
14+
runs-on: ubuntu-latest
15+
name: Detect unreleased dependencies
16+
steps:
17+
- uses: actions/checkout@v2
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-latest
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-odoo13.0:latest
39+
makepot: "true"
40+
name: test with Odoo
41+
- container: ghcr.io/oca/oca-ci/py3.6-ocb13.0:latest
42+
name: test with OCB
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@v2
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+
- name: Check development status
61+
run: manifestoo -d . check-dev-status --default-dev-status=Beta
62+
- name: Initialize test db
63+
run: oca_init_test_database
64+
- name: Run tests
65+
run: oca_run_tests
66+
- uses: codecov/codecov-action@v1
67+
- name: Update .pot files
68+
run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }}
69+
if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'OCA' }}

.gitignore

+17-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Byte-compiled / optimized / DLL files
22
__pycache__/
33
*.py[cod]
4+
/.venv
5+
/.pytest_cache
46

57
# C extensions
68
*.so
@@ -41,6 +43,19 @@ coverage.xml
4143
# Pycharm
4244
.idea
4345

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+
4459
# Mr Developer
4560
.mr.developer.cfg
4661
.project
@@ -56,5 +71,5 @@ docs/_build/
5671
*~
5772
*.swp
5873

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

.isort.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ known_odoo=odoo
1010
known_odoo_addons=odoo.addons
1111
sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER
1212
default_section=THIRDPARTY
13+
ensure_newline_before_comments = True

0 commit comments

Comments
 (0)