From ab81e06055b0f7800c9970328c87596329218d90 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Sat, 8 Apr 2023 17:23:52 +0200 Subject: [PATCH 1/9] Configuring with plone/meta --- .editorconfig | 54 ++++++++++ .flake8 | 24 +++++ .github/workflows/meta.yml | 66 ++++++++++++ .gitignore | 70 +++++++++---- .meta.toml | 27 +++++ .pre-commit-config.yaml | 94 +++++++++++++++++ news/434550cc.internal | 2 + pyproject.toml | 141 ++++++++++++++++++++++++- setup.cfg | 14 --- tox.ini | 210 +++++++++++++++++++++++++++++++++++++ 10 files changed, 667 insertions(+), 35 deletions(-) create mode 100644 .editorconfig create mode 100644 .flake8 create mode 100644 .github/workflows/meta.yml create mode 100644 .meta.toml create mode 100644 .pre-commit-config.yaml create mode 100644 news/434550cc.internal delete mode 100644 setup.cfg create mode 100644 tox.ini diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..8ae05aaa --- /dev/null +++ b/.editorconfig @@ -0,0 +1,54 @@ +# Generated from: +# https://github.com/plone/meta/tree/master/config/default +# See the inline comments on how to expand/tweak this configuration file +# +# EditorConfig Configuration file, for more details see: +# http://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 +insert_final_newline = true +trim_trailing_whitespace = true +# Set default charset +charset = utf-8 +# Indent style default +indent_style = space +# Max Line Length - a hard line wrap, should be disabled +max_line_length = off + +[*.{py,cfg,ini}] +# 4 space indentation +indent_size = 4 + +[*.{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) +indent_style = tab +indent_size = unset +tab_width = unset + + +## +# Add extra configuration options in .meta.toml: +# [editorconfig] +# extra_lines = """ +# _your own configuration lines_ +# """ +## diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..590eb044 --- /dev/null +++ b/.flake8 @@ -0,0 +1,24 @@ +# 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, +per-file-ignores = + src/plone/app/robotframework/__init__.py:F401 + +## +# Add extra configuration options in .meta.toml: +# [flake8] +# extra_lines = """ +# _your own configuration lines_ +# """ +## diff --git a/.github/workflows/meta.yml b/.github/workflows/meta.yml new file mode 100644 index 00000000..d13f706c --- /dev/null +++ b/.github/workflows/meta.yml @@ -0,0 +1,66 @@ +# Generated from: +# https://github.com/plone/meta/tree/master/config/default +# See the inline comments on how to expand/tweak this configuration file +name: Meta +on: + push: + branches: + - master + - main + pull_request: + branches: + - master + - main + workflow_dispatch: + +## +# To set environment variables for all jobs, add in .meta.toml: +# [github] +# env = """ +# debug: 1 +# image-name: 'org/image' +# image-tag: 'latest' +# """ +## + +jobs: + qa: + uses: plone/meta/.github/workflows/qa.yml@main + dependencies: + uses: plone/meta/.github/workflows/dependencies.yml@main + release_ready: + uses: plone/meta/.github/workflows/release_ready.yml@main + +#TODO: remove the tests and coverage, as they fail on GHA for now. +# Removed the circular dependency check as well, +# due to plone.app.multilingual and Products.CMFPlone having a circular dependency. + +## +# To modify the list of default jobs being created add in .meta.toml: +# [github] +# jobs = [ +# "qa", +# "test", +# "coverage", +# "dependencies", +# "release_ready", +# "circular", +# ] +## + +## +# To request that some OS level dependencies get installed +# when running tests/coverage jobs, add in .meta.toml: +# [github] +# os_dependencies = "git libxml2 libxslt" +## + + +## +# Specify additional jobs in .meta.toml: +# [github] +# extra_lines = """ +# another: +# uses: org/repo/.github/workflows/file.yml@main +# """ +## diff --git a/.gitignore b/.gitignore index 855b1cab..503e47c5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,25 +1,55 @@ -syntax: glob +# Generated from: +# https://github.com/plone/meta/tree/master/config/default +# See the inline comments on how to expand/tweak this configuration file +# python related *.egg-info -*.mo -*.swp *.pyc -*.py.bak -.DS_Store -.idea +*.pyo + +# translation related +*.mo + +# tools related +build/ +.coverage +.*project +coverage.xml +dist/ +docs/_build +__pycache__/ +.tox +.vscode/ +node_modules/ + +# venv / buildout related +bin/ +develop-eggs/ +eggs/ +.eggs/ +etc/ .installed.cfg +include/ +lib/ +lib64 .mr.developer.cfg -.ropeproject -bin -buildout-cache -develop-eggs -dist -docs/make.bat -docs/Makefile -etc -include -lib -local -parts -pip-selfcheck.json -var +parts/ +pyvenv.cfg +var/ + +# mxdev +/instance/ +/.make-sentinels/ +/*-mxdev.txt +/reports/ +/sources/ +/venv/ +.installed.txt + +## +# Add extra configuration options in .meta.toml: +# [gitignore] +# extra_lines = """ +# _your own configuration lines_ +# """ +## diff --git a/.meta.toml b/.meta.toml new file mode 100644 index 00000000..de2bf65b --- /dev/null +++ b/.meta.toml @@ -0,0 +1,27 @@ +# Generated from: +# https://github.com/plone/meta/tree/master/config/default +# See the inline comments on how to expand/tweak this configuration file +[meta] +template = "default" +commit-id = "68cda6e4" + +[flake8] +extra_lines = """ +per-file-ignores = + src/plone/app/robotframework/__init__.py:F401 +""" + +[pyproject] +codespell_ignores = "ot,nin," +dependencies_ignores = "['robotide', 'collective.js.speakjs', 'watchdog', 'robotframework-debuglibrary', 'robotframework-ride', 'robotframework-selenium2library', 'robotframework-seleniumtestability', 'sphinxcontrib-robotdoc', 'robotsuite', 'robotframework-browser' ]" +dependencies_mappings = [ + "Pillow = ['PIL']", + "robotframework = ['robot']", + ] + +[github] +jobs = [ + "qa", + "dependencies", + "release_ready", + ] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..b6eb0432 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,94 @@ +# Generated from: +# https://github.com/plone/meta/tree/master/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 + hooks: + - id: pyupgrade + args: [--py38-plus] +- 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/collective/zpretty + rev: 3.1.0 + hooks: + - id: zpretty + +## +# Add extra configuration options in .meta.toml: +# [pre_commit] +# zpretty_extra_lines = """ +# _your own configuration lines_ +# """ +## +- repo: https://github.com/PyCQA/flake8 + rev: 6.1.0 + hooks: + - id: flake8 + +## +# Add extra configuration options in .meta.toml: +# [pre_commit] +# flake8_extra_lines = """ +# _your own configuration lines_ +# """ +## +- repo: https://github.com/codespell-project/codespell + rev: v2.2.6 + hooks: + - id: codespell + additional_dependencies: + - tomli + +## +# Add extra configuration options in .meta.toml: +# [pre_commit] +# codespell_extra_lines = """ +# _your own configuration lines_ +# """ +## +- 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 +- repo: https://github.com/mgedmin/check-python-versions + rev: "0.21.3" + hooks: + - id: check-python-versions + args: ['--only', 'setup.py,pyproject.toml'] +- repo: https://github.com/collective/i18ndude + rev: "6.1.0" + hooks: + - id: i18ndude + + +## +# Add extra configuration options in .meta.toml: +# [pre_commit] +# i18ndude_extra_lines = """ +# _your own configuration lines_ +# """ +## + + +## +# Add extra configuration options in .meta.toml: +# [pre_commit] +# extra_lines = """ +# _your own configuration lines_ +# """ +## diff --git a/news/434550cc.internal b/news/434550cc.internal new file mode 100644 index 00000000..c08f5399 --- /dev/null +++ b/news/434550cc.internal @@ -0,0 +1,2 @@ +Update configuration files. +[plone devs] diff --git a/pyproject.toml b/pyproject.toml index 05b615de..4a596000 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,9 @@ +# Generated from: +# https://github.com/plone/meta/tree/master/config/default +# See the inline comments on how to expand/tweak this configuration file [tool.towncrier] -filename = "CHANGES.rst" directory = "news/" +filename = "CHANGES.rst" title_format = "{version} ({project_date})" underlines = ["-", ""] @@ -18,3 +21,139 @@ showcontent = true directory = "bugfix" name = "Bug fixes:" showcontent = true + +[[tool.towncrier.type]] +directory = "internal" +name = "Internal:" +showcontent = true + +[[tool.towncrier.type]] +directory = "documentation" +name = "Documentation:" +showcontent = true + +[[tool.towncrier.type]] +directory = "tests" +name = "Tests" +showcontent = true + +## +# Add extra configuration options in .meta.toml: +# [pyproject] +# towncrier_extra_lines = """ +# extra_configuration +# """ +## + +[tool.isort] +profile = "plone" + +## +# Add extra configuration options in .meta.toml: +# [pyproject] +# isort_extra_lines = """ +# extra_configuration +# """ +## + +[tool.black] +target-version = ["py38"] + +## +# Add extra configuration options in .meta.toml: +# [pyproject] +# black_extra_lines = """ +# extra_configuration +# """ +## + +[tool.codespell] +ignore-words-list = "discreet,ot,nin," +skip = "*.po," +## +# Add extra configuration options in .meta.toml: +# [pyproject] +# codespell_ignores = "foo,bar" +# codespell_skip = "*.po,*.map,package-lock.json" +## + +[tool.dependencychecker] +Zope = [ + # Zope own provided namespaces + 'App', 'OFS', 'Products.Five', 'Products.OFSP', 'Products.PageTemplates', + 'Products.SiteAccess', 'Shared', 'Testing', 'ZPublisher', 'ZTUtils', + 'Zope2', 'webdav', 'zmi', + # ExtensionClass own provided namespaces + 'ExtensionClass', 'ComputedAttribute', 'MethodObject', + # Zope dependencies + 'AccessControl', 'Acquisition', 'AuthEncoding', 'beautifulsoup4', 'BTrees', + 'cffi', 'Chameleon', 'DateTime', 'DocumentTemplate', + 'MultiMapping', 'multipart', 'PasteDeploy', 'Persistence', 'persistent', + 'pycparser', 'python-gettext', 'pytz', 'RestrictedPython', 'roman', + 'soupsieve', 'transaction', 'waitress', 'WebOb', 'WebTest', 'WSGIProxy2', + 'z3c.pt', 'zc.lockfile', 'ZConfig', 'zExceptions', 'ZODB', 'zodbpickle', + 'zope.annotation', 'zope.browser', 'zope.browsermenu', 'zope.browserpage', + 'zope.browserresource', 'zope.cachedescriptors', 'zope.component', + 'zope.configuration', 'zope.container', 'zope.contentprovider', + 'zope.contenttype', 'zope.datetime', 'zope.deferredimport', + 'zope.deprecation', 'zope.dottedname', 'zope.event', 'zope.exceptions', + 'zope.filerepresentation', 'zope.globalrequest', 'zope.hookable', + 'zope.i18n', 'zope.i18nmessageid', 'zope.interface', 'zope.lifecycleevent', + 'zope.location', 'zope.pagetemplate', 'zope.processlifetime', 'zope.proxy', + 'zope.ptresource', 'zope.publisher', 'zope.schema', 'zope.security', + 'zope.sequencesort', 'zope.site', 'zope.size', 'zope.structuredtext', + 'zope.tal', 'zope.tales', 'zope.testbrowser', 'zope.testing', + 'zope.traversing', 'zope.viewlet' +] +'Products.CMFCore' = [ + 'docutils', 'five.localsitemanager', 'Missing', 'Products.BTreeFolder2', + 'Products.GenericSetup', 'Products.MailHost', 'Products.PythonScripts', + 'Products.StandardCacheManagers', 'Products.ZCatalog', 'Record', + 'zope.sendmail', 'Zope' +] +'plone.base' = [ + 'plone.batching', 'plone.registry', 'plone.schema','plone.z3cform', + 'Products.CMFCore', 'Products.CMFDynamicViewFTI', +] +python-dateutil = ['dateutil'] +ignore-packages = ['robotide', 'collective.js.speakjs', 'watchdog', 'robotframework-debuglibrary', 'robotframework-ride', 'robotframework-selenium2library', 'robotframework-seleniumtestability', 'sphinxcontrib-robotdoc', 'robotsuite', 'robotframework-browser' ] +Pillow = ['PIL'] +robotframework = ['robot'] + +## +# Add extra configuration options in .meta.toml: +# [pyproject] +# dependencies_ignores = "['zestreleaser.towncrier']" +# dependencies_mappings = [ +# "gitpython = ['git']", +# "pygithub = ['github']", +# ] +## + +[tool.check-manifest] +ignore = [ + ".editorconfig", + ".meta.toml", + ".pre-commit-config.yaml", + "tox.ini", + ".flake8", + "mx.ini", + +] +## +# Add extra configuration options in .meta.toml: +# [pyproject] +# check_manifest_ignores = """ +# "*.map.js", +# "*.pyc", +# """ +## + + +## +# Add extra configuration options in .meta.toml: +# [pyproject] +# extra_lines = """ +# _your own configuration lines_ +# """ +## diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 4f3a3e25..00000000 --- a/setup.cfg +++ /dev/null @@ -1,14 +0,0 @@ -[check-manifest] -ignore = - *.cfg - requirements.txt - -[isort] -profile = black -force_alphabetical_sort = True -force_single_line = True -lines_after_imports = 2 - -[bdist_wheel] -# Py3 only -universal = 0 diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..0cb1d9e0 --- /dev/null +++ b/tox.ini @@ -0,0 +1,210 @@ +# Generated from: +# https://github.com/plone/meta/tree/master/config/default +# See the inline comments on how to expand/tweak this configuration file +[tox] +# We need 4.4.0 for constrain_package_deps. +min_version = 4.4.0 +envlist = + lint + test + dependencies + + +## +# Add extra configuration options in .meta.toml: +# [tox] +# envlist_lines = """ +# my_other_environment +# """ +# config_lines = """ +# my_extra_top_level_tox_configuration_lines +# """ +## + +[testenv] +skip_install = true +allowlist_externals = + echo + false +# Make sure typos like `tox -e formaat` are caught instead of silently doing nothing. +# See https://github.com/tox-dev/tox/issues/2858. +commands = + echo "Unrecognized environment name {envname}" + false + +[testenv:init] +description = Prepare environment +skip_install = true +commands = + echo "Initial setup complete" + + +[testenv:format] +description = automatically reformat code +skip_install = true +deps = + pre-commit +commands = + pre-commit run -a pyupgrade + pre-commit run -a isort + pre-commit run -a black + pre-commit run -a zpretty + +[testenv:lint] +description = run linters that will help improve the code style +skip_install = true +deps = + pre-commit +commands = + pre-commit run -a + +[testenv:dependencies] +description = check if the package defines all its dependencies +skip_install = true +deps = + build + z3c.dependencychecker==2.11 +commands = + python -m build --sdist --no-isolation + dependencychecker + +[testenv:dependencies-graph] +description = generate a graph out of the dependencies of the package +skip_install = false +allowlist_externals = + sh +deps = + pipdeptree==2.5.1 + graphviz # optional dependency of pipdeptree +commands = + sh -c 'pipdeptree --exclude setuptools,wheel,pipdeptree,zope.interface,zope.component --graph-output svg > dependencies.svg' + +[testenv:test] +description = run the distribution tests +use_develop = true +skip_install = false +constrain_package_deps = true +set_env = + ROBOT_BROWSER=headlesschrome + +## +# Specify extra test environment variables in .meta.toml: +# [tox] +# test_environment_variables = """ +# PIP_EXTRA_INDEX_URL=https://my-pypi.my-server.com/ +# """ +# +# Set constrain_package_deps .meta.toml: +# [tox] +# constrain_package_deps = "false" +## +deps = + zope.testrunner + -c https://dist.plone.org/release/6.0-dev/constraints.txt + +## +# Specify additional deps in .meta.toml: +# [tox] +# test_deps_additional = "-esources/plonegovbr.portal_base[test]" +# +# Specify a custom constraints file in .meta.toml: +# [tox] +# constraints_file = "https://my-server.com/constraints.txt" +## +commands = + rfbrowser init + zope-testrunner --all --test-path={toxinidir}/src -s plone.app.robotframework {posargs} +extras = + test + +## +# Add extra configuration options in .meta.toml: +# [tox] +# test_extras = """ +# tests +# widgets +# """ +## + +[testenv:coverage] +description = get a test coverage report +use_develop = true +skip_install = false +constrain_package_deps = true +set_env = + ROBOT_BROWSER=headlesschrome + +## +# Specify extra test environment variables in .meta.toml: +# [tox] +# test_environment_variables = """ +# PIP_EXTRA_INDEX_URL=https://my-pypi.my-server.com/ +# """ +## +deps = + coverage + zope.testrunner + -c https://dist.plone.org/release/6.0-dev/constraints.txt + +commands = + rfbrowser init + coverage run --branch --source plone.app.robotframework {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir}/src -s plone.app.robotframework {posargs} + coverage report -m --format markdown + coverage xml +extras = + test + + +[testenv:release-check] +description = ensure that the distribution is ready to release +skip_install = true +deps = + twine + build + towncrier + -c https://dist.plone.org/release/6.0-dev/constraints.txt + +commands = + # fake version to not have to install the package + # we build the change log as news entries might break + # the README that is displayed on PyPI + towncrier build --version=100.0.0 --yes + python -m build --sdist --no-isolation + twine check dist/* + +[testenv:circular] +description = ensure there are no cyclic dependencies +use_develop = true +skip_install = false +set_env = + +## +# Specify extra test environment variables in .meta.toml: +# [tox] +# test_environment_variables = """ +# PIP_EXTRA_INDEX_URL=https://my-pypi.my-server.com/ +# """ +## +allowlist_externals = + sh +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' + # Generate a DOT graph with the circular dependencies, if any + pipforester -i forest.json -o forest.dot --cycles + # Report if there are any circular dependencies, i.e. error if there are any + pipforester -i forest.json --check-cycles -o /dev/null + + +## +# Add extra configuration options in .meta.toml: +# [tox] +# extra_lines = """ +# _your own configuration lines_ +# """ +## From 9742811d44b3cecb70306c9039a81246dec31d36 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Sat, 8 Apr 2023 17:38:20 +0200 Subject: [PATCH 2/9] chore: drop old files --- buildout.cfg | 59 ------------------------------------------------ docs.cfg | 7 ------ requirements.txt | 2 -- 3 files changed, 68 deletions(-) delete mode 100644 buildout.cfg delete mode 100644 docs.cfg delete mode 100644 requirements.txt diff --git a/buildout.cfg b/buildout.cfg deleted file mode 100644 index 3026c2ee..00000000 --- a/buildout.cfg +++ /dev/null @@ -1,59 +0,0 @@ -[buildout] -extends = - https://raw.githubusercontent.com/collective/buildout.plonetest/master/test-5.1.x.cfg - versions.cfg -parts += - docs - libdoc - robot -package-name = plone.app.robotframework -package-extras = [test,speak] -test-eggs = Pillow -develop = . -versions = versions - -[versions] -setuptools = -zc.buildout = -plone.app.robotframework = - -[instance] -zcml = - -[docs] -recipe = collective.recipe.sphinxbuilder -eggs = - Pillow - plone.app.robotframework [docs] - -[libdoc] -recipe = zc.recipe.egg -eggs = plone.app.robotframework [docs] -entry-points = libdoc=robot.libdoc:libdoc_cli -scripts = libdoc -arguments = sys.argv[1:] - -[environment] -zope_i18n_compile_mo_files = true -ROBOT_SELENIUM2LIBRARY_RUN_ON_FAILURE = Capture page screenshot and log source - -[test] -environment = environment - -[robot] -recipe = zc.recipe.egg -eggs = - Pillow - plone.app.robotframework [test,ride,speak,reload,debug] - -[nix] -recipe = collective.recipe.nix -name = default -eggs = - ${test:eggs} - ${robot:eggs} -nixpkgs = - watchdog=pythonPackages.watchdog - zc.buildout=pythonPackages.zc_buildout_nix -outputs = default.nix -allow-from-cache = true diff --git a/docs.cfg b/docs.cfg deleted file mode 100644 index 5275a2b2..00000000 --- a/docs.cfg +++ /dev/null @@ -1,7 +0,0 @@ -[buildout] -parts = sphinxbuilder -index = http://pypi.python.org/simple - -[sphinxbuilder] -recipe = collective.recipe.sphinxbuilder -eggs = sphinxcontrib-robotdoc diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index bba24162..00000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -setuptools==33.1.1 -zc.buildout==2.12.1 From edafb601f848ade2c3af0e40d3cd85c4382775a8 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Sat, 8 Apr 2023 17:25:09 +0200 Subject: [PATCH 3/9] chore: pyupgrade --- src/plone/app/robotframework/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plone/app/robotframework/server.py b/src/plone/app/robotframework/server.py index 00151862..55b8b4f6 100644 --- a/src/plone/app/robotframework/server.py +++ b/src/plone/app/robotframework/server.py @@ -321,7 +321,7 @@ def zodb_setup(self, layer_dotted_name=None): if HAS_VERBOSE_CONSOLE: print( WAIT( - "Test set up {}.{}".format(layer.__module__, layer.__name__) + f"Test set up {layer.__module__}.{layer.__name__}" ) ) layer.testSetUp() From 11aea772398106c0a58e077854c1c1ed6c419fe4 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Sat, 8 Apr 2023 17:25:22 +0200 Subject: [PATCH 4/9] chore: isort --- src/plone/app/robotframework/testing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plone/app/robotframework/testing.py b/src/plone/app/robotframework/testing.py index 70860709..744ac349 100644 --- a/src/plone/app/robotframework/testing.py +++ b/src/plone/app/robotframework/testing.py @@ -18,8 +18,8 @@ from plone.app.testing import ploneSite from plone.testing import Layer from plone.testing import zope as zope_testing -from plone.testing.zope import WSGIServer from plone.testing.zope import WSGI_SERVER_FIXTURE +from plone.testing.zope import WSGIServer from Products.MailHost.interfaces import IMailHost from robot.libraries.BuiltIn import BuiltIn from webtest.http import StopableWSGIServer From 6954b93d9abd25d2ed1e2cf3c6409f77f2b1aaae Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Sat, 8 Apr 2023 17:25:54 +0200 Subject: [PATCH 5/9] chore: black --- src/plone/app/robotframework/reload.py | 2 -- src/plone/app/robotframework/remote.py | 1 - src/plone/app/robotframework/saucelabs.py | 7 +----- src/plone/app/robotframework/server.py | 10 +------- src/plone/app/robotframework/testing.py | 23 +++++++------------ .../app/robotframework/tests/test_content.py | 2 -- 6 files changed, 10 insertions(+), 35 deletions(-) diff --git a/src/plone/app/robotframework/reload.py b/src/plone/app/robotframework/reload.py index 201aa656..614b8827 100644 --- a/src/plone/app/robotframework/reload.py +++ b/src/plone/app/robotframework/reload.py @@ -19,7 +19,6 @@ def ERROR(msg): class Watcher(FileSystemEventHandler): - allowed_extensions = {"po", "pt", "py", "xml", "csv", "zcml"} def __init__(self, paths, forkloop, minimum_wait=2.0): @@ -74,7 +73,6 @@ def on_any_event(self, event): class ForkLoop: def __init__(self): - self.fork = True # Must be 'True' to create new child on start self.active = False self.pause = False diff --git a/src/plone/app/robotframework/remote.py b/src/plone/app/robotframework/remote.py index 29670010..e210e160 100644 --- a/src/plone/app/robotframework/remote.py +++ b/src/plone/app/robotframework/remote.py @@ -51,7 +51,6 @@ def run_keyword(self, name, args, kwargs={}): class RemoteLibraryLayer(Layer): - defaultBases = (PLONE_FIXTURE,) libraryBases = () diff --git a/src/plone/app/robotframework/saucelabs.py b/src/plone/app/robotframework/saucelabs.py index 59c92cb3..978327ba 100644 --- a/src/plone/app/robotframework/saucelabs.py +++ b/src/plone/app/robotframework/saucelabs.py @@ -13,12 +13,7 @@ class SauceLabs: def report_sauce_status(self, name, status, tags=[], remote_url=""): """Report test status and tags to SauceLabs""" - job_id = ( - BuiltIn() - .get_library_instance("Selenium2Library") - .driver - .session_id - ) + job_id = BuiltIn().get_library_instance("Selenium2Library").driver.session_id if USERNAME_ACCESS_KEY.match(remote_url): username, access_key = USERNAME_ACCESS_KEY.findall(remote_url)[0][1:] diff --git a/src/plone/app/robotframework/server.py b/src/plone/app/robotframework/server.py index 55b8b4f6..c21ba8b4 100644 --- a/src/plone/app/robotframework/server.py +++ b/src/plone/app/robotframework/server.py @@ -47,7 +47,6 @@ def READY(msg): def start(zope_layer_dotted_name): - print(WAIT("Starting Zope robot server")) zsl = Zope2Server() @@ -98,7 +97,6 @@ def start_reload( preload_layer_dotted_name="plone.app.testing.PLONE_FIXTURE", extensions=None, ): - print(WAIT("Starting Zope robot server")) zsl = Zope2Server() @@ -231,7 +229,6 @@ def server(): class RobotListener: - ROBOT_LISTENER_API_VERSION = 2 def __init__(self): @@ -249,7 +246,6 @@ def end_test(self, name, attrs): class Zope2Server: - stop_zope_server_lazy = False # trigger lazy Zope2Server shutdown stop_zope_server_layer = None # sticky layer for lazy shutdown @@ -319,11 +315,7 @@ def zodb_setup(self, layer_dotted_name=None): for layer in layers: if hasattr(layer, "testSetUp"): if HAS_VERBOSE_CONSOLE: - print( - WAIT( - f"Test set up {layer.__module__}.{layer.__name__}" - ) - ) + print(WAIT(f"Test set up {layer.__module__}.{layer.__name__}")) layer.testSetUp() if HAS_VERBOSE_CONSOLE: print(READY("Test set up")) diff --git a/src/plone/app/robotframework/testing.py b/src/plone/app/robotframework/testing.py index 744ac349..6e3a191b 100644 --- a/src/plone/app/robotframework/testing.py +++ b/src/plone/app/robotframework/testing.py @@ -56,7 +56,6 @@ def tearDown(self): class SimplePublicationWithTypesLayer(Layer): - defaultBases = (SIMPLE_PUBLICATION_FIXTURE,) def setUp(self): @@ -207,7 +206,6 @@ def _get_robot_variable(self, name): return filter(bool, [s.strip() for s in candidates]) def setUpZope(self, app, configurationContext): - # This installs the VHM in the Zope root, so we can have VHM support too AppInitializer(app).install_virtual_hosting() @@ -294,26 +292,22 @@ def __nonzero__(x): class WSGIServerSingleThreaded(WSGIServer): - def setUpServer(self): - """Create a single threaded WSGI server instance and save it in self.server. - """ + """Create a single threaded WSGI server instance and save it in self.server.""" app = self.make_wsgi_app() - kwargs = {'clear_untrusted_proxy_headers': False, - 'threads': 1} + kwargs = {"clear_untrusted_proxy_headers": False, "threads": 1} if self.host is not None: - kwargs['host'] = self.host + kwargs["host"] = self.host if self.port is not None: - kwargs['port'] = int(self.port) + kwargs["port"] = int(self.port) self.server = StopableWSGIServer.create(app, **kwargs) # If we dynamically set the host/port, we want to reset it to localhost # Otherwise this will depend on, for example, the local network setup - if self.host in (None, '0.0.0.0', '127.0.0.1', 'localhost'): - self.server.effective_host = 'localhost' + if self.host in (None, "0.0.0.0", "127.0.0.1", "localhost"): + self.server.effective_host = "localhost" # Refresh the hostname and port in case we dynamically picked them - self['host'] = self.host = self.server.effective_host - self['port'] = self.port = int(self.server.effective_port) - + self["host"] = self.host = self.server.effective_host + self["port"] = self.port = int(self.server.effective_port) WSGI_SERVER_SINGLE_THREADED_FIXTURE = WSGIServerSingleThreaded() @@ -332,7 +326,6 @@ def setUpServer(self): if HAS_SPEAKJS: class SpeakJSLayer(Layer): - defaultBases = (PLONE_FIXTURE,) def setUp(self): diff --git a/src/plone/app/robotframework/tests/test_content.py b/src/plone/app/robotframework/tests/test_content.py index 9052b24d..516878e7 100644 --- a/src/plone/app/robotframework/tests/test_content.py +++ b/src/plone/app/robotframework/tests/test_content.py @@ -7,7 +7,6 @@ class TestCreateContent(unittest.TestCase): - layer = PLONE_ROBOT_INTEGRATION_TESTING def setUp(self): @@ -50,7 +49,6 @@ def test_create_content_updates_catalog(self): class TestGlobalAllow(unittest.TestCase): - layer = PLONE_ROBOT_INTEGRATION_TESTING def setUp(self): From 63c61ab607b5d553b0f21458773c64a5d7e4ef46 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Sat, 8 Apr 2023 17:26:36 +0200 Subject: [PATCH 6/9] chore: zpretty --- docs/source/libdoc/python_debugging.html | 151 +++++++++++------- docs/source/libdoc/python_layoutmath.html | 151 +++++++++++------- docs/source/libdoc/python_saucelabs.html | 151 +++++++++++------- docs/source/libdoc/python_zope2server.html | 151 +++++++++++------- docs/source/libdoc/remote_autologin.html | 151 +++++++++++------- docs/source/libdoc/remote_content.html | 151 +++++++++++------- docs/source/libdoc/remote_genericsetup.html | 151 +++++++++++------- docs/source/libdoc/remote_i18n.html | 151 +++++++++++------- docs/source/libdoc/remote_mockmailhost.html | 151 +++++++++++------- docs/source/libdoc/remote_quickinstaller.html | 151 +++++++++++------- docs/source/libdoc/remote_users.html | 151 +++++++++++------- docs/source/libdoc/remote_zope2server.html | 151 +++++++++++------- docs/source/libdoc/selenium.html | 131 +++++++++------ docs/source/libdoc/user_keywords.html | 151 +++++++++++------- docs/source/libdoc/user_saucelabs.html | 151 +++++++++++------- docs/source/libdoc/user_selenium.html | 151 +++++++++++------- docs/source/libdoc/user_server.html | 151 +++++++++++------- 17 files changed, 1603 insertions(+), 944 deletions(-) diff --git a/docs/source/libdoc/python_debugging.html b/docs/source/libdoc/python_debugging.html index 0da14491..840b74cb 100644 --- a/docs/source/libdoc/python_debugging.html +++ b/docs/source/libdoc/python_debugging.html @@ -1,13 +1,28 @@ - - - - - - - - - + - + - + - - + - + - + - + - - - + + + + -
-

