Skip to content

Commit

Permalink
Implement plone/meta
Browse files Browse the repository at this point in the history
  • Loading branch information
ericof committed Jun 23, 2023
1 parent a657c66 commit f5085af
Show file tree
Hide file tree
Showing 18 changed files with 565 additions and 179 deletions.
24 changes: 20 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

# EditorConfig Configurtaion file, for more details see:
# https://EditorConfig.org
# Generated from:
# https://github.com/plone/meta/tree/master/config/default
# See the inline comments on how to expand/tweak this configuration file
#
# EditorConfig Configuration file, for more details see:
# http://EditorConfig.org
# EditorConfig is a convention description, that could be interpreted
# by multiple editors to enforce common coding conventions for specific
# file types
Expand All @@ -26,7 +29,11 @@ max_line_length = off
# 4 space indentation
indent_size = 4

[*.{html,dtml,pt,zpt,xml,zcml,js,json,less,css,yml,yaml}]
[*.{yml,zpt,pt,dtml,zcml}]
# 2 space indentation
indent_size = 2

[*.{json,jsonl,js,jsx,ts,tsx,css,less,scss,html}] # Frontend development
# 2 space indentation
indent_size = 2

Expand All @@ -35,3 +42,12 @@ indent_size = 2
indent_style = tab
indent_size = unset
tab_width = unset


##
# Add extra configuration options in .meta.toml:
# [editorconfig]
# extra_lines = """
# _your own configuration lines_
# """
##
22 changes: 22 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated from:
# https://github.com/plone/meta/tree/master/config/default
# See the inline comments on how to expand/tweak this configuration file
[flake8]
doctests = 1
ignore =
# black takes care of line length
E501,
# black takes care of where to break lines
W503,
# black takes care of spaces within slicing (list[:])
E203,
# black takes care of spaces after commas
E231,

##
# Add extra configuration options in .meta.toml:
# [flake8]
# extra_lines = """
# _your own configuration lines_
# """
##
68 changes: 0 additions & 68 deletions .github/workflows/code-analysis.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated from:
# https://github.com/plone/meta/tree/master/config/default
# See the inline comments on how to expand/tweak this configuration file
name: Meta
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
workflow_dispatch:

jobs:
qa:
uses: plone/meta/.github/workflows/qa.yml@master
test:
uses: plone/meta/.github/workflows/test.yml@master
coverage:
uses: plone/meta/.github/workflows/coverage.yml@master
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
25 changes: 0 additions & 25 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: Test Package and create Docker Image

on: [push]
Expand All @@ -11,33 +10,9 @@ env:
IMAGE_PLATFORMS: linux/amd64,linux/arm64

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Plone ${{ env.PLONE_VERSION }} with Python ${{ env.PYTHON_VERSION }}
id: setup
uses: plone/setup-plone@v2.0.0
with:
python-version: ${{ env.PYTHON_VERSION }}
plone-version: ${{ env.PLONE_VERSION }}

# Install collective.ploneintranet with test extras
- name: Install collective.ploneintranet
run: |
pip install mxdev
mxdev -c mx.ini
pip install -r requirements-mxdev.txt
# test
- name: Test Codebase
run: |
pytest --disable-warnings

release:
runs-on: ubuntu-latest
needs: [tests]
permissions:
contents: read
packages: write
Expand Down
52 changes: 46 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,51 @@
# Generated from:
# https://github.com/plone/meta/tree/master/config/default
# See the inline comments on how to expand/tweak this configuration file
# python related
*.egg-info
*.pyc
*.pyo

# tools related
build/
.coverage
coverage.xml
dist/
docs/_build
__pycache__/
.tox
.vscode/
node_modules/

# venv / buildout related
bin/
develop-eggs/
eggs/
.eggs/
etc/
.installed.cfg
include/
instance/
lib/
lib64/
pip-selfcheck.json
.pytest_cache
*/__pycache__/
lib64
.mr.developer.cfg
parts/
pyvenv.cfg
*-mxdev.txt
var/

# mxdev
/instance/
/.make-sentinels/
/*-mxdev.txt
/reports/
/sources/
/venv/
.installed.txt


##
# Add extra configuration options in .meta.toml:
# [gitignore]
# extra_lines = """
# _your own configuration lines_
# """
##
18 changes: 18 additions & 0 deletions .meta.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated from:
# https://github.com/plone/meta/tree/master/config/default
# See the inline comments on how to expand/tweak this configuration file
[meta]
template = "default"
commit-id = "7983e3d9"

[pyproject]
codespell_skip = "*.min.js"
codespell_ignores = "vew"
dependencies_ignores = "['plone.volto', 'zestreleaser.towncrier', 'zest.releaser', 'pytest', 'pytest-cov', 'pytest-plone']"
dependencies_mappings = [
"Plone = ['Products.CMFPlone', 'Products.CMFCore', 'Products.GenericSetup']",
]

[tox]
test_runner = "pytest"
test_path = "/tests"
84 changes: 84 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Generated from:
# https://github.com/plone/meta/tree/master/config/default
# See the inline comments on how to expand/tweak this configuration file
ci:
autofix_prs: false
autoupdate_schedule: monthly

repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.4.0
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/collective/zpretty
rev: 3.1.0a2
hooks:
- id: zpretty

##
# Add extra configuration options in .meta.toml:
# [pre_commit]
# zpretty_extra_lines = """
# _your own configuration lines_
# """
##
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8

##
# Add extra configuration options in .meta.toml:
# [pre_commit]
# flake8_extra_lines = """
# _your own configuration lines_
# """
##
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
additional_dependencies:
- tomli

##
# Add extra configuration options in .meta.toml:
# [pre_commit]
# codespell_extra_lines = """
# _your own configuration lines_
# """
##
- repo: https://github.com/mgedmin/check-manifest
rev: "0.49"
hooks:
- id: check-manifest
- repo: https://github.com/regebro/pyroma
rev: "4.2"
hooks:
- id: pyroma
- repo: https://github.com/mgedmin/check-python-versions
rev: "0.21.2"
hooks:
- id: check-python-versions
args: ['--only', 'setup.py,pyproject.toml']
- repo: https://github.com/collective/i18ndude
rev: "6.0.0"
hooks:
- id: i18ndude

##
# Add extra configuration options in .meta.toml:
# [pre_commit]
# extra_lines = """
# _your own configuration lines_
# """
##
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ FROM plone/server-prod-config:${PLONE_VERSION}

LABEL maintainer="Plone Collective <collective@plone.org>" \
org.label-schema.name="collective/plone-intranet:backend" \
org.label-schema.description="Plone Intranet distribtuion backend." \
org.label-schema.description="Plone Intranet distribution backend." \
org.label-schema.vendor="Plone Foundation"

# Disable MO Compilation
Expand All @@ -32,4 +32,4 @@ COPY --from=builder /app /app

RUN <<EOT
ln -s /data /app/var
EOT
EOT
Loading

0 comments on commit f5085af

Please sign in to comment.