pas.plugins.oidc 1.0a6__tar.gz → 2.0.0b1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. pas.plugins.oidc-2.0.0b1/.coveragerc +9 -0
  2. pas.plugins.oidc-2.0.0b1/.pre-commit-config.yaml +100 -0
  3. pas.plugins.oidc-2.0.0b1/CHANGES.md +104 -0
  4. pas.plugins.oidc-1.0a6/CONTRIBUTORS.rst → pas.plugins.oidc-2.0.0b1/CONTRIBUTORS.md +2 -2
  5. pas.plugins.oidc-2.0.0b1/MANIFEST.in +15 -0
  6. pas.plugins.oidc-2.0.0b1/Makefile +161 -0
  7. pas.plugins.oidc-2.0.0b1/PKG-INFO +505 -0
  8. pas.plugins.oidc-2.0.0b1/README.md +334 -0
  9. pas.plugins.oidc-2.0.0b1/constraints.txt +1 -0
  10. pas.plugins.oidc-2.0.0b1/docs/icon.png +0 -0
  11. pas.plugins.oidc-2.0.0b1/docs/screenshot-settings.png +0 -0
  12. pas.plugins.oidc-2.0.0b1/instance.yaml +8 -0
  13. pas.plugins.oidc-2.0.0b1/pyproject.toml +180 -0
  14. pas.plugins.oidc-2.0.0b1/requirements-docs.txt +10 -0
  15. pas.plugins.oidc-2.0.0b1/requirements.txt +2 -0
  16. pas.plugins.oidc-2.0.0b1/setup.cfg +4 -0
  17. {pas.plugins.oidc-1.0a6 → pas.plugins.oidc-2.0.0b1}/setup.py +32 -26
  18. {pas.plugins.oidc-1.0a6 → pas.plugins.oidc-2.0.0b1}/src/pas/__init__.py +0 -1
  19. {pas.plugins.oidc-1.0a6 → pas.plugins.oidc-2.0.0b1}/src/pas/plugins/__init__.py +0 -1
  20. {pas.plugins.oidc-1.0a6 → pas.plugins.oidc-2.0.0b1}/src/pas/plugins/oidc/__init__.py +13 -8
  21. {pas.plugins.oidc-1.0a6 → pas.plugins.oidc-2.0.0b1}/src/pas/plugins/oidc/browser/configure.zcml +10 -9
  22. pas.plugins.oidc-2.0.0b1/src/pas/plugins/oidc/browser/view.py +145 -0
  23. {pas.plugins.oidc-1.0a6 → pas.plugins.oidc-2.0.0b1}/src/pas/plugins/oidc/configure.zcml +16 -12
  24. {pas.plugins.oidc-1.0a6 → pas.plugins.oidc-2.0.0b1}/src/pas/plugins/oidc/interfaces.py +0 -1
  25. pas.plugins.oidc-2.0.0b1/src/pas/plugins/oidc/locales/de/LC_MESSAGES/pas.plugins.oidc.mo +0 -0
  26. pas.plugins.oidc-2.0.0b1/src/pas/plugins/oidc/locales/de/LC_MESSAGES/pas.plugins.oidc.po +63 -0
  27. pas.plugins.oidc-2.0.0b1/src/pas/plugins/oidc/locales/en/LC_MESSAGES/pas.plugins.oidc.mo +0 -0
  28. pas.plugins.oidc-2.0.0b1/src/pas/plugins/oidc/locales/en/LC_MESSAGES/pas.plugins.oidc.po +60 -0
  29. pas.plugins.oidc-2.0.0b1/src/pas/plugins/oidc/locales/es/LC_MESSAGES/pas.plugins.oidc.mo +0 -0
  30. {pas.plugins.oidc-1.0a6 → pas.plugins.oidc-2.0.0b1}/src/pas/plugins/oidc/locales/es/LC_MESSAGES/pas.plugins.oidc.po +34 -8
  31. pas.plugins.oidc-2.0.0b1/src/pas/plugins/oidc/locales/pas.plugins.oidc.pot +63 -0
  32. pas.plugins.oidc-2.0.0b1/src/pas/plugins/oidc/locales/update.py +70 -0
  33. {pas.plugins.oidc-1.0a6 → pas.plugins.oidc-2.0.0b1}/src/pas/plugins/oidc/plugins.py +81 -61
  34. pas.plugins.oidc-2.0.0b1/src/pas/plugins/oidc/profiles/default/browserlayer.xml +6 -0
  35. {pas.plugins.oidc-1.0a6 → pas.plugins.oidc-2.0.0b1}/src/pas/plugins/oidc/profiles/default/metadata.xml +1 -1
  36. pas.plugins.oidc-2.0.0b1/src/pas/plugins/oidc/profiles/uninstall/browserlayer.xml +6 -0
  37. pas.plugins.oidc-2.0.0b1/src/pas/plugins/oidc/services/configure.zcml +11 -0
  38. pas.plugins.oidc-2.0.0b1/src/pas/plugins/oidc/services/login/__init__.py +0 -0
  39. pas.plugins.oidc-2.0.0b1/src/pas/plugins/oidc/services/login/configure.zcml +15 -0
  40. pas.plugins.oidc-2.0.0b1/src/pas/plugins/oidc/services/login/get.py +42 -0
  41. pas.plugins.oidc-2.0.0b1/src/pas/plugins/oidc/services/oidc/__init__.py +0 -0
  42. pas.plugins.oidc-2.0.0b1/src/pas/plugins/oidc/services/oidc/configure.zcml +31 -0
  43. pas.plugins.oidc-2.0.0b1/src/pas/plugins/oidc/services/oidc/oidc.py +237 -0
  44. pas.plugins.oidc-2.0.0b1/src/pas/plugins/oidc/session.py +39 -0
  45. {pas.plugins.oidc-1.0a6 → pas.plugins.oidc-2.0.0b1}/src/pas/plugins/oidc/setuphandlers.py +19 -42
  46. {pas.plugins.oidc-1.0a6 → pas.plugins.oidc-2.0.0b1}/src/pas/plugins/oidc/testing.py +12 -22
  47. pas.plugins.oidc-2.0.0b1/src/pas/plugins/oidc/utils.py +219 -0
  48. pas.plugins.oidc-2.0.0b1/src/pas/plugins/oidc/www/oidcPluginForm.zpt +66 -0
  49. pas.plugins.oidc-2.0.0b1/src/pas.plugins.oidc.egg-info/PKG-INFO +505 -0
  50. pas.plugins.oidc-2.0.0b1/src/pas.plugins.oidc.egg-info/SOURCES.txt +78 -0
  51. pas.plugins.oidc-2.0.0b1/src/pas.plugins.oidc.egg-info/requires.txt +24 -0
  52. pas.plugins.oidc-2.0.0b1/tests/conftest.py +70 -0
  53. pas.plugins.oidc-2.0.0b1/tests/docker-compose.yml +41 -0
  54. pas.plugins.oidc-2.0.0b1/tests/functional/conftest.py +69 -0
  55. pas.plugins.oidc-2.0.0b1/tests/functional/test_functional.py +79 -0
  56. pas.plugins.oidc-2.0.0b1/tests/keycloak/Dockerfile +30 -0
  57. pas.plugins.oidc-2.0.0b1/tests/keycloak/import/.gitkeep +0 -0
  58. pas.plugins.oidc-2.0.0b1/tests/keycloak/import/plone-realm.json +2024 -0
  59. pas.plugins.oidc-2.0.0b1/tests/keycloak/import/plone-test-realm.json +2073 -0
  60. pas.plugins.oidc-2.0.0b1/tests/plugin/test_plugin.py +52 -0
  61. pas.plugins.oidc-2.0.0b1/tests/services/conftest.py +116 -0
  62. pas.plugins.oidc-2.0.0b1/tests/services/test_services_login_get.py +28 -0
  63. pas.plugins.oidc-2.0.0b1/tests/services/test_services_oidc_get.py +82 -0
  64. pas.plugins.oidc-2.0.0b1/tests/services/test_services_oidc_post.py +92 -0
  65. pas.plugins.oidc-2.0.0b1/tests/services/test_servides_login_get_multiple_plugins.py +33 -0
  66. pas.plugins.oidc-2.0.0b1/tests/setup/test_setup_install.py +39 -0
  67. pas.plugins.oidc-2.0.0b1/tests/setup/test_setup_uninstall.py +27 -0
  68. pas.plugins.oidc-2.0.0b1/tests/utils/test_utils_flow.py +70 -0
  69. pas.plugins.oidc-2.0.0b1/tests/utils/test_utils_str.py +35 -0
  70. pas.plugins.oidc-2.0.0b1/tests/utils/test_utils_url.py +53 -0
  71. pas.plugins.oidc-1.0a6/CHANGES.rst +0 -67
  72. pas.plugins.oidc-1.0a6/DEVELOP.rst +0 -42
  73. pas.plugins.oidc-1.0a6/MANIFEST.in +0 -4
  74. pas.plugins.oidc-1.0a6/PKG-INFO +0 -334
  75. pas.plugins.oidc-1.0a6/README.rst +0 -225
  76. pas.plugins.oidc-1.0a6/docs/conf.py +0 -239
  77. pas.plugins.oidc-1.0a6/docs/index.rst +0 -5
  78. pas.plugins.oidc-1.0a6/setup.cfg +0 -37
  79. pas.plugins.oidc-1.0a6/src/pas/plugins/oidc/browser/view.py +0 -303
  80. pas.plugins.oidc-1.0a6/src/pas/plugins/oidc/locales/README.rst +0 -37
  81. pas.plugins.oidc-1.0a6/src/pas/plugins/oidc/locales/en/LC_MESSAGES/pas.plugins.oidc.po +0 -35
  82. pas.plugins.oidc-1.0a6/src/pas/plugins/oidc/locales/pas.plugins.oidc.pot +0 -38
  83. pas.plugins.oidc-1.0a6/src/pas/plugins/oidc/locales/update.py +0 -74
  84. pas.plugins.oidc-1.0a6/src/pas/plugins/oidc/locales/update.sh +0 -12
  85. pas.plugins.oidc-1.0a6/src/pas/plugins/oidc/profiles/default/browserlayer.xml +0 -7
  86. pas.plugins.oidc-1.0a6/src/pas/plugins/oidc/profiles/uninstall/browserlayer.xml +0 -7
  87. pas.plugins.oidc-1.0a6/src/pas/plugins/oidc/tests/test_functional.py +0 -115
  88. pas.plugins.oidc-1.0a6/src/pas/plugins/oidc/tests/test_plugin.py +0 -48
  89. pas.plugins.oidc-1.0a6/src/pas/plugins/oidc/tests/test_setup.py +0 -66
  90. pas.plugins.oidc-1.0a6/src/pas/plugins/oidc/utils.py +0 -61
  91. pas.plugins.oidc-1.0a6/src/pas.plugins.oidc.egg-info/PKG-INFO +0 -334
  92. pas.plugins.oidc-1.0a6/src/pas.plugins.oidc.egg-info/SOURCES.txt +0 -45
  93. pas.plugins.oidc-1.0a6/src/pas.plugins.oidc.egg-info/requires.txt +0 -10
  94. {pas.plugins.oidc-1.0a6 → pas.plugins.oidc-2.0.0b1}/LICENSE.GPL +0 -0
  95. /pas.plugins.oidc-1.0a6/LICENSE.rst → /pas.plugins.oidc-2.0.0b1/LICENSE.md +0 -0
  96. {pas.plugins.oidc-1.0a6 → pas.plugins.oidc-2.0.0b1}/src/pas/plugins/oidc/browser/__init__.py +0 -0
  97. {pas.plugins.oidc-1.0a6 → pas.plugins.oidc-2.0.0b1}/src/pas/plugins/oidc/locales/__init__.py +0 -0
  98. {pas.plugins.oidc-1.0a6/src/pas/plugins/oidc/tests → pas.plugins.oidc-2.0.0b1/src/pas/plugins/oidc/services}/__init__.py +0 -0
  99. {pas.plugins.oidc-1.0a6 → pas.plugins.oidc-2.0.0b1}/src/pas.plugins.oidc.egg-info/dependency_links.txt +0 -0
  100. {pas.plugins.oidc-1.0a6 → pas.plugins.oidc-2.0.0b1}/src/pas.plugins.oidc.egg-info/entry_points.txt +0 -0
  101. {pas.plugins.oidc-1.0a6 → pas.plugins.oidc-2.0.0b1}/src/pas.plugins.oidc.egg-info/namespace_packages.txt +0 -0
  102. {pas.plugins.oidc-1.0a6 → pas.plugins.oidc-2.0.0b1}/src/pas.plugins.oidc.egg-info/not-zip-safe +0 -0
  103. {pas.plugins.oidc-1.0a6 → pas.plugins.oidc-2.0.0b1}/src/pas.plugins.oidc.egg-info/top_level.txt +0 -0
