Skip to content

Commit

Permalink
Merge pull request #116 from akretion/14.0-update-copier
Browse files Browse the repository at this point in the history
Update copier
  • Loading branch information
sebastienbeau authored Mar 12, 2023
2 parents e896fd6 + 6d568df commit b1d9209
Show file tree
Hide file tree
Showing 20 changed files with 135 additions and 72 deletions.
26 changes: 20 additions & 6 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
# Do NOT update manually; changes here will be overwritten by Copier
_commit: v1.1.2
_src_path: git+https://github.com/shopinvader/shopinvader-addons-repo-template
black_version: 20.8b1
_commit: v1.14.2
_src_path: https://github.com/OCA/oca-addons-repo-template
ci: GitHub
dependency_installation_mode: PIP
generate_requirements_txt: true
odoo_version: '14.0'
prettify_xml: true
python_line_length: 88
github_check_license: false
github_ci_extra_env: {}
github_enable_codecov: true
github_enable_makepot: false
github_enable_stale_action: false
github_enforce_dev_status_compatibility: false
include_wkhtmltopdf: false
odoo_version: 14.0
org_name: Shopinvader
org_slug: shopinvader
rebel_module_groups: []
repo_description: null
repo_name: Pattern Import Export
repo_slug: pattern-import-export
repo_website: https://github.com/Shopinvader/pattern-import-export
travis_apt_packages: []
travis_apt_sources: []

11 changes: 9 additions & 2 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
env:
browser: true
es6: true

# See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449
parserOptions:
ecmaVersion: 2017
ecmaVersion: 2019

overrides:
- files:
- "**/*.esm.js"
parserOptions:
sourceType: module

# Globals available in Odoo that shouldn't produce errorings
globals:
Expand All @@ -14,7 +21,7 @@ globals:
moment: readonly
odoo: readonly
openerp: readonly
Promise: readonly
owl: readonly

# Styling is handled by Prettier, so we only need to enable AST rules;
# see https://github.com/OCA/maintainer-quality-tools/pull/618#issuecomment-558576890
Expand Down
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
max-line-length = 89
max-line-length = 88
max-complexity = 16
# B = bugbear
# B9 = bugbear opinionated (incl line length)
Expand Down
31 changes: 23 additions & 8 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,34 @@ name: pre-commit

on:
pull_request:
branches:
- "14.0*"
push:
branches:
- "14.0"
- "14.0-ocabot-*"

jobs:
pre-commit:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Get python version
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v1
with:
# The pylint-odoo version we use here does not support python 3.10
# https://github.com/OCA/oca-addons-repo-template/issues/80
# We also need to pin to an older version of python for older odoo versions
# where we are not using black > 21. Older black versions won't work with
# Python 3.9.8+, and we can't bump black without reformatting.
python-version: "3.9.7"
- uses: pre-commit/[email protected]
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure --color=always
- name: Check that all files generated by pre-commit are in git
run: |
newfiles="$(git ls-files --others --exclude-from=.gitignore)"
if [ "$newfiles" != "" ] ; then
echo "Please check-in the following files:"
echo "$newfiles"
exit 1
fi
7 changes: 5 additions & 2 deletions .github/workflows/pre-commit.yml.rej
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
diff a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml (rejected hunks)
@@ -12,2 +12,6 @@ jobs:
@@ -12,2 +12,9 @@ jobs:
- uses: actions/setup-python@v2
+ with:
+ # The pylint-odoo version we use here does not support python 3.10
+ # https://github.com/OCA/oca-addons-repo-template/issues/80
+ python-version: "3.9"
+ # We also need to pin to an older version of python for older odoo versions
+ # where we are not using black > 21. Older black versions won't work with
+ # Python 3.9.8+, and we can't bump black without reformatting.
+ python-version: "3.9.7"
- uses: pre-commit/[email protected]
32 changes: 26 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,45 @@
name: test Odoo addons
name: tests

on:
pull_request:
branches:
- "14.0*"
push:
branches:
- "14.0*"
- "14.0"
- "14.0-ocabot-*"

