Skip to content

Commit

Permalink
meta update and linting
Browse files Browse the repository at this point in the history
  • Loading branch information
petschki committed May 2, 2024
1 parent f7246f3 commit b497d98
Show file tree
Hide file tree
Showing 13 changed files with 73 additions and 28 deletions.
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
4 changes: 3 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 @@ -34,6 +34,8 @@ jobs:
uses: plone/meta/.github/workflows/dependencies.yml@main
release_ready:
uses: plone/meta/.github/workflows/release_ready.yml@main
circular:
uses: plone/meta/.github/workflows/circular.yml@main

##
# To modify the list of default jobs being created add in .meta.toml:
Expand Down
3 changes: 2 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 Down
16 changes: 16 additions & 0 deletions .meta.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated from:
# 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 = "1c2155e4"

[gitignore]
extra_lines = """
# ignore pipforest check
forest.*
# ignore testfiles
test_*
robot_*
"""
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.14.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.9.1
rev: 24.3.0
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 @@ -66,7 +66,7 @@ repos:
hooks:
- id: pyroma
- repo: https://github.com/mgedmin/check-python-versions
rev: "0.21.3"
rev: "0.22.0"
hooks:
- id: check-python-versions
args: ['--only', 'setup.py,pyproject.toml']
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"
17 changes: 12 additions & 5 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 @@ -35,8 +35,8 @@ target-version = ["py38"]
##

[tool.codespell]
ignore-words-list = "discreet,foo,bar"
skip = "*.po,*.min.js,*.min.js.map,*.min.css.map,*.svg,yarn.lock,*.json,*/tiles.xml"
ignore-words-list = "discreet,"
skip = "*.po,"
##
# Add extra configuration options in .meta.toml:
# [pyproject]
Expand Down Expand Up @@ -97,20 +97,27 @@ python-dateutil = ['dateutil']
[tool.check-manifest]
ignore = [
".editorconfig",
".flake8",
".meta.toml",
".pre-commit-config.yaml",
"tox.ini",
".flake8",
"dependabot.yml",
"mx.ini",
"tox.ini",

]

##
# 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",
# ]
# """
##


Expand Down
1 change: 1 addition & 0 deletions src/collective/tiles/carousel/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Init and utils."""

from zope.i18nmessageid import MessageFactory


Expand Down
1 change: 1 addition & 0 deletions src/collective/tiles/carousel/tests/test_setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Setup tests for this package."""

from collective.tiles.carousel.testing import (
COLLECTIVE_TILES_CAROUSEL_INTEGRATION_TESTING,
)
Expand Down
4 changes: 1 addition & 3 deletions src/collective/tiles/carousel/tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,7 @@ def items(self):
query = self.query
if query:
items.update(
OrderedDict.fromkeys(
[x.getObject() for x in self.catalog(**query)]
)
OrderedDict.fromkeys([x.getObject() for x in self.catalog(**query)])
)

result = []
Expand Down
4 changes: 3 additions & 1 deletion src/collective/tiles/carousel/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ def parse_query_from_data(data, context=None):
query = data.get("query", {}) or {}
try:
parsed = queryparser.parseAndModifyFormquery(
context, query, data.get("sort_on"),
context,
query,
data.get("sort_on"),
"desc" if data.get("sort_reversed", False) else "asc",
)
except KeyError:
Expand Down
16 changes: 10 additions & 6 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 @@ -71,7 +71,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 @@ -109,7 +109,7 @@ set_env =
deps =
zope.testrunner
-c https://dist.plone.org/release/6.0-dev/constraints.txt

##
# Specify additional deps in .meta.toml:
# [tox]
Expand Down Expand Up @@ -153,12 +153,13 @@ deps =
coverage
zope.testrunner
-c https://dist.plone.org/release/6.0-dev/constraints.txt

commands =
rfbrowser init
coverage run --branch --source collective.tiles.carousel {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir}/src -s collective.tiles.carousel {posargs}
coverage report -m --format markdown
coverage xml
coverage html
extras =
test

Expand All @@ -170,7 +171,7 @@ deps =
twine
build
-c https://dist.plone.org/release/6.0-dev/constraints.txt

commands =
python -m build --sdist
twine check dist/*
Expand All @@ -179,6 +180,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 @@ -194,7 +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 b497d98

Please sign in to comment.