Opening library documentation failed

-
    -
  • Verify that you have JavaScript enabled in your browser.
  • -
  • Make sure you are using a modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • -
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • -
-
+
+

Opening library documentation failed

+
    +
  • Verify that you have + JavaScript enabled + in your browser.
  • +
  • Make sure you are using a + modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • +
  • Check are there messages in your browser's + JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
- + - + - + - + - + - + - + - + - + - + diff --git a/docs/source/libdoc/python_layoutmath.html b/docs/source/libdoc/python_layoutmath.html index 97356fed..d672ecc2 100644 --- a/docs/source/libdoc/python_layoutmath.html +++ b/docs/source/libdoc/python_layoutmath.html @@ -1,13 +1,28 @@ - - - - - - - - - + - + - + - - + - + - + - + - - - + + + + -
-

Opening library documentation failed

-
    -
  • Verify that you have JavaScript enabled in your browser.
  • -
  • Make sure you are using a modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • -
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • -
-
+
+

Opening library documentation failed

+
    +
  • Verify that you have + JavaScript enabled + in your browser.
  • +
  • Make sure you are using a + modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • +
  • Check are there messages in your browser's + JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
- + - + - + - + - + - + - + - + - + - + diff --git a/docs/source/libdoc/python_saucelabs.html b/docs/source/libdoc/python_saucelabs.html index e31f6d15..47c85ae8 100644 --- a/docs/source/libdoc/python_saucelabs.html +++ b/docs/source/libdoc/python_saucelabs.html @@ -1,13 +1,28 @@ - - - - - - - - - + - + - + - - + - + - + - + - - - + + + + -
-