jobs:
test:
unreleased-deps:
runs-on: ubuntu-latest
name: Detect unreleased dependencies
steps:
- uses: actions/checkout@v2
- run: |
for reqfile in requirements.txt test-requirements.txt ; do
if [ -f ${reqfile} ] ; then
result=0
# reject non-comment lines that contain a / (i.e. URLs, relative paths)
grep "^[^#].*/" ${reqfile} || result=$?
if [ $result -eq 0 ] ; then
echo "Unreleased dependencies found in ${reqfile}."
exit 1
fi
fi
done
test:
runs-on: ubuntu-22.04
container: ${{ matrix.container }}
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- container: ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest
makepot: "true"
makepot: "false"
name: test with Odoo
- container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest
name: test with OCB
services:
postgres:
image: postgres:9.6
Expand All @@ -28,8 +49,6 @@ jobs:
POSTGRES_DB: odoo
ports:
- 5432:5432
env:
PIP_EXTRA_INDEX_URL: "https://wheelhouse.shopinvader.com/simple/"
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -38,6 +57,7 @@ jobs:
run: oca_install_addons
- name: Check licenses
run: manifestoo -d . check-licenses
continue-on-error: true
- name: Check development status
run: manifestoo -d . check-dev-status --default-dev-status=Beta
continue-on-error: true
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ build/
develop-eggs/
dist/
eggs/
lib/
lib64/
parts/
sdist/
Expand Down
1 change: 1 addition & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ known_odoo=odoo
known_odoo_addons=odoo.addons
sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER
default_section=THIRDPARTY
ensure_newline_before_comments = True
38 changes: 23 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exclude: |
# Files and folders generated by bots, to avoid loops
^setup/|/static/description/index\.html$|
# We don't want to mess with tool-generated files
.svg$|.copier-answers.yml|/tests/([^/]+/)?cassettes/|^.github/|
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|
# Maybe reactivate this when all README files include prettier ignore tags?
^README\.md$|
# Library files can have extraneous formatting (even minimized)
Expand All @@ -27,20 +27,31 @@ repos:
entry: found forbidden files; remove them
language: fail
files: "\\.rej$"
- id: en-po-files
name: en.po files cannot exist
entry: found a en.po file
language: fail
files: '[a-zA-Z0-9_]*/i18n/en\.po$'
- repo: https://github.com/oca/maintainer-tools
rev: ab1d7f6
hooks:
# update the NOT INSTALLABLE ADDONS section above
- id: oca-update-pre-commit-excluded-addons
- id: oca-fix-manifest-website
args: ["https://github.com/shopinvader/pattern-import-export"]
args: ["https://github.com/Shopinvader/pattern-import-export"]
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
- id: autoflake
args: ["-i", "--ignore-init-module-imports"]
args:
- --expand-star-imports
- --ignore-init-module-imports
- --in-place
- --remove-all-unused-imports
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/psf/black
rev: "22.3.0"
rev: 22.3.0
hooks:
- id: black
args: [--line-length=88]
Expand Down Expand Up @@ -88,16 +99,17 @@ repos:
rev: v2.7.2
hooks:
- id: pyupgrade
args: ["--keep-percent-format"]
- repo: https://github.com/PyCQA/isort
rev: 5.5.1
rev: 5.12.0
hooks:
- id: isort
name: isort except __init__.py
args:
- --settings=.
exclude: /__init__\.py$
- repo: https://github.com/acsone/setuptools-odoo
rev: 2.6.0
rev: 3.1.8
hooks:
- id: setuptools-odoo-make-default
- id: setuptools-odoo-get-requirements
Expand All @@ -106,25 +118,21 @@ repos:
- requirements.txt
- --header
- "# generated from manifests external_dependencies"
- repo: https://gitlab.com/PyCQA/flake8
- repo: https://github.com/PyCQA/flake8
rev: 3.8.3
hooks:
- id: flake8
name: flake8
additional_dependencies: ["flake8-bugbear==20.1.4"]
- repo: https://github.com/PyCQA/pylint
rev: pylint-2.5.3
- repo: https://github.com/OCA/pylint-odoo
rev: 7.0.2
hooks:
- id: pylint
- id: pylint_odoo
name: pylint with optional checks
args:
- --rcfile=.pylintrc
- --exit-zero
verbose: true
additional_dependencies: &pylint_deps
- pylint-odoo==3.5.0
- id: pylint
name: pylint with mandatory checks
- id: pylint_odoo
args:
- --rcfile=.pylintrc-mandatory
additional_dependencies: *pylint_deps
3 changes: 3 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@


