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

Configuring with plone/meta #57

Merged
merged 4 commits into from
May 23, 2024
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
10 changes: 6 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Generated from:
# https://github.com/plone/meta/tree/master/config/default
# https://github.com/plone/meta/tree/main/config/default
# See the inline comments on how to expand/tweak this configuration file
#
# EditorConfig Configuration file, for more details see:
Expand All @@ -13,7 +13,8 @@
root = true


[*] # For All Files
[*]
# Default settings for all files.
# Unix-style newlines with a newline ending every file
end_of_line = lf
insert_final_newline = true
Expand All @@ -29,11 +30,12 @@ max_line_length = off
# 4 space indentation
indent_size = 4

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

[*.{json,jsonl,js,jsx,ts,tsx,css,less,scss,html}] # Frontend development
[*.{json,jsonl,js,jsx,ts,tsx,css,less,scss}]
# Frontend development
# 2 space indentation
indent_size = 2
max_line_length = 80
Expand Down
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Generated from:
# https://github.com/plone/meta/tree/master/config/default
# https://github.com/plone/meta/tree/main/config/default
# See the inline comments on how to expand/tweak this configuration file
[flake8]
doctests = 1
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/meta.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Generated from:
# https://github.com/plone/meta/tree/master/config/default
# https://github.com/plone/meta/tree/main/config/default
# See the inline comments on how to expand/tweak this configuration file
name: Meta
on:
Expand Down Expand Up @@ -55,6 +55,13 @@ jobs:
# os_dependencies = "git libxml2 libxslt"
##

##
# To test against a specific matrix of python versions
# when running tests jobs, add in .meta.toml:
# [github]
# py_versions = "['3.12', '3.11']"
##


##
# Specify additional jobs in .meta.toml:
Expand Down
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Generated from:
# https://github.com/plone/meta/tree/master/config/default
# https://github.com/plone/meta/tree/main/config/default
# See the inline comments on how to expand/tweak this configuration file
# python related
*.egg-info
Expand Down Expand Up @@ -35,6 +35,7 @@ lib64
parts/
pyvenv.cfg
var/
local.cfg

# mxdev
/instance/
Expand All @@ -47,6 +48,11 @@ var/

requirements-mxdev.txt

/.python-version
/dependencies.svg
/forest.*


##
# Add extra configuration options in .meta.toml:
# [gitignore]
Expand Down
4 changes: 2 additions & 2 deletions .meta.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Generated from:
# https://github.com/plone/meta/tree/master/config/default
# https://github.com/plone/meta/tree/main/config/default
# See the inline comments on how to expand/tweak this configuration file
[meta]
template = "default"
commit-id = "8c30aa23"
commit-id = "721299ce"

[pyproject]
codespell_skip = "*.min.js,*.pot,*.po,*.yaml,*.json"
Expand Down
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Generated from:
# https://github.com/plone/meta/tree/master/config/default
# https://github.com/plone/meta/tree/main/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.15.0
rev: v3.15.2
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.10.1
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/collective/zpretty
Expand All @@ -32,7 +32,7 @@ repos:
# """
##
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8

Expand Down Expand Up @@ -71,7 +71,7 @@ repos:
- id: check-python-versions
args: ['--only', 'setup.py,pyproject.toml']
- repo: https://github.com/collective/i18ndude
rev: "6.1.0"
rev: "6.2.0"
hooks:
- id: i18ndude