Opening library documentation failed

-
    -
  • Verify that you have JavaScript enabled in your browser.
  • -
  • Make sure you are using a modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • -
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • -
-
+
+

Opening library documentation failed

+
    +
  • Verify that you have + JavaScript enabled + in your browser.
  • +
  • Make sure you are using a + modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • +
  • Check are there messages in your browser's + JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
- + - + - + - + - + - + - + - + - + - + diff --git a/docs/source/libdoc/python_zope2server.html b/docs/source/libdoc/python_zope2server.html index 634cac2e..1576c859 100644 --- a/docs/source/libdoc/python_zope2server.html +++ b/docs/source/libdoc/python_zope2server.html @@ -1,13 +1,28 @@ - - - - - - - - - + - + - + - - + - + - + - + - - - + + + + -
-

Opening library documentation failed

-
    -
  • Verify that you have JavaScript enabled in your browser.
  • -
  • Make sure you are using a modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • -
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • -
-
+
+

Opening library documentation failed

+
    +
  • Verify that you have + JavaScript enabled + in your browser.
  • +
  • Make sure you are using a + modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • +
  • Check are there messages in your browser's + JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
- + - + - + - + - + - + - + - + - + - + diff --git a/docs/source/libdoc/remote_autologin.html b/docs/source/libdoc/remote_autologin.html index 673199cb..113d195b 100644 --- a/docs/source/libdoc/remote_autologin.html +++ b/docs/source/libdoc/remote_autologin.html @@ -1,13 +1,28 @@ - - - - - - - - - + - + - + - - + - + - + - + - - - + + + + -
-