[MASTER]
load-plugins=pylint_odoo
score=n

[ODOOLINT]
readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst"
manifest_required_authors=Shopinvader
manifest_required_keys=license
manifest_deprecated_keys=description,active
license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3
Expand Down
2 changes: 2 additions & 0 deletions .pylintrc-mandatory
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@

[MASTER]
load-plugins=pylint_odoo
score=n

[ODOOLINT]
readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst"
manifest_required_authors=Shopinvader
manifest_required_keys=license
manifest_deprecated_keys=description,active
license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3
Expand Down
10 changes: 0 additions & 10 deletions CONTRIBUTING.md

This file was deleted.

17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
[![Runbot Status](https://runbot.odoo-community.org/runbot/badge/flat//12.0.svg)](https://runbot.odoo-community.org/runbot/repo/github-com-oca-pattern-import-export-)
[![Build Status](https://travis-ci.com/OCA/pattern-import-export.svg?branch=12.0)](https://travis-ci.com/OCA/pattern-import-export)
[![codecov](https://codecov.io/gh/OCA/pattern-import-export/branch/12.0/graph/badge.svg)](https://codecov.io/gh/OCA/pattern-import-export)
[![Translation Status](https://translation.odoo-community.org/widgets/pattern-import-export-12-0/-/svg-badge.svg)](https://translation.odoo-community.org/engage/pattern-import-export-12-0/?utm_source=widget)

<!-- /!\ Non OCA Context : Set here the badge of your runbot / runboat instance. -->
[![Pre-commit Status](https://github.com/shopinvader/pattern-import-export/actions/workflows/pre-commit.yml/badge.svg?branch=14.0)](https://github.com/shopinvader/pattern-import-export/actions/workflows/pre-commit.yml?query=branch%3A14.0)
[![Build Status](https://github.com/shopinvader/pattern-import-export/actions/workflows/test.yml/badge.svg?branch=14.0)](https://github.com/shopinvader/pattern-import-export/actions/workflows/test.yml?query=branch%3A14.0)
[![codecov](https://codecov.io/gh/shopinvader/pattern-import-export/branch/14.0/graph/badge.svg)](https://codecov.io/gh/shopinvader/pattern-import-export)
<!-- /!\ Non OCA Context : Set here the badge of your translation instance. -->

<!-- /!\ do not modify above this line -->

# Pattern Import Export

Import Export Xlsx or csv file easily
None

<!-- /!\ do not modify below this line -->

Expand All @@ -33,6 +35,9 @@ addon | version | maintainers | summary

This repository is licensed under [AGPL-3.0](LICENSE).

However, each module can have a totally different license, as long as they adhere to OCA
However, each module can have a totally different license, as long as they adhere to Shopinvader
policy. Consult each module's `__manifest__.py` file, which contains a `license` key
that explains its license.

----
<!-- /!\ Non OCA Context : Set here the full description of your organization. -->
4 changes: 0 additions & 4 deletions oca_dependencies.txt

This file was deleted.

2 changes: 1 addition & 1 deletion pattern_import_export/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"version": "14.0.2.4.2",
"category": "Extra Tools",
"author": "Akretion",
"website": "https://github.com/shopinvader/pattern-import-export",
"website": "https://github.com/Shopinvader/pattern-import-export",
"license": "AGPL-3",
"depends": [
"jsonifier",
Expand Down
2 changes: 1 addition & 1 deletion pattern_import_export_csv/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"version": "14.0.1.1.0",
"category": "Extra Tools",
"author": "Akretion",
"website": "https://github.com/shopinvader/pattern-import-export",
"website": "https://github.com/Shopinvader/pattern-import-export",
"license": "AGPL-3",
"depends": ["pattern_import_export"],
"demo": ["demo/demo.xml"],
Expand Down
2 changes: 1 addition & 1 deletion pattern_import_export_custom_header/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"summary": "Allow to use custom headers names in export files",
"version": "14.0.1.0.1",
"category": "Extra Tools",
"website": "https://github.com/shopinvader/pattern-import-export",
"website": "https://github.com/Shopinvader/pattern-import-export",
"author": "Akretion",
"license": "AGPL-3",
"application": False,
Expand Down
Loading

0 comments on commit b1d9209

Please sign in to comment.