Skip to content

Commit

Permalink
Apply plone/meta.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericof committed Nov 13, 2023
1 parent f49e930 commit 73f1664
Show file tree
Hide file tree
Showing 10 changed files with 133 additions and 19 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ indent_size = 2
[*.{json,jsonl,js,jsx,ts,tsx,css,less,scss,html}] # Frontend development
# 2 space indentation
indent_size = 2
max_line_length = 80

[{Makefile,.gitmodules}]
# Tab indentation (no size specified, but view as 4 spaces)
Expand Down
54 changes: 46 additions & 8 deletions .github/workflows/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,54 @@ on:
- main
workflow_dispatch:

##
# To set environment variables for all jobs, add in .meta.toml:
# [github]
# env = """
# debug: 1
# image-name: 'org/image'
# image-tag: 'latest'
# """
##

jobs:
qa:
uses: plone/meta/.github/workflows/qa.yml@master
uses: plone/meta/.github/workflows/qa.yml@1.0.0
test:
uses: plone/meta/.github/workflows/test.yml@master
uses: plone/meta/.github/workflows/test.yml@1.0.0
coverage:
uses: plone/meta/.github/workflows/coverage.yml@master
uses: plone/meta/.github/workflows/coverage.yml@1.0.0
dependencies:
uses: plone/meta/.github/workflows/dependencies.yml@master
release-ready:
uses: plone/meta/.github/workflows/release_ready.yml@master
circular:
uses: plone/meta/.github/workflows/circular.yml@master
uses: plone/meta/.github/workflows/[email protected]
release_ready:
uses: plone/meta/.github/workflows/[email protected]

##
# To modify the list of default jobs being created add in .meta.toml:
# [github]
# jobs = [
# "qa",
# "test",
# "coverage",
# "dependencies",
# "release_ready",
# "circular",
# ]
##

##
# To request that some OS level dependencies get installed
# when running tests/coverage jobs, add in .meta.toml:
# [github]
# os_dependencies = "git libxml2 libxslt"
##


##
# Specify additional jobs in .meta.toml:
# [github]
# extra_lines = """
# another:
# uses: org/repo/.github/workflows/file.yml@main
# """
##
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
*.egg-info
*.pyc
*.pyo

# translation related
*.mo

# tools related
build/
.coverage
.*project
coverage.xml
dist/
docs/_build
Expand Down
12 changes: 11 additions & 1 deletion .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# See the inline comments on how to expand/tweak this configuration file
[meta]
template = "default"
commit-id = "7983e3d9"
commit-id = "8c30aa23"

[pyproject]
codespell_skip = "*.min.js"
Expand All @@ -16,3 +16,13 @@ dependencies_mappings = [
[tox]
test_runner = "pytest"
test_path = "/tests"

[github]
ref = "1.0.0"
jobs = [
"qa",
"test",
"coverage",
"dependencies",
"release_ready",
]
24 changes: 17 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ci:

repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.4.0
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py38-plus]
Expand All @@ -16,11 +16,11 @@ repos:
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.10.1
hooks:
- id: black
- repo: https://github.com/collective/zpretty
rev: 3.1.0a2
rev: 3.1.0
hooks:
- id: zpretty

Expand All @@ -32,7 +32,7 @@ repos:
# """
##
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8

Expand All @@ -44,7 +44,7 @@ repos:
# """
##
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies:
Expand All @@ -66,15 +66,25 @@ repos:
hooks:
- id: pyroma
- repo: https://github.com/mgedmin/check-python-versions
rev: "0.21.2"
rev: "0.22.0"
hooks:
- id: check-python-versions
args: ['--only', 'setup.py,pyproject.toml']
- repo: https://github.com/collective/i18ndude
rev: "6.0.0"
rev: "6.1.0"
hooks:
- id: i18ndude


##
# Add extra configuration options in .meta.toml:
# [pre_commit]
# i18ndude_extra_lines = """
# _your own configuration lines_
# """
##


##
# Add extra configuration options in .meta.toml:
# [pre_commit]
Expand Down
15 changes: 15 additions & 0 deletions news/.changelog_template.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% if sections[""] %}
{% for category, val in definitions.items() if category in sections[""] %}

### {{ definitions[category]['name'] }}

{% for text, values in sections[""][category].items() %}
- {{ text }} {{ values|join(', ') }}
{% endfor %}

{% endfor %}
{% else %}
No significant changes.


{% endif %}
Empty file added news/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions news/7.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Apply plone/meta [@ericof]
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Generated from:
# https://github.com/plone/meta/tree/master/config/default
# See the inline comments on how to expand/tweak this configuration file
[build-system]
requires = ["setuptools>=68.2"]

[tool.towncrier]
directory = "news/"
filename = "CHANGES.md"
Expand Down Expand Up @@ -129,7 +132,6 @@ Plone = ['Products.CMFPlone', 'Products.CMFCore', 'Products.GenericSetup']
# "gitpython = ['git']",
# "pygithub = ['github']",
# ]
# """
##

[tool.check-manifest]
Expand Down
38 changes: 36 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@ commands =
echo "Unrecognized environment name {envname}"
false

##
# Add extra configuration options in .meta.toml:
# [tox]
# testenv_options = """
# basepython = /usr/bin/python3.8
# """
##

[testenv:init]
description = Prepare environment
skip_install = true
commands =
echo "Initial setup complete"


[testenv:format]
description = automatically reformat code
skip_install = true
Expand All @@ -58,7 +73,7 @@ deps =
build
z3c.dependencychecker==2.11
commands =
python -m build --sdist --no-isolation
python -m build --sdist
dependencychecker

[testenv:dependencies-graph]
Expand Down Expand Up @@ -86,12 +101,24 @@ set_env =
# test_environment_variables = """
# PIP_EXTRA_INDEX_URL=https://my-pypi.my-server.com/
# """
#
# Set constrain_package_deps .meta.toml:
# [tox]
# constrain_package_deps = false
##
deps =
pytest-plone
pytest
-c https://dist.plone.org/release/6.0-dev/constraints.txt


##
# Specify additional deps in .meta.toml:
# [tox]
# test_deps_additional = """
# -esources/plonegovbr.portal_base[test]
# """
#
# Specify a custom constraints file in .meta.toml:
# [tox]
# constraints_file = "https://my-server.com/constraints.txt"
Expand All @@ -116,12 +143,17 @@ set_env =
# test_environment_variables = """
# PIP_EXTRA_INDEX_URL=https://my-pypi.my-server.com/
# """
#
# Set constrain_package_deps .meta.toml:
# [tox]
# constrain_package_deps = "false"
##
deps =
pytest-plone
pytest
coverage
-c https://dist.plone.org/release/6.0-dev/constraints.txt

commands =
coverage run --source kitconcept.intranet -m pytest {posargs} --disable-warnings {toxinidir}/tests
coverage report -m --format markdown
Expand All @@ -138,12 +170,13 @@ deps =
build
towncrier
-c https://dist.plone.org/release/6.0-dev/constraints.txt

commands =
# fake version to not have to install the package
# we build the change log as news entries might break
# the README that is displayed on PyPI
towncrier build --version=100.0.0 --yes
python -m build --sdist --no-isolation
python -m build --sdist
twine check dist/*

[testenv:circular]
Expand All @@ -165,6 +198,7 @@ deps =
pipdeptree
pipforester
-c https://dist.plone.org/release/6.0-dev/constraints.txt

commands =
# Generate the full dependency tree
sh -c 'pipdeptree -j > forest.json'
Expand Down

0 comments on commit 73f1664

Please sign in to comment.