Skip to content

Commit

Permalink
Initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
ale-rt committed Nov 27, 2023
0 parents commit 4941488
Show file tree
Hide file tree
Showing 31 changed files with 1,148 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[report]
include =
src/collective/*
omit =
*/test*
*/upgrades/*
53 changes: 53 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 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

# top-most EditorConfig file:
# Will ignore other EditorConfig files in Home directory or upper tree level.
root = true


[*] # For All Files
# Unix-style newlines with a newline ending every file
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
# Set default charset
charset = utf-8
# Indent style default
indent_style = space
# Max Line Length - a hard line wrap, should be disabled
max_line_length = off

[*.{py,cfg,ini}]
# 4 space indentation
indent_size = 4

[*.{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

[{Makefile,.gitmodules}]
# Tab indentation (no size specified, but view as 4 spaces)
indent_style = tab
indent_size = unset
tab_width = unset


##
# Add extra configuration options in .meta.toml:
# [editorconfig]
# extra_lines = """
# _your own configuration lines_
# """
##
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CHANGES.md merge=union
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
* collective.pdbpp version:
* Plone Version:
* Python version:
* Operating System: Linux

### Description

Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.

### What I Did

```
Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.
```
65 changes: 65 additions & 0 deletions .github/workflows/plone-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Plone package

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
plone-version:
- 'Plone52'
- 'Plone60'
python-version: [3.7, 3.8, 3.9]

steps:
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/buildout-cache
~/extends
key: ${{ runner.os }}-tox-${{ matrix.python-version }}-${{ matrix.plone-version }}-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/*.cfg') }}-${{ hashFiles('**/constraints.txt') }}-${{ hashFiles('**/tox.ini') }}
#restore-keys: |
# ${{ runner.os }}-tox-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: setup buildout cache
run: |
mkdir -p ~/buildout-cache/{eggs,downloads}
mkdir ~/.buildout
echo "[buildout]" > $HOME/.buildout/default.cfg
echo "download-cache = $HOME/buildout-cache/downloads" >> $HOME/.buildout/default.cfg
echo "eggs-directory = $HOME/buildout-cache/eggs" >> $HOME/.buildout/default.cfg
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Black-Check
run: |
tox -r -e black-check
- name: Test with tox
run: |
tox -r
env:
PLONE-VERSION: ${{ matrix.plone-version }}
PYTHON-VERSION: ${{ matrix.python-version }}
- name: "Upload coverage to Codecov"
uses: "codecov/codecov-action@v3"
with:
fail_ci_if_error: true
if: matrix.python-version == '3.7'
52 changes: 52 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 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.*
coverage.xml
dist/
docs/_build
__pycache__/
.tox
.vscode/
node_modules/

# venv / buildout related
bin/
develop-eggs/
eggs/
.eggs/
etc/
.installed.cfg
include/
lib/
lib64
.mr.developer.cfg
parts/
pyvenv.cfg
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_
# """
##
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_
# """
##
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog


## 1.0.0a1 (unreleased)

- Initial release.
[ale-rt]
4 changes: 4 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Contributors


- ale-rt, alessandro.pisa@gmail.com
83 changes: 83 additions & 0 deletions DEVELOP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Using the development buildout

## plonecli

The convenient way, use plonecli build ;):

```shell
$ plonecli build
```

or with `--clear`` if you want to clean your existing venv:

```shell
$ plonecli build --clear
```

Start your instance:

```shell
$ plonecli serve
```

# Without plonecli

Create a virtualenv in the package:

```shell
$ python3 -m venv venv
```

or with `--clear` if you want to clean your existing venv:

```shell
$ python3 -m venv venv --clear
```

Install requirements with pip:

```shell
$ ./venv/bin/pip install -r requirements.txt
```

Run buildout:

```shell
$ ./venv.bin/buildout
```

Start Plone in foreground:

```shell
$ ./bin/instance fg
```

# Running tests

Run the tests with tox:

```shell
$ tox
```

list all tox environments:

```shell
$ tox -l
py38-Plone52
py39-Plone60
py310-Plone60
py311-Plone60
```

Run a specific tox environment:

```shell
$ tox -e py37-Plone52
```

# CI Github-Actions / codecov

The first time you push the repo to github, you might get an error from
codecov. Either you activate the package here:
https://app.codecov.io/gh/collective/+ Or you just wait a bit, codecov will activate your package automatically.
Loading

0 comments on commit 4941488

Please sign in to comment.