Opening library documentation failed

-
    -
  • Verify that you have JavaScript enabled in your browser.
  • -
  • Make sure you are using a modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • -
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • -
-
+
+

Opening library documentation failed

+
    +
  • Verify that you have + JavaScript enabled + in your browser.
  • +
  • Make sure you are using a + modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • +
  • Check are there messages in your browser's + JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
- + - + - + - + - + - + - + - + - + - + diff --git a/docs/source/libdoc/remote_content.html b/docs/source/libdoc/remote_content.html index c19ccbfc..16452ddb 100644 --- a/docs/source/libdoc/remote_content.html +++ b/docs/source/libdoc/remote_content.html @@ -1,13 +1,28 @@ - - - - - - - - - + - + - + - - + - + - + - + - - - + + + + -
-

Opening library documentation failed

-
    -
  • Verify that you have JavaScript enabled in your browser.
  • -
  • Make sure you are using a modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • -
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • -
-
+
+

Opening library documentation failed

+
    +
  • Verify that you have + JavaScript enabled + in your browser.
  • +
  • Make sure you are using a + modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • +
  • Check are there messages in your browser's + JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
- + - + - + - + - + - + - + - + - + - + diff --git a/docs/source/libdoc/remote_genericsetup.html b/docs/source/libdoc/remote_genericsetup.html index 5a478d02..b3d4b7bd 100644 --- a/docs/source/libdoc/remote_genericsetup.html +++ b/docs/source/libdoc/remote_genericsetup.html @@ -1,13 +1,28 @@ - - - - - - - - - + - + - + - - + - + - + - + - - - + + + + -
-

