From fcca71cba15aabaf563c9fb2b3dc5adabcedfd69 Mon Sep 17 00:00:00 2001 From: Cedric <95940265+ddl-cedricyoung@users.noreply.github.com> Date: Tue, 10 Sep 2024 16:58:22 -0700 Subject: [PATCH] QE-11629 publish and launch (#525) - chore - prep for publish - replace black with ruff - remove detect-secrets to be replaced by GH repo security - remove bandit to be replaced by GH CodeQL - cleanup makefile --- .circleci/config.yml | 10 +- .pre-commit-config.yaml | 4 +- .secrets.baseline | 223 ------------------------------------ CHANGELOG.md | 7 ++ Makefile | 62 ++++------ README.md | 29 ++--- poetry.lock | 208 +-------------------------------- pyproject.toml | 24 +--- src/cucu/behave_tweaks.py | 2 +- src/cucu/formatter/junit.py | 6 +- src/cucu/lint/linter.py | 6 +- 11 files changed, 60 insertions(+), 521 deletions(-) delete mode 100644 .secrets.baseline diff --git a/.circleci/config.yml b/.circleci/config.yml index 51970218..cc2d00a4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,25 +6,25 @@ version: 2.1 workflows: build-test-publish: jobs: - - pre-commit + - build - test: name: test-chrome browser: chrome requires: - - pre-commit + - build - test: name: test-edge browser: edge requires: - - pre-commit + - build - test: name: test-firefox browser: firefox requires: - - pre-commit + - build jobs: - pre-commit: + build: docker: - image: cimg/python:3.11.7 resource_class: medium diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 48bddb87..976fbe32 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,9 +13,9 @@ repos: - repo: local hooks: - id: makefile - name: run make check + name: run make lint entry: make - args: ["check"] + args: ["lint"] language: system pass_filenames: false verbose: true diff --git a/.secrets.baseline b/.secrets.baseline deleted file mode 100644 index d7bddeff..00000000 --- a/.secrets.baseline +++ /dev/null @@ -1,223 +0,0 @@ -{ - "version": "1.5.0", - "plugins_used": [ - { - "name": "ArtifactoryDetector" - }, - { - "name": "AWSKeyDetector" - }, - { - "name": "AzureStorageKeyDetector" - }, - { - "name": "Base64HighEntropyString", - "limit": 4.5 - }, - { - "name": "BasicAuthDetector" - }, - { - "name": "CloudantDetector" - }, - { - "name": "DiscordBotTokenDetector" - }, - { - "name": "GitHubTokenDetector" - }, - { - "name": "HexHighEntropyString", - "limit": 3.0 - }, - { - "name": "IbmCloudIamDetector" - }, - { - "name": "IbmCosHmacDetector" - }, - { - "name": "JwtTokenDetector" - }, - { - "name": "KeywordDetector", - "keyword_exclude": "" - }, - { - "name": "MailchimpDetector" - }, - { - "name": "NpmDetector" - }, - { - "name": "PrivateKeyDetector" - }, - { - "name": "SendGridDetector" - }, - { - "name": "SlackDetector" - }, - { - "name": "SoftlayerDetector" - }, - { - "name": "SquareOAuthDetector" - }, - { - "name": "StripeDetector" - }, - { - "name": "TwilioKeyDetector" - } - ], - "filters_used": [ - { - "path": "detect_secrets.filters.allowlist.is_line_allowlisted" - }, - { - "path": "detect_secrets.filters.common.is_baseline_file", - "filename": ".secrets.baseline" - }, - { - "path": "detect_secrets.filters.heuristic.is_indirect_reference" - }, - { - "path": "detect_secrets.filters.heuristic.is_likely_id_string" - }, - { - "path": "detect_secrets.filters.heuristic.is_lock_file" - }, - { - "path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string" - }, - { - "path": "detect_secrets.filters.heuristic.is_potential_uuid" - }, - { - "path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign" - }, - { - "path": "detect_secrets.filters.heuristic.is_sequential_string" - }, - { - "path": "detect_secrets.filters.heuristic.is_swagger_file" - }, - { - "path": "detect_secrets.filters.heuristic.is_templated_secret" - } - ], - "results": { - "Makefile": [ - { - "type": "Secret Keyword", - "filename": "Makefile", - "hashed_secret": "0ef3e7e357d64c01f01b9dc045413c135ce64ff7", - "is_verified": false, - "line_number": 34, - "is_secret": false - }, - { - "type": "Secret Keyword", - "filename": "Makefile", - "hashed_secret": "dbbabcbd340d134fef3e212d83a00846839903f6", - "is_verified": false, - "line_number": 35, - "is_secret": false - } - ], - "data/features/with_secret/cucurc.yml": [ - { - "type": "Secret Keyword", - "filename": "data/features/with_secret/cucurc.yml", - "hashed_secret": "8be8adcd67ecd47e99d7ac1894b40b2fce30693b", - "is_verified": false, - "line_number": 1, - "is_secret": false - } - ], - "features/cli/secrets.feature": [ - { - "type": "Secret Keyword", - "filename": "features/cli/secrets.feature", - "hashed_secret": "e24fe0dea7f9abe8cbb192702578715079689a3e", - "is_verified": false, - "line_number": 27, - "is_secret": false - }, - { - "type": "Secret Keyword", - "filename": "features/cli/secrets.feature", - "hashed_secret": "dbdab9be92cacdae6a97e8601332bfaa8545800f", - "is_verified": false, - "line_number": 101, - "is_secret": false - } - ], - "features/cli/steps.feature": [ - { - "type": "Secret Keyword", - "filename": "features/cli/steps.feature", - "hashed_secret": "e24fe0dea7f9abe8cbb192702578715079689a3e", - "is_verified": false, - "line_number": 29, - "is_secret": false - } - ], - "features/cli/vars.feature": [ - { - "type": "Hex High Entropy String", - "filename": "features/cli/vars.feature", - "hashed_secret": "e4dc6310dd88e665397554a30237c8a97cd1a58f", - "is_verified": false, - "line_number": 52, - "is_secret": false - }, - { - "type": "Secret Keyword", - "filename": "features/cli/vars.feature", - "hashed_secret": "0d3e90591f383a663d006687d634d8998ce49d40", - "is_verified": false, - "line_number": 119, - "is_secret": false - } - ], - "src/cucu/edgedriver_autoinstaller/utils.py": [ - { - "type": "Base64 High Entropy String", - "filename": "src/cucu/edgedriver_autoinstaller/utils.py", - "hashed_secret": "dcbc2948c76d41ad5d9175b38c02a108217f012d", - "is_verified": false, - "line_number": 124, - "is_secret": false - } - ], - "tests/test_behave_tweaks.py": [ - { - "type": "Secret Keyword", - "filename": "tests/test_behave_tweaks.py", - "hashed_secret": "8843d7f92416211de9ebb963ff4ce28125932878", - "is_verified": false, - "line_number": 10, - "is_secret": false - }, - { - "type": "Secret Keyword", - "filename": "tests/test_behave_tweaks.py", - "hashed_secret": "1a9853f741abda2e278d1887b8c24d320c74fd59", - "is_verified": false, - "line_number": 17, - "is_secret": false - }, - { - "type": "Secret Keyword", - "filename": "tests/test_behave_tweaks.py", - "hashed_secret": "f2dad1353e334c3cb0dbbfe8b1b69aa8c315137f", - "is_verified": false, - "line_number": 25, - "is_secret": false - } - ] - }, - "generated_at": "2024-06-13T18:01:40Z" -} diff --git a/CHANGELOG.md b/CHANGELOG.md index 86da428d..51e2e553 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project closely adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.206.0 +- chore - prep for publish +- replace black with ruff +- remove detect-secrets to be replaced by GH repo security +- remove bandit to be replaced by GH CodeQL +- cleanup makefile + ## 0.205.0 - change - increase information logged for failing before_scenario_hooks diff --git a/Makefile b/Makefile index 03c7543b..74aee6c5 100644 --- a/Makefile +++ b/Makefile @@ -1,62 +1,47 @@ -# help menu when you run just `make` +# default target +all: help setup fix lint test build + help: # Provided as a convience to run commands with poetry - # install - installs the necessary development dependencies. - # format - formats the code - # check - checks the code - # test - tests the code - # build - build the dist - -install: src/* + # setup - installs the necessary development dependencies. + # fix - fixes code formatting + # lint - lints the code + # test - tests the code + # build - build the dist + +setup: src/* + # make setup poetry install -format: - poetry run black . +fix: + # make fix poetry run ruff format . - poetry run cucu lint features + poetry run cucu lint --fix features -check: - # format code - poetry run black . --check +lint: + # make lint # lint code poetry run ruff check . # lint .feature files poetry run cucu lint features - # lint code for security mistakes - poetry run bandit src features data -r -c pyproject.toml -q --severity high # check project config poetry check - # prevent new secrets - # 🔔 to update secrets ignore list use: make update-secrets - poetry run detect-secrets-hook -n --baseline .secrets.baseline $$(git ls-files -z | xargs -0) - -update-secrets: - poetry run detect-secrets scan -n --baseline .secrets.baseline - poetry run detect-secrets audit .secrets.baseline test: + # make test poetry run pytest tests - poetry run cucu run features --workers=4 + # ℹī¸ takes a while to run all cucu features + poetry run cucu run features --workers=4 --generate-report + # open HTML report at report/index.html build: + # make build rm -f dist/*.tar.gz rm -f dist/*.whl poetry build -qualify: - tox - -release: - # version and commit - poetry version minor - git add pyproject.toml - git commit -m "tagged release `poetry version -s`" - - # publish to test pypi - # publish to pypi - # publish to read the docs - coverage: src/* tests/* + # make coverage rm -fr .coverage .coverage.* # this makes it so all of the underlying `cucu` command calls are run # with the coverage enabled even when spawned as a separate process for the @@ -68,3 +53,6 @@ coverage: src/* tests/* poetry run coverage xml poetry run coverage report echo "open HTML coverage report at htmlcov/index.html" + +# disable caching for all make targets +.PHONY: all help format lint test build coverage diff --git a/README.md b/README.md index 2978c243..fe6bb7e3 100644 --- a/README.md +++ b/README.md @@ -17,12 +17,12 @@ to drive various underlying tools/frameworks to create real world testing scenar And I click the button "Google Search" Then I wait to see the text "results" ``` -2. Designed to be run **locally and in CI** +2. Designed to be run **locally** and in **CI** 3. Runs a selenium container for you OR you can bring your own browser / container 4. Does fuzzy matching to approximate actions of a real user 5. Provides many steps out of the box 6. Makes it easy to create **customized** steps -7. Enables hierarchical configuration and env var **and CLI arg overrides** +7. Enables hierarchical configuration and env var and **CLI arg overrides** 8. Comes with a linter that is **customizable** ## Supporting docs @@ -56,23 +56,18 @@ to drive various underlying tools/frameworks to create real world testing scenar # Installation ## Requirements Cucu requires -1. python 3.7+ +1. python 3.9+ 2. docker (to do UI testing) ## Install Walkthrough _Get your repo setup using cucu as a test framework_ 1. install and start Docker if you haven't already -2. add cucu your `requirements.txt` to get from GH by label (use current label number) +2. install [cucu](https://pypi.org/project/cucu/) ``` - git+ssh://git@github.com/dominodatalab/cucu@0.119.0#egg=cucu + pip install cucu ``` -3. install it - ```bash - pip install -r requirements.txt - ``` -4. create the folder structure and files with content: - +3. create the folder structure and files with content: _Cucu uses the [behave framework](https://github.com/behave/behave) which expects the `features/steps` directories_ - features/ - steps/ @@ -92,7 +87,7 @@ _Get your repo setup using cucu as a test framework_ # Define custom before/after hooks here ``` -1. list available cucu steps +4. list available cucu steps ```bash cucu steps ``` @@ -101,7 +96,7 @@ _Get your repo setup using cucu as a test framework_ cucu steps | fzf # start typing for search ``` -2. **create your first cucu test** +5. **create your first cucu test** - features/my_first_test.feature ```gherkin Feature: My First Cucu Test @@ -113,7 +108,7 @@ _Get your repo setup using cucu as a test framework_ And I click the button "Google Search" Then I wait to see the text "results" ``` -3. **run it** +6. **run it** ```bash cucu run features/my_first_test.feature ``` @@ -123,10 +118,10 @@ _Get your repo setup using cucu as a test framework_ The command `cucu run` is used to run a given test or set of tests and in its simplest form you can use it like so: ```bash -cucu run data/features/google_kitten_search.feature +cucu run features/my_first_test.feature ``` -That would simply run the "google search for kittens test" and once it's +That would simply run the "google search for the word google" and once it's finished executing you can use the `cucu report` command to generate an easy to navigate and read HTML test report which includes the steps and screenshots from that previous test run. @@ -372,7 +367,7 @@ In the `fix` section one can choose to do `match` and `replace` or to simply ## Install From Source Clone this repo locally and then proceed to install python 3.7+ as indicated -earlier. At this point you should be able to simply run `make install` at the +earlier. At this point you should be able to simply run `make setup` at the top level of the source tree and it should install all required dependencies. ## Install From Build diff --git a/poetry.lock b/poetry.lock index b9726601..8780065d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -59,30 +59,6 @@ files = [ {file = "backcall-0.2.0.tar.gz", hash = "sha256:5cbdbf27be5e7cfadb448baf0aa95508f91f2bbc6c6437cd9cd06e2a4c215e1e"}, ] -[[package]] -name = "bandit" -version = "1.7.9" -description = "Security oriented static analyser for python code." -optional = false -python-versions = ">=3.8" -files = [ - {file = "bandit-1.7.9-py3-none-any.whl", hash = "sha256:52077cb339000f337fb25f7e045995c4ad01511e716e5daac37014b9752de8ec"}, - {file = "bandit-1.7.9.tar.gz", hash = "sha256:7c395a436743018f7be0a4cbb0a4ea9b902b6d87264ddecf8cfdc73b4f78ff61"}, -] - -[package.dependencies] -colorama = {version = ">=0.3.9", markers = "platform_system == \"Windows\""} -PyYAML = ">=5.3.1" -rich = "*" -stevedore = ">=1.20.0" - -[package.extras] -baseline = ["GitPython (>=3.1.30)"] -sarif = ["jschema-to-python (>=1.2.3)", "sarif-om (>=1.0.4)"] -test = ["beautifulsoup4 (>=4.8.0)", "coverage (>=4.5.4)", "fixtures (>=3.0.0)", "flake8 (>=4.0.0)", "pylint (==1.9.4)", "stestr (>=2.5.0)", "testscenarios (>=0.5.0)", "testtools (>=2.3.0)"] -toml = ["tomli (>=1.1.0)"] -yaml = ["PyYAML"] - [[package]] name = "beautifulsoup4" version = "4.12.3" @@ -124,52 +100,6 @@ six = ">=1.11" develop = ["coverage", "invoke (>=0.21.0)", "modernize (>=0.5)", "path.py (>=8.1.2)", "pathlib", "pycmd", "pylint", "pytest (>=3.0)", "pytest-cov", "tox"] docs = ["sphinx (>=1.6)", "sphinx-bootstrap-theme (>=0.6)"] -[[package]] -name = "black" -version = "24.8.0" -description = "The uncompromising code formatter." -optional = false -python-versions = ">=3.8" -files = [ - {file = "black-24.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:09cdeb74d494ec023ded657f7092ba518e8cf78fa8386155e4a03fdcc44679e6"}, - {file = "black-24.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:81c6742da39f33b08e791da38410f32e27d632260e599df7245cccee2064afeb"}, - {file = "black-24.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:707a1ca89221bc8a1a64fb5e15ef39cd755633daa672a9db7498d1c19de66a42"}, - {file = "black-24.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:d6417535d99c37cee4091a2f24eb2b6d5ec42b144d50f1f2e436d9fe1916fe1a"}, - {file = "black-24.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:fb6e2c0b86bbd43dee042e48059c9ad7830abd5c94b0bc518c0eeec57c3eddc1"}, - {file = "black-24.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:837fd281f1908d0076844bc2b801ad2d369c78c45cf800cad7b61686051041af"}, - {file = "black-24.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:62e8730977f0b77998029da7971fa896ceefa2c4c4933fcd593fa599ecbf97a4"}, - {file = "black-24.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:72901b4913cbac8972ad911dc4098d5753704d1f3c56e44ae8dce99eecb0e3af"}, - {file = "black-24.8.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:7c046c1d1eeb7aea9335da62472481d3bbf3fd986e093cffd35f4385c94ae368"}, - {file = "black-24.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:649f6d84ccbae73ab767e206772cc2d7a393a001070a4c814a546afd0d423aed"}, - {file = "black-24.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2b59b250fdba5f9a9cd9d0ece6e6d993d91ce877d121d161e4698af3eb9c1018"}, - {file = "black-24.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:6e55d30d44bed36593c3163b9bc63bf58b3b30e4611e4d88a0c3c239930ed5b2"}, - {file = "black-24.8.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:505289f17ceda596658ae81b61ebbe2d9b25aa78067035184ed0a9d855d18afd"}, - {file = "black-24.8.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b19c9ad992c7883ad84c9b22aaa73562a16b819c1d8db7a1a1a49fb7ec13c7d2"}, - {file = "black-24.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1f13f7f386f86f8121d76599114bb8c17b69d962137fc70efe56137727c7047e"}, - {file = "black-24.8.0-cp38-cp38-win_amd64.whl", hash = "sha256:f490dbd59680d809ca31efdae20e634f3fae27fba3ce0ba3208333b713bc3920"}, - {file = "black-24.8.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:eab4dd44ce80dea27dc69db40dab62d4ca96112f87996bca68cd75639aeb2e4c"}, - {file = "black-24.8.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3c4285573d4897a7610054af5a890bde7c65cb466040c5f0c8b732812d7f0e5e"}, - {file = "black-24.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9e84e33b37be070ba135176c123ae52a51f82306def9f7d063ee302ecab2cf47"}, - {file = "black-24.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:73bbf84ed136e45d451a260c6b73ed674652f90a2b3211d6a35e78054563a9bb"}, - {file = "black-24.8.0-py3-none-any.whl", hash = "sha256:972085c618ee94f402da1af548a4f218c754ea7e5dc70acb168bfaca4c2542ed"}, - {file = "black-24.8.0.tar.gz", hash = "sha256:2500945420b6784c38b9ee885af039f5e7471ef284ab03fa35ecdde4688cd83f"}, -] - -[package.dependencies] -click = ">=8.0.0" -mypy-extensions = ">=0.4.3" -packaging = ">=22.0" -pathspec = ">=0.9.0" -platformdirs = ">=2" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""} - -[package.extras] -colorama = ["colorama (>=0.4.3)"] -d = ["aiohttp (>=3.7.4)", "aiohttp (>=3.7.4,!=3.9.0)"] -jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] -uvloop = ["uvloop (>=0.15.2)"] - [[package]] name = "cattrs" version = "23.2.3" @@ -521,25 +451,6 @@ files = [ {file = "decorator-5.1.1.tar.gz", hash = "sha256:637996211036b6385ef91435e4fae22989472f9d571faba8927ba8253acbc330"}, ] -[[package]] -name = "detect-secrets" -version = "1.5.0" -description = "Tool for detecting secrets in the codebase" -optional = false -python-versions = "*" -files = [ - {file = "detect_secrets-1.5.0-py3-none-any.whl", hash = "sha256:e24e7b9b5a35048c313e983f76c4bd09dad89f045ff059e354f9943bf45aa060"}, - {file = "detect_secrets-1.5.0.tar.gz", hash = "sha256:6bb46dcc553c10df51475641bb30fd69d25645cc12339e46c824c1e0c388898a"}, -] - -[package.dependencies] -pyyaml = "*" -requests = "*" - -[package.extras] -gibberish = ["gibberish-detector"] -word-list = ["pyahocorasick"] - [[package]] name = "exceptiongroup" version = "1.2.2" @@ -851,30 +762,6 @@ files = [ attrs = ">=21.3.0" cattrs = "!=23.2.1" -[[package]] -name = "markdown-it-py" -version = "3.0.0" -description = "Python port of markdown-it. Markdown parsing, done right!" -optional = false -python-versions = ">=3.8" -files = [ - {file = "markdown-it-py-3.0.0.tar.gz", hash = "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb"}, - {file = "markdown_it_py-3.0.0-py3-none-any.whl", hash = "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1"}, -] - -[package.dependencies] -mdurl = ">=0.1,<1.0" - -[package.extras] -benchmarking = ["psutil", "pytest", "pytest-benchmark"] -code-style = ["pre-commit (>=3.0,<4.0)"] -compare = ["commonmark (>=0.9,<1.0)", "markdown (>=3.4,<4.0)", "mistletoe (>=1.0,<2.0)", "mistune (>=2.0,<3.0)", "panflute (>=2.3,<3.0)"] -linkify = ["linkify-it-py (>=1,<3)"] -plugins = ["mdit-py-plugins"] -profiling = ["gprof2dot"] -rtd = ["jupyter_sphinx", "mdit-py-plugins", "myst-parser", "pyyaml", "sphinx", "sphinx-copybutton", "sphinx-design", "sphinx_book_theme"] -testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"] - [[package]] name = "markupsafe" version = "2.1.5" @@ -958,17 +845,6 @@ files = [ [package.dependencies] traitlets = "*" -[[package]] -name = "mdurl" -version = "0.1.2" -description = "Markdown URL utilities" -optional = false -python-versions = ">=3.7" -files = [ - {file = "mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8"}, - {file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"}, -] - [[package]] name = "mpire" version = "2.10.2" @@ -992,17 +868,6 @@ dill = ["multiprocess", "multiprocess (>=0.70.15)"] docs = ["docutils (==0.17.1)", "sphinx (==3.2.1)", "sphinx-autodoc-typehints (==1.11.0)", "sphinx-rtd-theme (==0.5.0)", "sphinx-versions (==1.0.1)", "sphinxcontrib-images (==0.9.2)"] testing = ["ipywidgets", "multiprocess", "multiprocess (>=0.70.15)", "numpy", "pywin32 (>=301)", "rich"] -[[package]] -name = "mypy-extensions" -version = "1.0.0" -description = "Type system extensions for programs checked with the mypy type checker." -optional = false -python-versions = ">=3.5" -files = [ - {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, - {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, -] - [[package]] name = "outcome" version = "1.3.0.post0" @@ -1074,28 +939,6 @@ files = [ qa = ["flake8 (==5.0.4)", "mypy (==0.971)", "types-setuptools (==67.2.0.1)"] testing = ["docopt", "pytest"] -[[package]] -name = "pathspec" -version = "0.12.1" -description = "Utility library for gitignore style pattern matching of file paths." -optional = false -python-versions = ">=3.8" -files = [ - {file = "pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08"}, - {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, -] - -[[package]] -name = "pbr" -version = "6.0.0" -description = "Python Build Reasonableness" -optional = false -python-versions = ">=2.6" -files = [ - {file = "pbr-6.0.0-py2.py3-none-any.whl", hash = "sha256:4a7317d5e3b17a3dccb6a8cfe67dab65b20551404c52c8ed41279fa4f0cb4cda"}, - {file = "pbr-6.0.0.tar.gz", hash = "sha256:d1377122a5a00e2f940ee482999518efe16d745d423a670c27773dfbc3c9a7d9"}, -] - [[package]] name = "pexpect" version = "4.9.0" @@ -1121,22 +964,6 @@ files = [ {file = "pickleshare-0.7.5.tar.gz", hash = "sha256:87683d47965c1da65cdacaf31c8441d12b8044cdec9aca500cd78fc2c683afca"}, ] -[[package]] -name = "platformdirs" -version = "4.2.2" -description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." -optional = false -python-versions = ">=3.8" -files = [ - {file = "platformdirs-4.2.2-py3-none-any.whl", hash = "sha256:2d7a1657e36a80ea911db832a8a6ece5ee53d8de21edd5cc5879af6530b1bfee"}, - {file = "platformdirs-4.2.2.tar.gz", hash = "sha256:38b7b51f512eed9e84a22788b4bce1de17c0adb134d6becb09836e37d8654cd3"}, -] - -[package.extras] -docs = ["furo (>=2023.9.10)", "proselint (>=0.13)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1.25.2)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)"] -type = ["mypy (>=1.8)"] - [[package]] name = "pluggy" version = "1.5.0" @@ -1403,25 +1230,6 @@ urllib3 = ">=1.21.1,<3" socks = ["PySocks (>=1.5.6,!=1.5.7)"] use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] -[[package]] -name = "rich" -version = "13.7.1" -description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" -optional = false -python-versions = ">=3.7.0" -files = [ - {file = "rich-13.7.1-py3-none-any.whl", hash = "sha256:4edbae314f59eb482f54e9e30bf00d33350aaa94f4bfcd4e9e3110e64d0d7222"}, - {file = "rich-13.7.1.tar.gz", hash = "sha256:9be308cb1fe2f1f57d67ce99e95af38a1e2bc71ad9813b0e247cf7ffbcc3a432"}, -] - -[package.dependencies] -markdown-it-py = ">=2.2.0" -pygments = ">=2.13.0,<3.0.0" -typing-extensions = {version = ">=4.0.0,<5.0", markers = "python_version < \"3.9\""} - -[package.extras] -jupyter = ["ipywidgets (>=7.5.1,<9)"] - [[package]] name = "ruff" version = "0.5.7" @@ -1531,20 +1339,6 @@ pure-eval = "*" [package.extras] tests = ["cython", "littleutils", "pygments", "pytest", "typeguard"] -[[package]] -name = "stevedore" -version = "5.2.0" -description = "Manage dynamic plugins for Python applications" -optional = false -python-versions = ">=3.8" -files = [ - {file = "stevedore-5.2.0-py3-none-any.whl", hash = "sha256:1c15d95766ca0569cad14cb6272d4d31dae66b011a929d7c18219c176ea1b5c9"}, - {file = "stevedore-5.2.0.tar.gz", hash = "sha256:46b93ca40e1114cea93d738a6c1e365396981bb6bb78c27045b7587c9473544d"}, -] - -[package.dependencies] -pbr = ">=2.0.0,<2.1.0 || >2.1.0" - [[package]] name = "tabulate" version = "0.9.0" @@ -1746,4 +1540,4 @@ test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", [metadata] lock-version = "2.0" python-versions = ">=3.8,<=3.13" -content-hash = "2537817282c3e655b31c3123f4a3900cb73454e71771779b041362fcd474745f" +content-hash = "ddb5c7181ab71d1c540431a28506637fdaec539f308974459f342cf510c0f1ac" diff --git a/pyproject.toml b/pyproject.toml index 01929339..dc32afca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cucu" -version = "0.205.0" +version = "0.206.0" description = "Easy BDD web testing" readme = "README.md" license = "The Clear BSD License" @@ -60,15 +60,9 @@ mpire = "^2.10.2" psutil = "^6.0.0" [tool.poetry.group.dev.dependencies] -bandit = "^1.7.7" -black = "^24.2" -detect-secrets = "^1.4.0" pytest = "^8.0.2" ruff = "^0.5.0" -[tool.black] -line-length = 79 - [tool.ruff] lint.select = ["E", "F", "I", "Q0"] # default options + isort exclude = [".env", ".venv", "venv", "__init__.py"] @@ -78,9 +72,6 @@ line-length = 79 [tool.ruff.lint.flake8-quotes] docstring-quotes = "double" -[tool.bandit] -exclude_dirs = [".env", ".venv", "venv"] - [tool.pytest] junit_family = "xunit2" @@ -95,16 +86,3 @@ source = ["src"] [tool.coverage.report] fail_under = 70 show_missing = true - -[tool.tox] -legacy_tox_ini = """ - [tox] - min_version = 4.5.1 - env_list = - py310 - py39 - py38 - - [testenv] - commands = cucu run features --tags=report --tags=show-skips -""" diff --git a/src/cucu/behave_tweaks.py b/src/cucu/behave_tweaks.py index 9baebdca..75c16cde 100644 --- a/src/cucu/behave_tweaks.py +++ b/src/cucu/behave_tweaks.py @@ -112,7 +112,7 @@ def inner_step(*args, **kwargs): func, *args, variable_passthru=variable_passthru, - **kwargs + **kwargs, ) fix_inner_step(inner_step) diff --git a/src/cucu/formatter/junit.py b/src/cucu/formatter/junit.py index a0f5a403..06f6d8ad 100644 --- a/src/cucu/formatter/junit.py +++ b/src/cucu/formatter/junit.py @@ -126,9 +126,9 @@ def scenario(self, scenario): self.current_scenario_results["tags"] = ", ".join(scenario.tags) scenario_name = escape(scenario.name) - self.feature_results["scenarios"][ - scenario_name - ] = self.current_scenario_results + self.feature_results["scenarios"][scenario_name] = ( + self.current_scenario_results + ) # we write out every new scenario into the JUnit results output # which allows us to have a valid JUnit XML results file per feature diff --git a/src/cucu/lint/linter.py b/src/cucu/lint/linter.py index b5159acd..f8f91dae 100644 --- a/src/cucu/lint/linter.py +++ b/src/cucu/lint/linter.py @@ -107,9 +107,9 @@ def parse_matcher(name, rule_name, rule, line, state): f', "{value}" also used in "{other_filepath}"', ) - state["unique_per_all_features"][rule_name][ - value - ] = feature_filepath + state["unique_per_all_features"][rule_name][value] = ( + feature_filepath + ) return (False, "") # unique across all scenarios across all features