Skip to content

Commit

Permalink
Merge pull request #27 from collective/refactor-configuration
Browse files Browse the repository at this point in the history
Refactor toward a 2.0
  • Loading branch information
jensens authored Nov 16, 2023
2 parents 1f63fba + 913dace commit 7b57d66
Show file tree
Hide file tree
Showing 45 changed files with 1,092 additions and 377 deletions.
7 changes: 0 additions & 7 deletions .env

This file was deleted.

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_
# """
##
25 changes: 25 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Python package CI

on:
- push
- pull_request

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Test with tox
run: tox
9 changes: 2 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,12 @@
*.swp
# dirs
bin/
buildout-cache/
develop-eggs/
eggs/
venv/
htmlcov/
include/
lib/
local/
node_modules/
parts/
src/*
dist/*
test.plone_addon/
var/
# files
.installed.cfg
Expand All @@ -28,6 +22,7 @@ output.xml
pip-selfcheck.json
report.html
.vscode/
.tox
.python-version
reports/
# excludes
Expand Down
42 changes: 42 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
ci:
autofix_prs: false
autoupdate_schedule: monthly

repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
hooks:
- id: mypy
additional_dependencies:
- "types-requests"
- "pytest-stub"
# - repo: https://github.com/codespell-project/codespell
# rev: v2.2.5
# hooks:
# - id: codespell
# additional_dependencies:
# - tomli
- 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
15 changes: 13 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,26 @@ Changelog
=========


1.4.1 (unreleased)
------------------
2.0.0b1 (unreleased)
--------------------

- Fix OpenSearch / ElasticSearch switch. [ksuess]
- Update example mapping for nested field "NamedBlobFile":
"include_in_parent": true, allows to search with non-nested query.
[ksuess]
- code-style: black & isort [jensens]
- Add support for Plone ClassicUI based sites (no Volto blocks available) [jensens]
- Move mappings.json, analysis.json.example with its lexicon out of code into examples directory and pimped docs on how to use all this.
[jensens]
- Add docker-compose file to start OpensSearch to example directory and move `.env` to example too.
[jensens]
- rename `ELASTIC_*` environment variables to have an consistent naming scheme, see README for details. [jensens]
- Add tox, Github Actions, CI and CD. [jensens]
- Refactor field-map loading to not happen on startup. [jensens]
- Remove Support for OpenSearch 1.x and ElasticSearch < 8 [jensens]
- Rename .elastic.get_ingest_client to .client.get_client [jensens]
- Do not initialize a new client for each operation, but use a thread local cached one.
This speeds up indexing a lot. [jensens]


1.4 (2023-08-17)
Expand Down
7 changes: 5 additions & 2 deletions CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Contributors
============

- Jens W. Klein, [email protected]
- Katja Süss, Rohberg, @ksuess
- Peter Holzer - Initiative, idea and testing.
- Jens W. Klein, [email protected] - Concept & code.
- Katja Süss, Rohberg, @ksuess - Text analysis code and configuration.

Initial implementation was made possible by `Evangelisch-reformierte Landeskirche des Kantons Zürich <https://zhref.ch/>`_.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
graft src/collective
graft examples
include *.rst
exclude container/*
global-exclude *.pyc
Loading

0 comments on commit 7b57d66

Please sign in to comment.