Opening library documentation failed

-
    -
  • Verify that you have JavaScript enabled in your browser.
  • -
  • Make sure you are using a modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • -
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • -
-
+
+

Opening library documentation failed

+
    +
  • Verify that you have + JavaScript enabled + in your browser.
  • +
  • Make sure you are using a + modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • +
  • Check are there messages in your browser's + JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
- + - + - + - + - + - + - + - + - + - + diff --git a/docs/source/libdoc/remote_i18n.html b/docs/source/libdoc/remote_i18n.html index 970e0b4a..6efb53ea 100644 --- a/docs/source/libdoc/remote_i18n.html +++ b/docs/source/libdoc/remote_i18n.html @@ -1,13 +1,28 @@ - - - - - - - - - + - + - + - - + - + - + - + - - - + + + + -
-

Opening library documentation failed

-
    -
  • Verify that you have JavaScript enabled in your browser.
  • -
  • Make sure you are using a modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • -
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • -
-
+
+

Opening library documentation failed

+
    +
  • Verify that you have + JavaScript enabled + in your browser.
  • +
  • Make sure you are using a + modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • +
  • Check are there messages in your browser's + JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
- + - + - + - + - + - + - + - + - + - + diff --git a/docs/source/libdoc/remote_mockmailhost.html b/docs/source/libdoc/remote_mockmailhost.html index 962eb517..1ed80700 100644 --- a/docs/source/libdoc/remote_mockmailhost.html +++ b/docs/source/libdoc/remote_mockmailhost.html @@ -1,13 +1,28 @@ - - - - - - - - - + - + - + - - + - + - + - + - - - + + + + -
-

