Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pyproject.toml instead of setup.py #216

Merged
merged 1 commit into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ dependency_installation_mode:
help: Choose how to install module dependencies.
when: *ci_is_travis

use_pyproject_toml:
default: no
type: bool
help: Use pyproject.toml instead of setup.py.
when: "{{ odoo_version >= 14.0 }}"

generate_requirements_txt:
default: yes
type: bool
Expand Down
17 changes: 14 additions & 3 deletions src/.pre-commit-config.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{%- set repo_rev.flake8 = "3.8.3" %}
{%- set repo_rev.flake8_bugbear = "20.1.4" %}
{%- set repo_rev.isort = "5.12.0" %}
{%- set repo_rev.maintainer_tools = "969238e47c07d0c40573acff81d170f63245d738" %}
{%- set repo_rev.maintainer_tools = "568cacd1d6eef453063a524a5ce63dcd49c7259b" %}
{%- set repo_rev.nodejs = "14.13.0" %}
{%- set repo_rev.odoo_pre_commit_hooks = "v0.0.25" %}
{%- set repo_rev.pre_commit_hooks = "v3.2.0" %}
Expand All @@ -26,7 +26,7 @@
{%- set repo_rev.flake8 = "3.9.2" %}
{%- set repo_rev.flake8_bugbear = "21.9.2" %}
{%- set repo_rev.isort = "5.12.0" %}
{%- set repo_rev.maintainer_tools = "969238e47c07d0c40573acff81d170f63245d738" %}
{%- set repo_rev.maintainer_tools = "568cacd1d6eef453063a524a5ce63dcd49c7259b" %}
{%- set repo_rev.nodejs = "14.18.0" %}
{%- set repo_rev.odoo_pre_commit_hooks = "v0.0.25" %}
{%- set repo_rev.pre_commit_hooks = "v4.0.1" %}
Expand All @@ -43,7 +43,7 @@
{%- set repo_rev.flake8 = "3.9.2" %}
{%- set repo_rev.flake8_bugbear = "21.9.2" %}
{%- set repo_rev.isort = "5.12.0" %}
{%- set repo_rev.maintainer_tools = "969238e47c07d0c40573acff81d170f63245d738" %}
{%- set repo_rev.maintainer_tools = "568cacd1d6eef453063a524a5ce63dcd49c7259b" %}
{%- set repo_rev.nodejs = "16.17.0" %}
{%- set repo_rev.odoo_pre_commit_hooks = "v0.0.25" %}
{%- set repo_rev.pre_commit_hooks = "v4.3.0" %}
Expand Down Expand Up @@ -101,6 +101,12 @@ repos:
entry: found a en.po file
language: fail
files: '[a-zA-Z0-9_]*/i18n/en\.po$'
{%- if use_pyproject_toml %}
- repo: https://github.com/sbidoul/whool
rev: v0.5
hooks:
- id: whool-init
{%- endif %}
- repo: https://github.com/oca/maintainer-tools
rev: {{ repo_rev.maintainer_tools }}
hooks:
Expand All @@ -115,6 +121,9 @@ repos:
- --org-name={{ org_slug }}
- --repo-name={{ repo_slug }}
- --if-source-changed
{%- if use_pyproject_toml and generate_requirements_txt %}
- id: oca-gen-external-dependencies
{%- endif %}
- repo: https://github.com/OCA/odoo-pre-commit-hooks
rev: {{ repo_rev.odoo_pre_commit_hooks }}
hooks:
Expand Down Expand Up @@ -195,6 +204,7 @@ repos:
- --settings=.
exclude: /__init__\.py$
{%- endif %}
{%- if not use_pyproject_toml %}
- repo: https://github.com/acsone/setuptools-odoo
rev: {{ repo_rev.setuptools_odoo }}
hooks:
Expand All @@ -207,6 +217,7 @@ repos:
- --header
- "# generated from manifests external_dependencies"
{%- endif %}
{%- endif %}
{%- if not use_ruff %}
- repo: https://github.com/PyCQA/flake8
rev: {{ repo_rev.flake8 }}
Expand Down