Skip to content

Commit

Permalink
Modernize package. (Fixes #71, #72, #80)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericof committed Dec 21, 2024
1 parent 01d8128 commit 679962a
Show file tree
Hide file tree
Showing 60 changed files with 1,272 additions and 1,058 deletions.
16 changes: 6 additions & 10 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
# EditorConfig Configurtaion file, for more details see:
# https://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
Expand All @@ -25,9 +16,14 @@ 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
max_line_length = 80

[{Makefile,.gitmodules}]
# Tab indentation (no size specified, but view as 4 spaces)
Expand Down
11 changes: 11 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[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,
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

4 changes: 1 addition & 3 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# These are supported funding model platforms

github: [jensens]
github: [plone]
67 changes: 15 additions & 52 deletions .github/workflows/code-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,66 +2,29 @@ name: Code Analysis
on:
push:

jobs:
black:
name: Black
runs-on: ubuntu-latest

steps:
- name: Checkout codebase
uses: actions/checkout@v4

- name: Run check
uses: plone/[email protected]
with:
check: 'black'
env:
PYTHON_VERSION: "3.12"

flake8:
name: flake8
runs-on: ubuntu-latest

steps:
- name: Checkout codebase
uses: actions/checkout@v4

- name: Run check
uses: plone/[email protected]
with:
check: 'flake8'

isort:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v4

- name: Run check
uses: plone/[email protected]
with:
check: 'isort'
- name: Install hatch
run: pipx install hatch

pyroma:
name: pyroma
runs-on: ubuntu-latest

steps:
- name: Checkout codebase
uses: actions/checkout@v4
- name: Generate Constraints file
run: pipx run mxdev -c mx.ini

- name: Run check
uses: plone/[email protected]
- uses: actions/setup-python@v5
with:
check: 'pyroma'
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'

zpretty:
name: zpretty
runs-on: ubuntu-latest
- name: "Install Environment"
run: hatch env create

steps:
- name: Checkout codebase
uses: actions/checkout@v4

- name: Run check
uses: plone/[email protected]
with:
check: 'zpretty'
- name: "Run checks"
run: hatch run lint
81 changes: 23 additions & 58 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,67 +1,32 @@

name: Build and test
name: Tests

on: [push]
on:
push:

env:
PYTHON_VERSION: "3.12"

jobs:
build:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python:
- 3.7
- 3.8
- 3.9
- "3.10"
- "3.11"
- "3.12"
plone:
- "6.1-latest"
- "6.0-latest"
- "5.2-latest"
exclude:
- plone: "5.2-latest"
python: 3.9
- plone: "5.2-latest"
python: "3.10"
- plone: "5.2-latest"
python: "3.11"
- plone: "5.2-latest"
python: "3.12"
- plone: "6.0-latest"
python: 3.7
- plone: "6.0-latest"
python: "3.12"
- plone: "6.1-latest"
python: 3.7
- plone: "6.1-latest"
python: 3.8
- plone: "6.1-latest"
python: 3.9
- plone: "6.1-latest"
python: "3.10"
- plone: "6.1-latest"
python: "3.11"
- plone: "6.1-latest"
python: "3.12"

steps:
- uses: actions/checkout@v4
- name: Checkout codebase
uses: actions/checkout@v4

- name: Install hatch
run: pipx install hatch

- name: Generate Constraints file
run: pipx run mxdev -c mx.ini

- name: Setup Plone ${{ matrix.plone }} with Python ${{ matrix.python }}
id: setup
uses: plone/[email protected]
with:
python-version: ${{ matrix.python }}
plone-version: ${{ matrix.plone }}
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'

# Install pas.plugins.authomatic with test extras
- name: Install pas.plugins.authomatic
run: |
pip install ".[test]"
- name: "Install Environment"
run: hatch env create

# test
- name: Test Codebase
run: |
zope-testrunner --auto-color --auto-progress --test-path src
- name: "Test Codebase"
run: hatch run test
42 changes: 9 additions & 33 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,42 +1,18 @@
!src/pas
.coverage*
.installed.cfg
.mr.developer.cfg
.project
.pydevproject
.pytest_cache
.ruff_cache
.python-version
.settings/
.vscode/
.venv
*.egg-info
*.log
*.mo
*.pyc
*.swp
bin/
buildout-cache/
develop-eggs/
devsrc/*
dist
docs/doctrees/
docs/html/
docs/make.bat
docs/Makefile
downloads
eggs
etc/
Gruntfile.js
htmlcov/
include/
inituser
lib/
local/
log.html
node_modules/
output.xml
package.json
parts/
pip-selfcheck.json
report.html
selenium-screenshot-*.png
temp_resources
var/
constraints-mxdev.txt
constraints.txt
instance
requirements-mxdev.txt
requirements.lock
requirements.txt
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"flake8.cwd": "${workspaceFolder}",
"flake8.args": ["--config=pyproject.toml"],
"black-formatter.cwd": "${workspaceFolder}",
"isort.args": ["--settings-path=${workspaceFolder}/pyproject.toml"],
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python"
}
14 changes: 8 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Changelog

## 1.4.1 (unreleased)


- Nothing changed yet.

<!--
You should *NOT* be adding new change log entries to this file.
You should create a file in the news directory instead.
For helpful instructions, please see:
https://github.com/plone/plone.releaser/blob/master/ADD-A-NEWS-ITEM.rst
-->

<!-- towncrier release notes start -->

## 1.4.0 (2024-12-13)

Expand Down
6 changes: 5 additions & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Maintainer is [Jens Klein](https://github.com/jensens)
# Maintainers

* [Érico Andrei](https://github.com/ericof)
* [Jens Klein](https://github.com/jensens)

# Contributors
Several people helped to make this package work see [GitHub](https://github.com/collective/pas.plugins.authomatic/graphs/contributors) for the whole list.
5 changes: 0 additions & 5 deletions MANIFEST.in

This file was deleted.

Loading

0 comments on commit 679962a

Please sign in to comment.