Opening library documentation failed

-
    -
  • Verify that you have JavaScript enabled in your browser.
  • -
  • Make sure you are using a modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • -
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • -
-
+
+

Opening library documentation failed

+
    +
  • Verify that you have + JavaScript enabled + in your browser.
  • +
  • Make sure you are using a + modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • +
  • Check are there messages in your browser's + JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
- + - + - + - + - + - + - + - + - + - + diff --git a/docs/source/libdoc/remote_quickinstaller.html b/docs/source/libdoc/remote_quickinstaller.html index fd713c5e..58085bd4 100644 --- a/docs/source/libdoc/remote_quickinstaller.html +++ b/docs/source/libdoc/remote_quickinstaller.html @@ -1,13 +1,28 @@ - - - - - - - - - + - + - + - - + - + - + - + - - - + + + + -
-

Opening library documentation failed

-
    -
  • Verify that you have JavaScript enabled in your browser.
  • -
  • Make sure you are using a modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • -
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • -
-
+
+

Opening library documentation failed

+
    +
  • Verify that you have + JavaScript enabled + in your browser.
  • +
  • Make sure you are using a + modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • +
  • Check are there messages in your browser's + JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
- + - + - + - + - + - + - + - + - + - + diff --git a/docs/source/libdoc/remote_users.html b/docs/source/libdoc/remote_users.html index fef16e93..ca10bc10 100644 --- a/docs/source/libdoc/remote_users.html +++ b/docs/source/libdoc/remote_users.html @@ -1,13 +1,28 @@ - - - - - - - - - + - + - + - - + - + - + - + - - - + + + + -
-

Opening library documentation failed

-
    -
  • Verify that you have JavaScript enabled in your browser.
  • -
  • Make sure you are using a modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • -
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • -
-
+
+

Opening library documentation failed

+
    +
  • Verify that you have + JavaScript enabled + in your browser.
  • +
  • Make sure you are using a + modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • +
  • Check are there messages in your browser's + JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
- + - + - + - + - + - + - + - + - + - + diff --git a/docs/source/libdoc/remote_zope2server.html b/docs/source/libdoc/remote_zope2server.html index e4c539fe..829dc641 100644 --- a/docs/source/libdoc/remote_zope2server.html +++ b/docs/source/libdoc/remote_zope2server.html @@ -1,13 +1,28 @@ - - - - - - - - - + - + - + - - + - + - + - + - - - + + + + -
-

Opening library documentation failed

-
    -
  • Verify that you have JavaScript enabled in your browser.
  • -
  • Make sure you are using a modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • -
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • -
-
+
+

Opening library documentation failed

+
    +
  • Verify that you have + JavaScript enabled + in your browser.
  • +
  • Make sure you are using a + modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • +
  • Check are there messages in your browser's + JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
- + - + - + - + - + - + - + - + - + - + diff --git a/docs/source/libdoc/selenium.html b/docs/source/libdoc/selenium.html index 55c01242..f82b307f 100644 --- a/docs/source/libdoc/selenium.html +++ b/docs/source/libdoc/selenium.html @@ -1,13 +1,28 @@ - - - - - - - - - + - + - + - - + - + - - - + + + + -
-