@@ -0,0 +1,9 @@
1
+ [run]
2
+ relative_files = True
3
+
4
+ [report]
5
+ include =
6
+ */src/pas/*
7
+ omit =
8
+ */test*
9
+ */upgrades/*
@@ -0,0 +1,100 @@
1
+ # Generated from:
2
+ # https://github.com/plone/meta/tree/main/config/default
3
+ # See the inline comments on how to expand/tweak this configuration file
4
+ ci:
5
+ autofix_prs: false
6
+ autoupdate_schedule: monthly
7
+
8
+ repos:
9
+ - repo: https://github.com/asottile/pyupgrade
10
+ rev: v3.15.2
11
+ hooks:
12
+ - id: pyupgrade
13
+ args: [--py38-plus]
14
+ - repo: https://github.com/pycqa/isort
15
+ rev: 5.13.2
16
+ hooks:
17
+ - id: isort
18
+ - repo: https://github.com/psf/black
19
+ rev: 24.4.2
20
+ hooks:
21
+ - id: black
22
+ - repo: https://github.com/collective/zpretty
23
+ rev: 3.1.0
24
+ hooks:
25
+ - id: zpretty
26
+
27
+ ##
28
+ # Add extra configuration options in .meta.toml:
29
+ # [pre_commit]
30
+ # zpretty_extra_lines = """
31
+ # _your own configuration lines_
32
+ # """
33
+ ##
34
+ - repo: https://github.com/PyCQA/flake8
35
+ rev: 7.0.0
36
+ hooks:
37
+ - id: flake8
38
+
39
+ ##
40
+ # Add extra configuration options in .meta.toml:
41
+ # [pre_commit]
42
+ # flake8_extra_lines = """
43
+ # _your own configuration lines_
44
+ # """
45
+ ##
46
+ - repo: https://github.com/codespell-project/codespell
47
+ rev: v2.2.6
48
+ hooks:
49
+ - id: codespell
50
+ additional_dependencies:
51
+ - tomli
52
+
53
+ ##
54
+ # Add extra configuration options in .meta.toml:
55
+ # [pre_commit]
56
+ # codespell_extra_lines = """
57
+ # _your own configuration lines_
58
+ # """
59
+ ##
60
+ - repo: https://github.com/mgedmin/check-manifest
61
+ rev: "0.49"
62
+ hooks:
63
+ - id: check-manifest
64
+ - repo: https://github.com/regebro/pyroma
65
+ rev: "4.2"
66
+ hooks:
67
+ - id: pyroma
68
+ - repo: https://github.com/mgedmin/check-python-versions
69
+ rev: "0.22.0"
70
+ hooks:
71
+ - id: check-python-versions
72
+ args: ['--only', 'setup.py,pyproject.toml']
73
+ - repo: https://github.com/collective/i18ndude
74
+ rev: "6.2.0"
75
+ hooks:
76
+ - id: i18ndude
77
+
78
+
79
+ ##
80
+ # Add extra configuration options in .meta.toml:
81
+ # [pre_commit]
82
+ # i18ndude_extra_lines = """
83
+ # _your own configuration lines_
84
+ # """
85
+ ##
86
+
87
+ - repo: https://github.com/PyCQA/bandit
88
+ rev: '1.7.5'
89
+ hooks:
90
+ - id: bandit
91
+ args: ["-c", "pyproject.toml"]
92
+ additional_dependencies: ["bandit[toml]"]
93
+
94
+ ##
95
+ # Add extra configuration options in .meta.toml:
96
+ # [pre_commit]
97
+ # extra_lines = """
98
+ # _your own configuration lines_
99
+ # """
100
+ ##
@@ -0,0 +1,104 @@
1
+ # Changelog
2
+
3
+ <!--
4
+ You should *NOT* be adding new change log entries to this file.
5
+ You should create a file in the news directory instead.
6
+ For helpful instructions, please see:
7
+ https://github.com/plone/plone.releaser/blob/master/ADD-A-NEWS-ITEM.rst
8
+ -->
9
+
10
+ <!-- towncrier release notes start -->
11
+
12
+ ## 2.0.0b1 (2024-06-25)
13
+
14
+
15
+ ### New features:
16
+
17
+ - Added Deutsch translation
18
+ [@macagua] [#45](https://github.com/collective/pas.plugins.oidc/issues/45)
19
+ - Allow multiple instances of OIDC plugin in a given Plone site @erral [#48](https://github.com/collective/pas.plugins.oidc/issues/48)
20
+ - Notify user events on creation and authentication. [@Arkusm][@ericof] [#53](https://github.com/collective/pas.plugins.oidc/issues/53)
21
+ - Updated the latest .po templates for translate
22
+ Updated Spanish translation
23
+ [@macagua] [#55](https://github.com/collective/pas.plugins.oidc/issues/55)
24
+
25
+
26
+ ### Internal:
27
+
28
+ - Update configuration files @plone
29
+
30
+
31
+ ### Documentation:
32
+
33
+ - Recommend using `[pas.plugins.keycloakgroups](https://pypi.org/project/pas.plugins.keycloakgroups/)` for groups support with Keycloak [@ericof] [#42](https://github.com/collective/pas.plugins.oidc/issues/42)
34
+
35
+
36
+ ## 2.0.0a1 (2023-11-23)
37
+
38
+
39
+ ### New features:
40
+
41
+ - Implement [plone/meta](https://github.com/plone/meta) and convert documentation to Markdown [@ericof] [#32](https://github.com/collective/pas.plugins.oidc/issues/32)
42
+ - Drop support to Python 2.7 and Plone 5.2 [@ericof] [#33](https://github.com/collective/pas.plugins.oidc/issues/33)
43
+ - Implement restapi services to handle authentication flow [@ericof] [#38](https://github.com/collective/pas.plugins.oidc/issues/38)
44
+
45
+
46
+ ### Internal:
47
+
48
+ - Rewrite tests from unittest to pytest with [pytest-plone](https://pypi.org/project/pytest-plone/) [@ericof] [#34](https://github.com/collective/pas.plugins.oidc/issues/34)
49
+ - Allow dict instances to hold userinfo [@erral] [#35](https://github.com/collective/pas.plugins.oidc/issues/35)
50
+ - Declare the minimum requirements for Plone/python in the readme [mamico] [#36](https://github.com/collective/pas.plugins.oidc/issues/36)
51
+
52
+
53
+ ## 1.0.0 (2023-11-11)
54
+
55
+ - Allow dict instances to hold userinfo [@erral]
56
+
57
+ ## 1.0a6 (2023-07-20)
58
+
59
+ - Added Spanish translation [@macagua]
60
+
61
+ - Added improvements about i18n support [macagua]
62
+
63
+ - Drop python 2.7 and Plone 4 support [@erral]
64
+
65
+ - Add support for the post_logout parameter for logout api. [@ramiroluz]
66
+
67
+
68
+ ## 1.0a5 (2023-04-05)
69
+
70
+ - Catch exceptions during the OAuth process [@erral]
71
+
72
+ - Update the plugin to make challenges.
73
+ An anonymous user who visits a page for which you have to be authenticated,
74
+ is redirected to the new require_login view on the plugin.
75
+ This works the same way as the standard require_login page of Plone.
76
+ [@maurits]
77
+
78
+ - Add a property for the default userinfo instead of using only sub. [@eikichi18]
79
+
80
+
81
+ ## 1.0a4 (2023-01-16)
82
+
83
+ - Call getProperty only once when getting redirect_uris or scope. [@maurits]
84
+
85
+ - use getProperty accessor [@mamico]
86
+
87
+
88
+ ## 1.0a3 (2022-10-30)
89
+
90
+ - Removed the hardcoded auth cookie name [@alecghica]
91
+
92
+ - Fixed Python compatibility with version >= 3.6 [@alecghica]
93
+
94
+ - check if url is in portal before redirect #2 [@erral]
95
+
96
+ - manage came_from [@mamico]
97
+
98
+ ## 1.0a2 (unreleased)
99
+
100
+ - do userinforequest if there is a client.userinfo_endpoint [@mamico]
101
+
102
+ ## 1.0a1 (unreleased)
103
+
104
+ - Initial release. [@mamico]
@@ -1,7 +1,7 @@
1
- Contributors
2
- ============
1
+ # Contributors
3
2
 
4
3
  - mamico, mauro.amico@gmail.com
5
4
  - erral, Mikel Larreategi
6
5
  - alecghica, alec.ghica@eaudeweb.ro
7
6
  - macagua, leonardocaballero@gmail.com
7
+ - ericof, ericof@plone.org
@@ -0,0 +1,15 @@
1
+ graft src/pas
2
+ graft docs
3
+ global-exclude *.pyc
4
+ include *.md
5
+ include *.txt
6
+ include *.yaml
7
+ include .coveragerc
8
+ include Makefile
9
+ recursive-include tests *.py
10
+ recursive-include tests *.gitkeep
11
+ recursive-include tests *.json
12
+ recursive-include tests *.yml
13
+ recursive-exclude docs/_build *
14
+ recursive-exclude docs/ .DS_Store
15
+ include tests/keycloak/Dockerfile
@@ -0,0 +1,161 @@
1
+ ### Defensive settings for make:
2
+ # https://tech.davis-hansson.com/p/make/
3
+ SHELL:=bash
4
+ .ONESHELL:
5
+ .SHELLFLAGS:=-xeu -o pipefail -O inherit_errexit -c
6
+ .SILENT:
7
+ .DELETE_ON_ERROR:
8
+ MAKEFLAGS+=--warn-undefined-variables
9
+ MAKEFLAGS+=--no-builtin-rules
10
+
11
+ # We like colors
12
+ # From: https://coderwall.com/p/izxssa/colored-makefile-for-golang-projects
13
+ RED=`tput setaf 1`
14
+ GREEN=`tput setaf 2`
15
+ RESET=`tput sgr0`
16
+ YELLOW=`tput setaf 3`
17
+
18
+ BACKEND_FOLDER=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
19
+ COMPOSE_FOLDER=${BACKEND_FOLDER}/tests
20
+ DOCS_DIR=${BACKEND_FOLDER}/docs
21
+
22
+ # Python checks
23
+ PYTHON?=python3
24
+
25
+ # installed?
26
+ ifeq (, $(shell which $(PYTHON) ))
27
+ $(error "PYTHON=$(PYTHON) not found in $(PATH)")
28
+ endif
29
+
30
+ # version ok?
31
+ PYTHON_VERSION_MIN=3.8
32
+ PYTHON_VERSION_OK=$(shell $(PYTHON) -c "import sys; print((int(sys.version_info[0]), int(sys.version_info[1])) >= tuple(map(int, '$(PYTHON_VERSION_MIN)'.split('.'))))")
33
+ ifeq ($(PYTHON_VERSION_OK),0)
34
+ $(error "Need python $(PYTHON_VERSION) >= $(PYTHON_VERSION_MIN)")
35
+ endif
36
+
37
+ all: build
38
+
39
+ # Add the following 'help' target to your Makefile
40
+ # And add help text after each target name starting with '\#\#'
41
+ .PHONY: help
42
+ help: ## This help message
43
+ @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
44
+
45
+ .PHONY: clean
46
+ clean: clean-build clean-pyc clean-test clean-venv clean-instance ## remove all build, test, coverage and Python artifacts
47
+
48
+ .PHONY: clean-instance
49
+ clean-instance: ## remove existing instance
50
+ rm -fr instance etc inituser var
51
+
52
+ .PHONY: clean-venv
53
+ clean-venv: ## remove virtual environment
54
+ rm -fr bin include lib lib64 env pyvenv.cfg .tox .pytest_cache requirements-mxdev.txt
55
+
56
+ .PHONY: clean-build
57
+ clean-build: ## remove build artifacts
58
+ rm -fr build/
59
+ rm -fr dist/
60
+ rm -fr .eggs/
61
+ find . -name '*.egg-info' -exec rm -fr {} +
62
+ find . -name '*.egg' -exec rm -rf {} +
63
+
64
+ .PHONY: clean-pyc
65
+ clean-pyc: ## remove Python file artifacts
66
+ find . -name '*.pyc' -exec rm -f {} +
67
+ find . -name '*.pyo' -exec rm -f {} +
68
+ find . -name '*~' -exec rm -f {} +
69
+ find . -name '__pycache__' -exec rm -fr {} +
70
+
71
+ .PHONY: clean-test
72
+ clean-test: ## remove test and coverage artifacts
73
+ rm -f .coverage
74
+ rm -fr htmlcov/
75
+
76
+ bin/pip bin/tox bin/mxdev:
77
+ @echo "$(GREEN)==> Setup Virtual Env$(RESET)"
78
+ $(PYTHON) -m venv .
79
+ bin/pip install -U "pip" "wheel" "cookiecutter" "mxdev" "tox"
80
+
81
+ .PHONY: config
82
+ config: bin/pip ## Create instance configuration
83
+ @echo "$(GREEN)==> Create instance configuration$(RESET)"
84
+ bin/cookiecutter -f --no-input --config-file instance.yaml gh:plone/cookiecutter-zope-instance
85
+
86
+ .PHONY: install-plone-6.0
87
+ install-plone-6.0: config ## pip install Plone packages
88
+ @echo "$(GREEN)==> Setup Build$(RESET)"
89
+ bin/mxdev -c mx.ini
90
+ bin/pip install -r requirements-mxdev.txt
91
+
92
+ .PHONY: install
93
+ install: install-plone-6.0 ## Install Plone 6.0
94
+
95
+ .PHONY: start
96
+ start: ## Start a Plone instance on localhost:8080
97
+ PYTHONWARNINGS=ignore ./bin/runwsgi instance/etc/zope.ini
98
+
99
+ .PHONY: console
100
+ console: ## Console
101
+ PYTHONWARNINGS=ignore ./bin/zconsole debug instance/etc/zope.ini
102
+
103
+ .PHONY: format
104
+ format: bin/tox ## Format the codebase according to our standards
105
+ @echo "$(GREEN)==> Format codebase$(RESET)"
106
+ bin/tox -e format
107
+
108
+ .PHONY: lint
109
+ lint: bin/tox ## check code style
110
+ bin/tox -e lint
111
+
112
+ # i18n
113
+ bin/i18ndude bin/pocompile: bin/pip
114
+ @echo "$(GREEN)==> Install translation tools$(RESET)"
115
+ bin/pip install i18ndude zest.pocompile
116
+
117
+ .PHONY: i18n
118
+ i18n: bin/i18ndude ## Update locales
119
+ @echo "$(GREEN)==> Updating locales$(RESET)"
120
+ bin/update_locale
121
+ bin/pocompile src/
122
+
123
+ # Tests
124
+ .PHONY: test
125
+ test: bin/tox ## run tests
126
+ bin/tox -e test
127
+
128
+ .PHONY: test-coverage
129
+ test-coverage: bin/tox ## run tests
130
+ bin/tox -e coverage
131
+
132
+ # Keycloak
133
+ .PHONY: keycloak-start
134
+ keycloak-start: ## Start Keycloak stack
135
+ @echo "$(GREEN)==> Start keycloak stack$(RESET)"
136
+ @docker compose -f $(COMPOSE_FOLDER)/docker-compose.yml up -d
137
+
138
+ .PHONY: keycloak-status
139
+ keycloak-status: ## Check Keycloak stack status
140
+ @echo "$(GREEN)==> Check Keycloak stack status$(RESET)"
141
+ @docker compose -f $(COMPOSE_FOLDER)/docker-compose.yml ps
142
+
143
+ .PHONY: keycloak-stop
144
+ keycloak-stop: ## Stop Keycloak stack
145
+ @echo "$(GREEN)==> Stop Keycloak stack$(RESET)"
146
+ @docker compose -f $(COMPOSE_FOLDER)/docker-compose.yml down
147
+
148
+ # Docs
149
+ bin/sphinx-build: bin/pip
150
+ bin/pip install -r requirements-docs.txt
151
+
152
+ .PHONY: build-docs
153
+ build-docs: bin/sphinx-build ## Build the documentation
154
+ ./bin/sphinx-build \
155
+ -b html $(DOCS_DIR) "$(DOCS_DIR)/_build/html"
156
+
157
+ .PHONY: livehtml
158
+ livehtml: bin/sphinx-build ## Rebuild Sphinx documentation on changes, with live-reload in the browser
159
+ ./bin/sphinx-autobuild \
160
+ --ignore "*.swp" \
161
+ -b html $(DOCS_DIR) "$(DOCS_DIR)/_build/html"