Skip to content

Commit

Permalink
ci(pre-commit): replace local hook pip-compile by official hook
Browse files Browse the repository at this point in the history
- removed pip-tools from dev dependencies
  • Loading branch information
tomassebestik committed Oct 8, 2024
1 parent db76c6e commit c31f5d5
Show file tree
Hide file tree
Showing 5 changed files with 163 additions and 118 deletions.
15 changes: 9 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,14 @@ repos:
hooks:
- id: yamlfix

- repo: local
- repo: https://github.com/jazzband/pip-tools
rev: '7.4.1'
hooks:
- id: pip-compile
name: compile requirements.txt
entry: bash -c 'pip-compile --strip-extras --output-file=requirements.txt pyproject.toml > /dev/null'
language: system
pass_filenames: false
files: requirements.txt|pyproject.toml
name: pip-compile requirements.txt # Only project.dependencies
files: ^(requirements\.txt|pyproject\.toml)$
args: [--output-file=requirements.txt]
- id: pip-compile
name: pip-compile requirements-all.txt # Including all project.optional-dependencies
files: ^(requirements-all\.txt|pyproject\.toml)$
args: [--output-file=requirements-all.txt, --all-extras]
146 changes: 68 additions & 78 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=64"]

[project]
authors = [
{ name = "Espressif Systems" },
{ name = "Tomas Sebestik", email = "[email protected]" },
]
authors = [{ name = "Espressif Systems" }, { name = "Tomas Sebestik", email = "[email protected]" }]
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
Expand All @@ -18,91 +19,80 @@
]
description = "Commitizen plugin with Espressif code style"
dynamic = ["version"]
entry-points."commitizen.plugin".czespressif = "czespressif:CzPluginEspressif"
license = { text = "Apache 2.0" }
name = "czespressif"
readme = "README.md"
requires-python = ">=3.9"
urls.Changelog = "https://github.com/espressif/cz-plugin-espressif/blob/master/CHANGELOG.md"
urls.Homepage = "https://github.com/espressif/cz-plugin-espressif/"
urls.Source = "https://github.com/espressif/cz-plugin-espressif/"
urls.Tracker = "https://github.com/espressif/cz-plugin-espressif/issues/"

dependencies = ["commitizen>=3.29.0"]

[project.optional-dependencies]
dev = ["just-bin~=1.26.0", "pip-tools~=7.3", "pre-commit~=3.3.0", "twine~=5.1.1"]
test = [
"pytest-cov~=4.1.0",
"pytest-mock~=3.14.0",
"pytest-sugar~=1.0.0",
"pytest~=7.4.0",
"syrupy~=4.7.0",
]

[project.entry-points."commitizen.plugin"]
czespressif = "czespressif:CzPluginEspressif"

[project.urls]
Changelog = "https://github.com/espressif/cz-plugin-espressif/blob/master/CHANGELOG.md"
Homepage = "https://github.com/espressif/cz-plugin-espressif/"
Source = "https://github.com/espressif/cz-plugin-espressif/"
Tracker = "https://github.com/espressif/cz-plugin-espressif/issues/"