Opening library documentation failed

-
    -
  • Verify that you have JavaScript enabled in your browser.
  • -
  • Make sure you are using a modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • -
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • -
-
+
+

Opening library documentation failed

+
    +
  • Verify that you have + JavaScript enabled + in your browser.
  • +
  • Make sure you are using a + modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • +
  • Check are there messages in your browser's + JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
- + - + - + - + - + - - + + - + diff --git a/docs/source/libdoc/user_keywords.html b/docs/source/libdoc/user_keywords.html index 990f5417..27abf9cf 100644 --- a/docs/source/libdoc/user_keywords.html +++ b/docs/source/libdoc/user_keywords.html @@ -1,13 +1,28 @@ - - - - - - - - - + - + - + - - + - + - + - + - - - + + + + -
-

Opening library documentation failed

-
    -
  • Verify that you have JavaScript enabled in your browser.
  • -
  • Make sure you are using a modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • -
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • -
-
+
+

Opening library documentation failed

+
    +
  • Verify that you have + JavaScript enabled + in your browser.
  • +
  • Make sure you are using a + modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • +
  • Check are there messages in your browser's + JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
- + - + - + - + - + - + - + - + - + - + diff --git a/docs/source/libdoc/user_saucelabs.html b/docs/source/libdoc/user_saucelabs.html index c3356ea6..66b25d38 100644 --- a/docs/source/libdoc/user_saucelabs.html +++ b/docs/source/libdoc/user_saucelabs.html @@ -1,13 +1,28 @@ - - - - - - - - - + - + - + - - + - + - + - + - - - + + + + -
-

Opening library documentation failed

-
    -
  • Verify that you have JavaScript enabled in your browser.
  • -
  • Make sure you are using a modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • -
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • -
-
+
+

Opening library documentation failed

+
    +
  • Verify that you have + JavaScript enabled + in your browser.
  • +
  • Make sure you are using a + modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • +
  • Check are there messages in your browser's + JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
- + - + - + - + - + - + - + - + - + - + diff --git a/docs/source/libdoc/user_selenium.html b/docs/source/libdoc/user_selenium.html index 3b8b8f11..280a3f0a 100644 --- a/docs/source/libdoc/user_selenium.html +++ b/docs/source/libdoc/user_selenium.html @@ -1,13 +1,28 @@ - - - - - - - - - + - + - + - - + - + - + - + - - - + + + + -
-

Opening library documentation failed

-
    -
  • Verify that you have JavaScript enabled in your browser.
  • -
  • Make sure you are using a modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • -
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • -
-
+
+

Opening library documentation failed

+
    +
  • Verify that you have + JavaScript enabled + in your browser.
  • +
  • Make sure you are using a + modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • +
  • Check are there messages in your browser's + JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
- + - + - + - + - + - + - + - + - + - + diff --git a/docs/source/libdoc/user_server.html b/docs/source/libdoc/user_server.html index 523d80e5..7624256a 100644 --- a/docs/source/libdoc/user_server.html +++ b/docs/source/libdoc/user_server.html @@ -1,13 +1,28 @@ - - - - - - - - - + - + - + - - + - + - + - + - - - + + + + -
-

Opening library documentation failed

-
    -
  • Verify that you have JavaScript enabled in your browser.
  • -
  • Make sure you are using a modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • -
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • -
-
+
+

Opening library documentation failed

+
    +
  • Verify that you have + JavaScript enabled + in your browser.
  • +
  • Make sure you are using a + modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • +
  • Check are there messages in your browser's + JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