Expand Down
11 changes: 11 additions & 0 deletions dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Generated from:
# https://github.com/plone/meta/tree/main/config/default
# See the inline comments on how to expand/tweak this configuration file
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
1 change: 1 addition & 0 deletions news/+meta.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update configuration files @plone
15 changes: 11 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Generated from:
# https://github.com/plone/meta/tree/master/config/default
# https://github.com/plone/meta/tree/main/config/default
# See the inline comments on how to expand/tweak this configuration file
[build-system]
requires = ["setuptools>=68.2"]
Expand Down Expand Up @@ -122,7 +122,7 @@ Zope = [
'Products.CMFCore', 'Products.CMFDynamicViewFTI',
]
python-dateutil = ['dateutil']
ignore-packages = ['plone.restapi', 'plone.volto', 'zestreleaser.towncrier', 'zest.releaser', 'pytest', 'pytest-cov', 'pytest-plone', 'pytest-docker', 'pytest-vcr', 'pytest-mock', 'gocept.pytestlayer', 'requests-mock', 'vcrpy']
ignore-packages = ['plone.restapi', 'plone.volto', 'zestreleaser.towncrier', 'zest.releaser', 'pytest', 'pytest-cov', 'pytest-plone', 'pytest-docker', 'pytest-vcr', 'pytest-mock', 'zope.pytestlayer', 'requests-mock', 'vcrpy']
Plone = ['Products.CMFPlone', 'Products.CMFCore', 'Products.GenericSetup', 'Products.PluggableAuthService', 'Products.PlonePAS']

##
Expand All @@ -138,23 +138,30 @@ Plone = ['Products.CMFPlone', 'Products.CMFCore', 'Products.GenericSetup', 'Prod
[tool.check-manifest]
ignore = [
".editorconfig",
".flake8",
".meta.toml",
".pre-commit-config.yaml",
"tox.ini",
".flake8",
"dependabot.yml",
"mx.ini",
"tox.ini",
"news/*",
"constraints-mxdev.txt",
"requirements-mxdev.txt",

]

##
# Add extra configuration options in .meta.toml:
# [pyproject]
# check_manifest_ignores = """
# "*.map.js",
# "*.pyc",
# """
# check_manifest_extra_lines = """
# ignore-bad-ideas = [
# "some/test/file/PKG-INFO",
# ]
# """
##

[tool.coverage.run]
Expand Down
9 changes: 8 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Installer for the pas.plugins.oidc package."""

from pathlib import Path
from setuptools import find_packages
from setuptools import setup
Expand Down Expand Up @@ -52,15 +53,21 @@
install_requires=[
"setuptools",
"Plone",
"Zope",
"Products.CMFCore",
"plone.api",
"plone.base",
"plone.protect",
"plone.restapi>=8.34.0",
"oic",
],
extras_require={
"test": [
"gocept.pytestlayer",
"zope.pytestlayer",
"plone.app.contenttypes",
"plone.app.testing",
"plone.restapi[test]",
"plone.testing",
"pytest-cov",
"pytest-plone>=0.2.0",
"pytest-docker",
Expand Down
20 changes: 15 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Generated from:
# https://github.com/plone/meta/tree/master/config/default
# https://github.com/plone/meta/tree/main/config/default
# See the inline comments on how to expand/tweak this configuration file
[tox]
# We need 4.4.0 for constrain_package_deps.
Expand Down Expand Up @@ -74,7 +74,7 @@ description = check if the package defines all its dependencies
skip_install = true
deps =
build
z3c.dependencychecker==2.11
z3c.dependencychecker==2.14.3
commands =
python -m build --sdist
dependencychecker
Expand Down Expand Up @@ -150,13 +150,20 @@ set_env =
# Set constrain_package_deps .meta.toml:
# [tox]
# constrain_package_deps = "false"
#
# Explicitly set the package name .meta.toml:
# (For cases where the repository name is not the same of
# the package name)
# [tox]
# package_name = "pytest_plone"
#
##
deps =
pytest-plone
pytest
coverage
-c constraints-mxdev.txt

commands =
coverage run --source pas.plugins.oidc -m pytest {posargs} --disable-warnings {toxinidir}/tests
coverage report -m --format markdown
Expand All @@ -173,7 +180,7 @@ deps =
build
towncrier
-c constraints-mxdev.txt

commands =
# fake version to not have to install the package
# we build the change log as news entries might break
Expand All @@ -186,6 +193,9 @@ commands =
description = ensure there are no cyclic dependencies
use_develop = true
skip_install = false
# Here we must always constrain the package deps to what is already installed,
# otherwise we simply get the latest from PyPI, which may not work.
constrain_package_deps = true
set_env =

##
Expand All @@ -201,7 +211,7 @@ deps =
pipdeptree
pipforester
-c constraints-mxdev.txt

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