[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=64"]

[tool.setuptools.packages.find]
where = ["."]
dependencies = ["commitizen>=3.29.0"]
optional-dependencies.dev = ["just-bin~=1.26.0", "pre-commit~=3.3.0", "twine~=5.1.1"]
optional-dependencies.test = ["pytest-cov~=4.1.0", "pytest-mock~=3.14.0", "pytest-sugar~=1.0.0", "pytest~=7.4.0", "syrupy~=4.7.0"]

[tool.setuptools.package-data]
czespressif = ["*.py", "templates/*"]
[tool]
[tool.setuptools]
dynamic.version = { attr = "czespressif.__init__.__version__" }
package-data.czespressif = ["*.py", "templates/*"]
packages.find.where = ["."]

[tool.setuptools.dynamic]
version = { attr = "czespressif.__init__.__version__" }
[tool.codespell]
skip = 'tests/*'

[tool.codespell]
skip = 'tests/*'
[tool.ruff]
extend-exclude = []
format.docstring-code-format = true
format.quote-style = "single"
line-length = 160
lint.exclude = ["tests/**/*"]
lint.isort.force-single-line = true
lint.isort.lines-between-types = 1
lint.select = ["B", "C4", "C901", "E", "F", "I", "N", "PL", "S", "UP", "W"]

[tool.ruff]
extend-exclude = []
format.docstring-code-format = true
format.quote-style = "single"
line-length = 160
lint.exclude = ["tests/**/*"]
lint.isort.force-single-line = true
lint.isort.lines-between-types = 1
lint.select = ["B", "C4", "C901", "E", "F", "I", "N", "PL", "S", "UP", "W"]
[tool.mypy]
exclude = ["^__init__.py$", "^build/.*", "^dist/.*", "^docs/.*", "^tests/.*"]
ignore_missing_imports = true
packages = "czespressif"
pretty = true
python_version = "3.9"
warn_redundant_casts = true
warn_return_any = true

[tool.mypy]
exclude = ["^__init__.py$", "^build/.*", "^dist/.*", "^docs/.*", "^tests/.*"]
ignore_missing_imports = true
packages = "czespressif"
pretty = true
python_version = "3.9"
warn_redundant_casts = true
warn_return_any = true
[tool.pytest]
ini_options.addopts = "-s --log-cli-level DEBUG --cov=czespressif --cov-report=term"
ini_options.markers = ["settings: mark test to use custom czespressif settings from pyproject.toml"]
ini_options.testpaths = "tests"

[tool.pytest.ini_options]
addopts = "-s --log-cli-level DEBUG --cov=czespressif --cov-report=term"
markers = ["settings: mark test to use custom czespressif settings from pyproject.toml"]
testpaths = "tests"
[tool.coverage]
run.branch = true
run.omit = ["*/tests/*", "__*__.py"]
run.parallel = true
run.source = ["czespressif"]

[tool.coverage.run]
omit = ["*/tests/*", "__*__.py"]
[tool.yamlfix]
comments_min_spaces_from_content = 1
line_length = 200
preserve_quotes = true
section_whitelines = 1
sequence_style = "keep_style"
whitelines = 1

[tool.yamlfix]
comments_min_spaces_from_content = 1
line_length = 200
preserve_quotes = true
section_whitelines = 1
sequence_style = "keep_style"
whitelines = 1
[tool.commitizen]
annotated_tag = true
bump_message = 'change(bump): release $current_version → $new_version [skip-ci]'
changelog_merge_prerelease = true
changelog_start_rev = "v0.1.0"
name = "czespressif"
tag_format = "v$version"
update_changelog_on_bump = true
version = "1.3.0"
version_files = ["czespressif/__init__.py:__version__"]
version_provider = "commitizen"

[tool.commitizen]
annotated_tag = true
bump_message = 'change(bump): release $current_version → $new_version [skip-ci]'
changelog_merge_prerelease = true
changelog_start_rev = "v0.1.0"
name = "czespressif"
tag_format = "v$version"
update_changelog_on_bump = true
version = "1.3.0"
version_files = ["czespressif/__init__.py:__version__"]
version_provider = "commitizen"
[tool.pip-tools]
allow-unsafe = true
annotation-style = "line"
strip-extras = true
68 changes: 68 additions & 0 deletions requirements-all.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile --all-extras --allow-unsafe --annotation-style=line --output-file=requirements-all.txt --strip-extras
#
argcomplete==3.5.1 # via commitizen
backports-tarfile==1.2.0 # via jaraco-context
certifi==2024.8.30 # via requests
cffi==1.17.1 # via cryptography
cfgv==3.4.0 # via pre-commit
charset-normalizer==3.3.2 # via commitizen, requests
colorama==0.4.6 # via commitizen
commitizen==3.29.1 # via czespressif (pyproject.toml)
coverage==7.6.1 # via pytest-cov
cryptography==43.0.1 # via secretstorage
decli==0.6.2 # via commitizen
distlib==0.3.8 # via virtualenv
docutils==0.21.2 # via readme-renderer
exceptiongroup==1.2.2 # via pytest
filelock==3.16.1 # via virtualenv
identify==2.6.1 # via pre-commit
idna==3.10 # via requests
importlib-metadata==8.5.0 # via commitizen, keyring, twine
iniconfig==2.0.0 # via pytest
jaraco-classes==3.4.0 # via keyring
jaraco-context==6.0.1 # via keyring
jaraco-functools==4.1.0 # via keyring
jeepney==0.8.0 # via keyring, secretstorage
jinja2==3.1.4 # via commitizen
just-bin==1.26.0 # via czespressif (pyproject.toml)
keyring==25.4.1 # via twine
markdown-it-py==3.0.0 # via rich
markupsafe==2.1.5 # via jinja2
mdurl==0.1.2 # via markdown-it-py
more-itertools==10.5.0 # via jaraco-classes, jaraco-functools
nh3==0.2.18 # via readme-renderer
nodeenv==1.9.1 # via pre-commit
packaging==24.1 # via commitizen, pytest, pytest-sugar
pkginfo==1.10.0 # via twine
platformdirs==4.3.6 # via virtualenv
pluggy==1.5.0 # via pytest
pre-commit==3.3.3 # via czespressif (pyproject.toml)
prompt-toolkit==3.0.36 # via questionary
pycparser==2.22 # via cffi
pygments==2.18.0 # via readme-renderer, rich
pytest==7.4.4 # via czespressif (pyproject.toml), pytest-cov, pytest-mock, pytest-sugar, syrupy
pytest-cov==4.1.0 # via czespressif (pyproject.toml)
pytest-mock==3.14.0 # via czespressif (pyproject.toml)
pytest-sugar==1.0.0 # via czespressif (pyproject.toml)
pyyaml==6.0.2 # via commitizen, pre-commit
questionary==2.0.1 # via commitizen
readme-renderer==44.0 # via twine
requests==2.32.3 # via requests-toolbelt, twine
requests-toolbelt==1.0.0 # via twine
rfc3986==2.0.0 # via twine
rich==13.9.2 # via twine
secretstorage==3.3.3 # via keyring
syrupy==4.7.2 # via czespressif (pyproject.toml)
termcolor==2.5.0 # via commitizen, pytest-sugar
tomli==2.0.2 # via coverage, pytest
tomlkit==0.13.2 # via commitizen
twine==5.1.1 # via czespressif (pyproject.toml)
typing-extensions==4.12.2 # via rich
urllib3==2.2.3 # via requests, twine
virtualenv==20.26.6 # via pre-commit
wcwidth==0.2.13 # via prompt-toolkit
zipp==3.20.2 # via importlib-metadata
50 changes: 17 additions & 33 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,21 @@
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile --output-file=requirements.txt --strip-extras pyproject.toml
# pip-compile --allow-unsafe --annotation-style=line --output-file=requirements.txt --strip-extras
#
argcomplete==3.5.0
# via commitizen
charset-normalizer==3.3.2
# via commitizen
colorama==0.4.6
# via commitizen
commitizen==3.29.0
# via czespressif (pyproject.toml)
decli==0.6.2
# via commitizen
importlib-metadata==8.4.0
# via commitizen
jinja2==3.1.4
# via commitizen
markupsafe==2.1.5
# via jinja2
packaging==24.1
# via commitizen
prompt-toolkit==3.0.36
# via questionary
pyyaml==6.0.2
# via commitizen
questionary==2.0.1
# via commitizen
termcolor==2.4.0
# via commitizen
tomlkit==0.13.2
# via commitizen
wcwidth==0.2.13
# via prompt-toolkit
zipp==3.20.1
# via importlib-metadata
argcomplete==3.5.0 # via commitizen
charset-normalizer==3.3.2 # via commitizen
colorama==0.4.6 # via commitizen
commitizen==3.29.0 # via czespressif (pyproject.toml)
decli==0.6.2 # via commitizen
importlib-metadata==8.4.0 # via commitizen
jinja2==3.1.4 # via commitizen
markupsafe==2.1.5 # via jinja2
packaging==24.1 # via commitizen
prompt-toolkit==3.0.36 # via questionary
pyyaml==6.0.2 # via commitizen
questionary==2.0.1 # via commitizen
termcolor==2.4.0 # via commitizen
tomlkit==0.13.2 # via commitizen
wcwidth==0.2.13 # via prompt-toolkit
zipp==3.20.1 # via importlib-metadata
2 changes: 1 addition & 1 deletion taplo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include = ["**/*.toml"]
align_entries = true
allowed_blank_lines = 1
array_auto_expand = true
column_width = 100
column_width = 150
indent_entries = true
indent_string = " "
indent_tables = true
Expand Down

0 comments on commit c31f5d5

Please sign in to comment.