- + - + - + - + - + - + - + - + - + - + From 5189df595412fd1223eb82fde180f0a98353527b Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Sat, 8 Apr 2023 17:33:47 +0200 Subject: [PATCH 7/9] feat: codespell --- CHANGES.rst | 8 ++++---- docs/source/happy.rst | 2 +- docs/source/keywords.rst | 2 +- docs/source/remote.rst | 2 +- docs/source/robot.rst | 6 +++--- src/plone/app/robotframework/content.py | 2 +- src/plone/app/robotframework/i18n.py | 2 +- src/plone/app/robotframework/robotentrypoints.py | 2 +- src/plone/app/robotframework/server.py | 2 +- src/plone/app/robotframework/users.py | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 0163e8ee..a1cd1635 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -585,7 +585,7 @@ Fixes: ------------------ - Add a new command-line option for robot-server to start Zope in debug-mode - (useage: bin/robot-server -d or bin/robot-server --debug-mode) + (usage: bin/robot-server -d or bin/robot-server --debug-mode) [datakurre] - Change robot LISTENER_PORT (used in communication between bin/robot-server and bin/robot via robotframework) to default port 49999 instead of 10001 @@ -676,7 +676,7 @@ Fixes: 0.7.1 (2014-02-08) ------------------ -- Add ignored Sphinx-directives to pybot to make it easier to run pybot agains +- Add ignored Sphinx-directives to pybot to make it easier to run pybot against Sphinx documentation [datakurre] - Update libdoc-generated documentations @@ -825,7 +825,7 @@ This is Arnhem Sprint preview release of 0.7.0. 0.6.0 (2013-04-30) ------------------ -- Add verbose console outout for robot-server for test setup and teardown +- Add verbose console output for robot-server for test setup and teardown [datakurre] - Documentation update [datakurre, Silvio Tomatis] @@ -892,7 +892,7 @@ This is Arnhem Sprint preview release of 0.7.0. ------------------ - PLOG2013 development release. -- Define dedicated re-usable AUTOLOGIN_ROBOT_FIXTURE +- Define dedicated reusable AUTOLOGIN_ROBOT_FIXTURE - Drop BBB for plone.act - Drop entrypoints for pure pybot and rebot to make it easier to use them pure without extra dependencies by installing robotentrypoints-package diff --git a/docs/source/happy.rst b/docs/source/happy.rst index 5fd8002b..f21e291b 100644 --- a/docs/source/happy.rst +++ b/docs/source/happy.rst @@ -398,7 +398,7 @@ execution* keyword, you can pause the test at any point to make it possible to figure out what to do next. (Dialogs depend on `TkInter-library `_.) -.. note:: Be sure to remove *Import libary* and *Pause execution* +.. note:: Be sure to remove *Import library* and *Pause execution* keyword calls before committing your tests to avoid pausing your tests on CI. diff --git a/docs/source/keywords.rst b/docs/source/keywords.rst index c18883ed..d838e520 100644 --- a/docs/source/keywords.rst +++ b/docs/source/keywords.rst @@ -10,7 +10,7 @@ Selenium2Library Keywords Selenium2Library is a web testing library for Robot Framework. It provides you with several low-level keywords to access certain elements of a web page, to -conduct actions on a web page and to test if a page met certain acceptance critera. +conduct actions on a web page and to test if a page met certain acceptance criteria. First Example diff --git a/docs/source/remote.rst b/docs/source/remote.rst index 1284b91e..46f9988e 100644 --- a/docs/source/remote.rst +++ b/docs/source/remote.rst @@ -6,7 +6,7 @@ test environment for the actual tests-clauses (*When* and *Then*). Because Given-clauses are not really part of the actual test, it is not necessary to run them through Selenium (using Selenium2Library), but it would -be faster to write custon Python keywords for them. +be faster to write custom Python keywords for them. **plone.act** includes an example, how to a robot `remote library `_, diff --git a/docs/source/robot.rst b/docs/source/robot.rst index 0729d502..4210d2ea 100644 --- a/docs/source/robot.rst +++ b/docs/source/robot.rst @@ -49,7 +49,7 @@ Each test suite may contain one to four different parts: calling test keywords. **Keywords** - Is used to define new user keywords, which may re-use existing keywords + Is used to define new user keywords, which may reuse existing keywords from imported libraries or resource files. @@ -132,14 +132,14 @@ Remote-library approach provides the following benefits when testing Plone: Resource files -------------- -Resource files provide a re-usable way to abstract your test suites. To put +Resource files provide a reusable way to abstract your test suites. To put it simply, resources files are just like all the other ``.robot``-files, but they should not contain ``*** Test Cases ***`` certain ``*** Settings ***`` commands (*Suite Setup*, *Suite Teardown*, *Test Setup* or *Test Teardown*). Resource files are the perfect way to import common libraries (with *Library* command in ```*** Settings ***``), define global ``*** Variables ***`` and -define re-usable common ```*** Keywords ***```. Resource files are included +define reusable common ```*** Keywords ***```. Resource files are included in a test suite with *Resource*-command in ```*** Settings ***``: .. code-block:: robotframework diff --git a/src/plone/app/robotframework/content.py b/src/plone/app/robotframework/content.py index 31459b28..75d6cc89 100644 --- a/src/plone/app/robotframework/content.py +++ b/src/plone/app/robotframework/content.py @@ -224,7 +224,7 @@ def fire_transition(self, content, action): """Fire workflow action for content""" disableCSRFProtection() # It should be ok to use unrestricted-methods, because workflow - # transition guard should proctect unprivileged transition: + # transition guard should protect unprivileged transition: pc = getToolByName(self, "portal_catalog") results = pc.unrestrictedSearchResults(UID=content) obj = results[0]._unrestrictedGetObject() diff --git a/src/plone/app/robotframework/i18n.py b/src/plone/app/robotframework/i18n.py index 2af6f824..73d132a0 100644 --- a/src/plone/app/robotframework/i18n.py +++ b/src/plone/app/robotframework/i18n.py @@ -21,7 +21,7 @@ def set_default_language(self, language=None): def translate(self, msgid, *args, **kwargs): """Return localized string for given msgid""" - # FIXME: we are alrady using robotframework = 3.0 + # FIXME: we are already using robotframework = 3.0 # XXX: Because kwargs are only supported with robotframework >= 2.8.3, # we must parse them here to support robotframework < 2.8.3. for arg in [x for x in args if "=" in x]: diff --git a/src/plone/app/robotframework/robotentrypoints.py b/src/plone/app/robotframework/robotentrypoints.py index 71357d5a..8159b327 100644 --- a/src/plone/app/robotframework/robotentrypoints.py +++ b/src/plone/app/robotframework/robotentrypoints.py @@ -69,7 +69,7 @@ def ride(): plone.app.robotframework[ride,reload] -Remember that ride must be lauched with system python with +Remember that ride must be launched with system python with wxPython installed, like: /usr/bin/python bin/ride diff --git a/src/plone/app/robotframework/server.py b/src/plone/app/robotframework/server.py index c21ba8b4..6f8205e6 100644 --- a/src/plone/app/robotframework/server.py +++ b/src/plone/app/robotframework/server.py @@ -300,7 +300,7 @@ def stop_zope_server(self, force=False): if not self.stop_zope_server_lazy or force: tear_down() else: - # With lazy stop, the layer is saved to enable Zope2Server re-use + # With lazy stop, the layer is saved to enable Zope2Server reuse # within the same process, until tear_down is called explicitly. Zope2Server.stop_zope_server_layer = self.zope_layer self.zope_layer = None diff --git a/src/plone/app/robotframework/users.py b/src/plone/app/robotframework/users.py index 537e34e6..2611968f 100644 --- a/src/plone/app/robotframework/users.py +++ b/src/plone/app/robotframework/users.py @@ -11,7 +11,7 @@ class Users(RemoteLibrary): def create_user(self, *args, **kwargs): """Create user with given details and return its id""" disableCSRFProtection() - # FIXME: we are alrady using robotframework = 3.0 + # FIXME: we are already using robotframework = 3.0 # XXX: Because kwargs are only supported with robotframework >= 2.8.3, # we must parse them here to support robotframework < 2.8.3. for arg in [x for x in args if "=" in x]: From 7aa057388618e4d2ec75ce10ce59af4dded3fae9 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Sat, 8 Apr 2023 17:36:52 +0200 Subject: [PATCH 8/9] feat: flake8 --- docs/source/conf.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 77437660..0f15e1ea 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -10,10 +10,6 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import os -import sys - - # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -172,11 +168,11 @@ latex_elements = { # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', + # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', + # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. - #'preamble': '', + # 'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples From 151dc374970c3295ebe33db797da72a23e57ed68 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Sat, 8 Apr 2023 18:25:26 +0200 Subject: [PATCH 9/9] feat: declare dependencies --- setup.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index a78eeb34..c578ea70 100644 --- a/setup.py +++ b/setup.py @@ -49,14 +49,20 @@ def read(filename): entry_points = dict(console_scripts=console_scripts) install_requires = [ - "Products.CMFCore", + "Pillow", "Products.CMFPlone", - "Products.MailHost", "Products.PlonePAS >= 5.0.1", "Products.PluggableAuthService", "babel", + "docutils", "plone.app.testing", + "plone.app.textfield", "plone.base", + "plone.dexterity", + "plone.i18n", + "plone.namedfile", + "plone.protect", + "plone.registry", "plone.testing", "plone.uuid", "robotframework", @@ -66,19 +72,23 @@ def read(filename): "robotsuite", # not a direct dependency, but required for convenience "selenium", "setuptools", + "z3c.form", + "z3c.relationfield", "zope.component", - "zope.configuration", "zope.i18n", + "zope.intid", "zope.schema", "zope.testrunner", ] test_requires = [ - "plone.app.dexterity", + "Products.MailHost", "plone.app.textfield", "plone.dexterity", "robotsuite", + "webtest", "z3c.form", + "zope.configuration", ] debug_requires = [