From 8ef4d502a032b89a823283547c33753e95c6328d Mon Sep 17 00:00:00 2001 From: anthony-symphony <46792802+anthony-symphony@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:25:51 -0400 Subject: [PATCH] Element datetime fix (#345) * Modified generate.sh so you can test generation with local files Fixed issue with sed not working * Fix issue where some strings were being automatically converted in Symphony Element Forms * Update to upload-artifact@v4 * Update github actions as v2 is deprecated * Change to upload-artifact v3 * Update dependencies to fix security vulnerabilities * Update testing dependencies * New Lock file * Updated tests due to issue with aiohttp 3.10.x * Exclude Vulnerability 70612 --- .github/workflows/build.yml | 12 +- .github/workflows/cve-scanning-python.yml | 2 +- .github/workflows/license-scanning-python.yml | 2 +- .github/workflows/push.yml | 10 +- .github/workflows/pylint.yaml | 8 +- .github/workflows/release.yml | 4 +- .github/workflows/security.yml | 8 +- .github/workflows/semgrep.yml | 2 +- .safety-policy.yml | 4 +- api_client_generation/generate.sh | 43 +++- poetry.lock | 212 ++++++++++-------- pyproject.toml | 12 +- .../v4_symphony_elements_action.py | 8 +- tests/ext/group_test.py | 10 +- 14 files changed, 201 insertions(+), 136 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 14cc86ed..67c07df1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,11 +22,11 @@ jobs: path: ~\AppData\Local\pypoetry\Cache\virtualenvs steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} id: setup-python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -35,7 +35,7 @@ jobs: run: | echo "::set-output name=dir::$(pip cache dir)" - name: Cache pip dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ steps.pip-cache.outputs.dir }} key: ${{ runner.os }}-pip-${{ steps.setup-python.outputs.python-version }} @@ -44,7 +44,7 @@ jobs: run: pip install poetry - name: Cache poetry - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ matrix.path }} key: ${{ runner.os }}-poetry-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }} @@ -58,14 +58,14 @@ jobs: timeout-minutes: 10 - name: Upload test results - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: pytest-results-${{ matrix.os }} path: test-results/junit.xml if: ${{ always() }} - name: Upload test coverage - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: pytest-coverage-${{ matrix.os }} path: htmlcov diff --git a/.github/workflows/cve-scanning-python.yml b/.github/workflows/cve-scanning-python.yml index 51369ad9..67872384 100644 --- a/.github/workflows/cve-scanning-python.yml +++ b/.github/workflows/cve-scanning-python.yml @@ -17,7 +17,7 @@ jobs: name: Build and test App runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: "3.10" diff --git a/.github/workflows/license-scanning-python.yml b/.github/workflows/license-scanning-python.yml index d6f15e85..3029514f 100644 --- a/.github/workflows/license-scanning-python.yml +++ b/.github/workflows/license-scanning-python.yml @@ -15,7 +15,7 @@ jobs: name: Scan for licenses runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: "3.10" diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 7ecdeb35..39dbfdf4 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -8,7 +8,7 @@ jobs: security: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v4 - name: Run Snyk to check for vulnerabilities uses: snyk/actions/python@b98d498629f1c368650224d6d212bf7dfa89e4bf env: @@ -20,13 +20,13 @@ jobs: documentation: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Python 3.8 id: setup-python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.8 @@ -41,7 +41,7 @@ jobs: echo "::set-output name=dir::$(pip cache dir)" - name: Cache pip dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ steps.pip-cache.outputs.dir }} key: ${{ runner.os }}-pip-${{ steps.setup-python.outputs.python-version }} @@ -50,7 +50,7 @@ jobs: run: pip install poetry - name: Cache poetry - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.cache/pypoetry/virtualenvs key: ${{ runner.os }}-poetry-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }} diff --git a/.github/workflows/pylint.yaml b/.github/workflows/pylint.yaml index 8164f089..a96f578b 100644 --- a/.github/workflows/pylint.yaml +++ b/.github/workflows/pylint.yaml @@ -13,11 +13,11 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python 3.8 id: setup-python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.8 @@ -27,7 +27,7 @@ jobs: echo "::set-output name=dir::$(pip cache dir)" - name: Cache pip dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ steps.pip-cache.outputs.dir }} key: ${{ runner.os }}-pip-${{ steps.setup-python.outputs.python-version }} @@ -50,7 +50,7 @@ jobs: - name: Upload Pylint results if: ${{ always() }} - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: .pylint.d path: ~/.pylint.d diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8656c834..0ff01aeb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,10 +11,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python 3.8 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.8 diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index 6654b97c..49019f67 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -13,11 +13,11 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python 3.8 id: setup-python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.8 @@ -27,7 +27,7 @@ jobs: echo "::set-output name=dir::$(pip cache dir)" - name: Cache pip dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ steps.pip-cache.outputs.dir }} key: ${{ runner.os }}-pip-${{ steps.setup-python.outputs.python-version }} @@ -36,7 +36,7 @@ jobs: run: pip install poetry - name: Cache poetry - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.cache/pypoetry/virtualenvs key: ${{ runner.os }}-poetry-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }} diff --git a/.github/workflows/semgrep.yml b/.github/workflows/semgrep.yml index 5117c4d7..07547f5b 100644 --- a/.github/workflows/semgrep.yml +++ b/.github/workflows/semgrep.yml @@ -9,7 +9,7 @@ jobs: container: image: returntocorp/semgrep steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: semgrep scan --error --config auto env: SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }} \ No newline at end of file diff --git a/.safety-policy.yml b/.safety-policy.yml index fa0a9894..0153bafe 100644 --- a/.safety-policy.yml +++ b/.safety-policy.yml @@ -7,4 +7,6 @@ security: # configuration for the `safety check` command #25853: # Example vulnerability ID # reason: we do not use the vulnerable function # optional, for internal note purposes to communicate with your team. This reason will be reported in the Safety reports # expires: '2022-10-21' # datetime string - date this ignore will expire, best practice to use this variable - continue-on-vulnerability-error: False # Suppress non-zero exit codes when vulnerabilities are found. Enable this in pipelines and CI/CD processes if you want to pass builds that have vulnerabilities \ No newline at end of file + 70612: + reason: The maintainer and multiple third parties believe that this vulnerability isn't valid because users shouldn't use untrusted templates without sandboxing. + continue-on-vulnerability-error: False # Suppress non-zero exit codes when vulnerabilities are found. Enable this in pipelines and CI/CD processes if you want to pass builds that have vulnerabilities diff --git a/api_client_generation/generate.sh b/api_client_generation/generate.sh index d4ed2ace..29d76b2f 100755 --- a/api_client_generation/generate.sh +++ b/api_client_generation/generate.sh @@ -4,44 +4,62 @@ code_gen_dir=`pwd` project_root=$code_gen_dir/.. echo $code_gen_dir -commit_hash=30fcab0fe6eaa26dcc46e7dc5909467332ec8d0d +commit_hash=ab10aa5263cfed89ddae0720cea31eca0c06a003 api_spec_base_url=https://raw.githubusercontent.com/symphonyoss/symphony-api-spec/${commit_hash} echo $api_spec_base_url +#local_api_spec_base_url=./local + # This function accepts the following parameters (in order): # - name of the module we want to generate # - uri of the file to be used for generation # - uri of the support file needed for the generation -generate_files() { +download_and_generate_files() { name=$1 file_url=$2 file_name=${file_url##*/} support_file_url=$3 support_file_name=${support_file_url##*/} + download_files ${file_url} ${file_name} ${support_file_url} ${support_file_name} + generate_files ${name} ${file_name} + cleanup_files ${file_name} ${support_file_name} +} +download_files() { # download files + file_url=$1 + file_name=$2 + support_file_url=$3 + support_file_name=$4 + cd $code_gen_dir curl $file_url -o $file_name if [ ! -z "${support_file_name}" ] then curl $support_file_url -o $support_file_name fi +} + +generate_files() { + + name=$1 + file_name=$2 # generate files java -jar openapi-generator-cli.jar generate -g python -i $file_name --package-name symphony.bdk.gen -o output # update api files cd $code_gen_dir/output/symphony/bdk/gen/api/ - sed -i ".bak" "s/symphony\.bdk\.gen\.model\./symphony\.bdk\.gen\.${name}_model\./g" *.py - sed -i ".bak" "s/ api\./ ${name}_api\./g" *.py + sed -i "s/symphony\.bdk\.gen\.model\./symphony\.bdk\.gen\.${name}_model\./g" *.py + sed -i "s/ api\./ ${name}_api\./g" *.py rm __init__.py # we don't care about __init__.py files cp *.py $project_root/symphony/bdk/gen/${name}_api # update model files cd $code_gen_dir/output/symphony/bdk/gen/model/ - sed -i ".bak" "s/symphony\.bdk\.gen\.model\./symphony\.bdk\.gen\.${name}_model\./g" *.py - sed -i ".bak" "s/model /${name}_model /g" *.py + sed -i "s/symphony\.bdk\.gen\.model\./symphony\.bdk\.gen\.${name}_model\./g" *.py + sed -i "s/model /${name}_model /g" *.py rm __init__.py # we don't care about __init__.py files cp *.py $project_root/symphony/bdk/gen/${name}_model @@ -49,6 +67,14 @@ generate_files() { cd $code_gen_dir/output/symphony/bdk/gen cp rest.py $project_root/symphony/bdk/gen/rest.py + cd $code_gen_dir + rm -r output +} + +cleanup_files() { + file_name=$1 + support_file_name=$2 + # remove downloaded files cd $code_gen_dir rm -r output @@ -57,12 +83,13 @@ generate_files() { then rm $support_file_name fi - } + generate_files agent ${api_spec_base_url}/agent/agent-api-public-deprecated.yaml generate_files auth ${api_spec_base_url}/authenticator/authenticator-api-public-deprecated.yaml generate_files login ${api_spec_base_url}/login/login-api-public.yaml generate_files pod ${api_spec_base_url}/pod/pod-api-public.yaml - generate_files group ${api_spec_base_url}/profile-manager/profile-manager-api.yaml ${api_spec_base_url}/profile-manager/symphony-common-definitions.yaml + +#generate_files agent ${local_api_spec_base_url}/agent-api-public-deprecated-formValues-modified.yaml diff --git a/poetry.lock b/poetry.lock index 2afbe913..61e46751 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,21 +1,30 @@ +[[package]] +name = "aiohappyeyeballs" +version = "2.4.3" +description = "Happy Eyeballs for asyncio" +category = "main" +optional = false +python-versions = ">=3.8" + [[package]] name = "aiohttp" -version = "3.9.3" +version = "3.10.10" description = "Async http client/server framework (asyncio)" category = "main" optional = false python-versions = ">=3.8" [package.dependencies] +aiohappyeyeballs = ">=2.3.0" aiosignal = ">=1.1.2" async-timeout = {version = ">=4.0,<5.0", markers = "python_version < \"3.11\""} attrs = ">=17.3.0" frozenlist = ">=1.1.1" multidict = ">=4.5,<7.0" -yarl = ">=1.0,<2.0" +yarl = ">=1.12.0,<2.0" [package.extras] -speedups = ["brotlicffi", "brotli", "aiodns"] +speedups = ["brotlicffi", "brotli", "aiodns (>=3.2.0)"] [[package]] name = "aiosignal" @@ -62,27 +71,27 @@ python-versions = ">=3.7" [[package]] name = "attrs" -version = "23.2.0" +version = "24.2.0" description = "Classes Without Boilerplate" category = "main" optional = false python-versions = ">=3.7" [package.extras] -cov = ["attrs", "coverage[toml] (>=5.3)"] -dev = ["attrs", "pre-commit"] -docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier", "zope-interface"] -tests = ["attrs", "zope-interface"] -tests-mypy = ["mypy (>=1.6)", "pytest-mypy-plugins"] -tests-no-zope = ["attrs", "cloudpickle", "hypothesis", "pympler", "pytest-xdist", "pytest (>=4.3.0)"] +benchmark = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest-codspeed", "pytest-mypy-plugins", "pytest-xdist", "pytest (>=4.3.0)"] +cov = ["cloudpickle", "coverage[toml] (>=5.3)", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest-mypy-plugins", "pytest-xdist", "pytest (>=4.3.0)"] +dev = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pre-commit", "pympler", "pytest-mypy-plugins", "pytest-xdist", "pytest (>=4.3.0)"] +docs = ["cogapp", "furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier (<24.7)"] +tests = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest-mypy-plugins", "pytest-xdist", "pytest (>=4.3.0)"] +tests-mypy = ["mypy (>=1.11.1)", "pytest-mypy-plugins"] [[package]] name = "babel" -version = "2.14.0" +version = "2.16.0" description = "Internationalization utilities" category = "dev" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" [package.dependencies] pytz = {version = ">=2015.7", markers = "python_version < \"3.9\""} @@ -110,7 +119,7 @@ lxml = ["lxml"] [[package]] name = "certifi" -version = "2024.2.2" +version = "2024.8.30" description = "Python package for providing Mozilla's CA Bundle." category = "dev" optional = false @@ -118,7 +127,7 @@ python-versions = ">=3.6" [[package]] name = "cffi" -version = "1.16.0" +version = "1.17.1" description = "Foreign Function Interface for Python calling C code." category = "main" optional = false @@ -129,7 +138,7 @@ pycparser = "*" [[package]] name = "charset-normalizer" -version = "3.3.2" +version = "3.4.0" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." category = "dev" optional = false @@ -167,15 +176,15 @@ test = ["flake8 (==3.7.8)", "hypothesis (==3.55.3)"] [[package]] name = "configparser" -version = "6.0.1" +version = "7.1.0" description = "Updated configparser from stdlib for earlier Pythons." category = "dev" optional = false python-versions = ">=3.8" [package.extras] -docs = ["sphinx (>=3.5)", "sphinx (<7.2.5)", "jaraco.packaging (>=9.3)", "rst.linker (>=1.9)", "furo", "sphinx-lint", "jaraco.tidelift (>=1.4)"] -testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ruff (>=0.2.1)", "types-backports", "pytest-mypy"] +doc = ["sphinx (>=3.5)", "jaraco.packaging (>=9.3)", "rst.linker (>=1.9)", "furo", "sphinx-lint", "jaraco.tidelift (>=1.4)"] +test = ["pytest (>=6,<8.1.0 || >=8.2.0)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-mypy", "pytest-enabler (>=2.2)", "types-backports", "pytest-ruff (>=0.2.1)"] [[package]] name = "coverage" @@ -193,7 +202,7 @@ toml = ["tomli"] [[package]] name = "cryptography" -version = "42.0.5" +version = "43.0.3" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." category = "main" optional = false @@ -203,14 +212,14 @@ python-versions = ">=3.7" cffi = {version = ">=1.12", markers = "platform_python_implementation != \"PyPy\""} [package.extras] +ssh = ["bcrypt (>=3.1.5)"] +nox = ["nox"] +test = ["cryptography-vectors (==43.0.3)", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist", "pretend", "certifi"] +test-randomorder = ["pytest-randomly"] docs = ["sphinx (>=5.3.0)", "sphinx-rtd-theme (>=1.1.1)"] docstest = ["pyenchant (>=1.6.11)", "readme-renderer", "sphinxcontrib-spelling (>=4.0.1)"] -nox = ["nox"] -pep8test = ["ruff", "mypy", "check-sdist", "click"] sdist = ["build"] -ssh = ["bcrypt (>=3.1.5)"] -test = ["pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist", "pretend", "certifi"] -test-randomorder = ["pytest-randomly"] +pep8test = ["ruff", "mypy", "check-sdist", "click"] [[package]] name = "defusedxml" @@ -222,7 +231,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" [[package]] name = "dill" -version = "0.3.8" +version = "0.3.9" description = "serialize all of Python" category = "dev" optional = false @@ -258,7 +267,7 @@ pipenv = ["pipenv (<=2022.12.19)"] [[package]] name = "exceptiongroup" -version = "1.2.0" +version = "1.2.2" description = "Backport of PEP 654 (exception groups)" category = "dev" optional = false @@ -269,7 +278,7 @@ test = ["pytest (>=6)"] [[package]] name = "frozenlist" -version = "1.4.1" +version = "1.5.0" description = "A list-like structure which implements collections.abc.MutableSequence" category = "main" optional = false @@ -291,7 +300,7 @@ sphinx-basic-ng = "*" [[package]] name = "hazelcast-python-client" -version = "5.3.0" +version = "5.5.0" description = "Hazelcast Python Client" category = "dev" optional = false @@ -302,11 +311,14 @@ stats = ["psutil"] [[package]] name = "idna" -version = "3.6" +version = "3.10" description = "Internationalized Domain Names in Applications (IDNA)" category = "main" optional = false -python-versions = ">=3.5" +python-versions = ">=3.6" + +[package.extras] +all = ["ruff (>=0.6.2)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "flake8 (>=7.1.1)"] [[package]] name = "imagesize" @@ -318,19 +330,23 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" [[package]] name = "importlib-metadata" -version = "7.0.2" +version = "8.5.0" description = "Read metadata from Python packages" category = "dev" optional = false python-versions = ">=3.8" [package.dependencies] -zipp = ">=0.5" +zipp = ">=3.20" [package.extras] -docs = ["sphinx (>=3.5)", "jaraco.packaging (>=9.3)", "rst.linker (>=1.9)", "furo", "sphinx-lint", "jaraco.tidelift (>=1.4)"] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] +cover = ["pytest-cov"] +doc = ["sphinx (>=3.5)", "jaraco.packaging (>=9.3)", "rst.linker (>=1.9)", "furo", "sphinx-lint", "jaraco.tidelift (>=1.4)"] +enabler = ["pytest-enabler (>=2.2)"] perf = ["ipython"] -testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ruff (>=0.2.1)", "packaging", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "pytest-mypy", "importlib-resources (>=1.3)"] +test = ["pytest (>=6,<8.1.0 || >=8.2.0)", "packaging", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "jaraco.test (>=5.4)", "importlib-resources (>=1.3)"] +type = ["pytest-mypy"] [[package]] name = "iniconfig" @@ -353,7 +369,7 @@ colors = ["colorama (>=0.4.6)"] [[package]] name = "jinja2" -version = "3.1.3" +version = "3.1.4" description = "A very fast and expressive template engine." category = "dev" optional = false @@ -404,11 +420,14 @@ python-versions = ">=3.6" [[package]] name = "multidict" -version = "6.0.5" +version = "6.1.0" description = "multidict implementation" category = "main" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" + +[package.dependencies] +typing-extensions = {version = ">=4.1.0", markers = "python_version < \"3.11\""} [[package]] name = "nulltype" @@ -431,19 +450,20 @@ pyparsing = ">=2.0.2,<3.0.5 || >3.0.5" [[package]] name = "platformdirs" -version = "4.2.0" -description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +version = "4.3.6" +description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." category = "dev" optional = false python-versions = ">=3.8" [package.extras] -docs = ["furo (>=2023.9.10)", "proselint (>=0.13)", "sphinx-autodoc-typehints (>=1.25.2)", "sphinx (>=7.2.6)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)", "pytest (>=7.4.3)"] +docs = ["furo (>=2024.8.6)", "proselint (>=0.14)", "sphinx-autodoc-typehints (>=2.4)", "sphinx (>=8.0.2)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest-cov (>=5)", "pytest-mock (>=3.14)", "pytest (>=8.3.2)"] +type = ["mypy (>=1.11.2)"] [[package]] name = "pluggy" -version = "1.4.0" +version = "1.5.0" description = "plugin and hook calling mechanisms for python" category = "dev" optional = false @@ -453,38 +473,45 @@ python-versions = ">=3.8" dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] +[[package]] +name = "propcache" +version = "0.2.0" +description = "Accelerated property cache" +category = "main" +optional = false +python-versions = ">=3.8" + [[package]] name = "pycparser" -version = "2.21" +version = "2.22" description = "C parser in Python" category = "main" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +python-versions = ">=3.8" [[package]] name = "pygments" -version = "2.17.2" +version = "2.18.0" description = "Pygments is a syntax highlighting package written in Python." category = "dev" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" [package.extras] -plugins = ["importlib-metadata"] windows-terminal = ["colorama (>=0.4.6)"] [[package]] name = "pyjwt" -version = "2.8.0" +version = "2.9.0" description = "JSON Web Token implementation in Python" category = "main" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" [package.extras] crypto = ["cryptography (>=3.4.0)"] -dev = ["sphinx (>=4.5.0,<5.0.0)", "sphinx-rtd-theme", "zope.interface", "cryptography (>=3.4.0)", "pytest (>=6.0.0,<7.0.0)", "coverage[toml] (==5.0.4)", "pre-commit"] -docs = ["sphinx (>=4.5.0,<5.0.0)", "sphinx-rtd-theme", "zope.interface"] +dev = ["sphinx", "sphinx-rtd-theme", "zope.interface", "cryptography (>=3.4.0)", "pytest (>=6.0.0,<7.0.0)", "coverage[toml] (==5.0.4)", "pre-commit"] +docs = ["sphinx", "sphinx-rtd-theme", "zope.interface"] tests = ["pytest (>=6.0.0,<7.0.0)", "coverage[toml] (==5.0.4)"] [[package]] @@ -515,7 +542,7 @@ testutils = ["gitpython (>3)"] [[package]] name = "pyparsing" -version = "3.1.2" +version = "3.1.4" description = "pyparsing module - Classes and methods to define and execute parsing grammars" category = "dev" optional = false @@ -526,51 +553,52 @@ diagrams = ["railroad-diagrams", "jinja2"] [[package]] name = "pytest" -version = "7.4.4" +version = "8.3.3" description = "pytest: simple powerful testing with Python" category = "dev" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" [package.dependencies] colorama = {version = "*", markers = "sys_platform == \"win32\""} exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} iniconfig = "*" packaging = "*" -pluggy = ">=0.12,<2.0" -tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} +pluggy = ">=1.5,<2" +tomli = {version = ">=1", markers = "python_version < \"3.11\""} [package.extras] -testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] +dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] [[package]] name = "pytest-asyncio" -version = "0.18.3" +version = "0.24.0" description = "Pytest support for asyncio" category = "dev" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" [package.dependencies] -pytest = ">=6.1.0" +pytest = ">=8.2,<9" [package.extras] -testing = ["coverage (==6.2)", "hypothesis (>=5.7.1)", "flaky (>=3.5.0)", "mypy (==0.931)", "pytest-trio (>=0.7.0)"] +docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] +testing = ["coverage (>=6.2)", "hypothesis (>=5.7.1)"] [[package]] name = "pytest-cov" -version = "3.0.0" +version = "5.0.0" description = "Pytest plugin for measuring coverage." category = "dev" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" [package.dependencies] coverage = {version = ">=5.2.1", extras = ["toml"]} pytest = ">=4.6" [package.extras] -testing = ["fields", "hunter", "process-tests", "six", "pytest-xdist", "virtualenv"] +testing = ["fields", "hunter", "process-tests", "pytest-xdist", "virtualenv"] [[package]] name = "python-dateutil" @@ -585,7 +613,7 @@ six = ">=1.5" [[package]] name = "pytz" -version = "2024.1" +version = "2024.2" description = "World timezone definitions, modern and historical" category = "dev" optional = false @@ -593,11 +621,11 @@ python-versions = "*" [[package]] name = "pyyaml" -version = "6.0.1" +version = "6.0.2" description = "YAML parser and emitter for Python" category = "main" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" [[package]] name = "recommonmark" @@ -614,11 +642,11 @@ sphinx = ">=1.3.1" [[package]] name = "requests" -version = "2.31.0" +version = "2.32.3" description = "Python HTTP for Humans." category = "dev" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" [package.dependencies] certifi = ">=2017.4.17" @@ -628,7 +656,7 @@ urllib3 = ">=1.21.1,<3" [package.extras] socks = ["PySocks (>=1.5.6,!=1.5.7)"] -use_chardet_on_py3 = ["chardet (>=3.0.2,<6)"] +use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] [[package]] name = "ruamel.yaml" @@ -702,7 +730,7 @@ python-versions = "*" [[package]] name = "soupsieve" -version = "2.5" +version = "2.6" description = "A modern CSS selector implementation for Beautiful Soup." category = "dev" optional = false @@ -827,14 +855,15 @@ test = ["pytest"] [[package]] name = "tenacity" -version = "8.2.3" +version = "8.5.0" description = "Retry code until it succeeds" category = "main" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" [package.extras] -doc = ["reno", "sphinx", "tornado (>=4.5)"] +doc = ["reno", "sphinx"] +test = ["pytest", "tornado (>=4.5)", "typeguard"] [[package]] name = "toml" @@ -846,35 +875,35 @@ python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" [[package]] name = "tomli" -version = "2.0.1" +version = "2.0.2" description = "A lil' TOML parser" category = "dev" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" [[package]] name = "tomlkit" -version = "0.12.4" +version = "0.13.2" description = "Style preserving TOML library" category = "dev" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" [[package]] name = "typing-extensions" -version = "4.10.0" +version = "4.12.2" description = "Backported and Experimental Type Hints for Python 3.8+" -category = "dev" +category = "main" optional = false python-versions = ">=3.8" [[package]] name = "urllib3" -version = "1.26.18" +version = "1.26.20" description = "HTTP library with thread-safe connection pooling, file post, and more." category = "main" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" [package.extras] brotli = ["brotlicffi (>=0.8.0)", "brotli (==1.0.9)", "brotlipy (>=0.6.0)", "brotli (>=1.0.9)"] @@ -891,34 +920,40 @@ python-versions = ">=3.6" [[package]] name = "yarl" -version = "1.9.4" +version = "1.15.2" description = "Yet another URL library" category = "main" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" [package.dependencies] idna = ">=2.0" multidict = ">=4.0" +propcache = ">=0.2.0" [[package]] name = "zipp" -version = "3.18.1" +version = "3.20.2" description = "Backport of pathlib-compatible object wrapper for zip files" category = "dev" optional = false python-versions = ">=3.8" [package.extras] -docs = ["sphinx (>=3.5)", "jaraco.packaging (>=9.3)", "rst.linker (>=1.9)", "furo", "sphinx-lint", "jaraco.tidelift (>=1.4)"] -testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ruff (>=0.2.1)", "jaraco.itertools", "jaraco.functools", "more-itertools", "big-o", "pytest-ignore-flaky", "pytest-mypy"] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] +cover = ["pytest-cov"] +doc = ["sphinx (>=3.5)", "jaraco.packaging (>=9.3)", "rst.linker (>=1.9)", "furo", "sphinx-lint", "jaraco.tidelift (>=1.4)"] +enabler = ["pytest-enabler (>=2.2)"] +test = ["pytest (>=6,<8.1.0 || >=8.2.0)", "jaraco.itertools", "jaraco.functools", "more-itertools", "big-o", "pytest-ignore-flaky", "jaraco.test", "importlib-resources"] +type = ["pytest-mypy"] [metadata] lock-version = "1.1" python-versions = "^3.8" -content-hash = "3043b0f9c6366335ec6b8c8302e65121de5c391ef31a31b7327f9640d0ea95ab" +content-hash = "f07416370809e910abaa01759e66dd118d81aa9585d5559f57d22507f8b39bff" [metadata.files] +aiohappyeyeballs = [] aiohttp = [] aiosignal = [] alabaster = [] @@ -959,6 +994,7 @@ nulltype = [] packaging = [] platformdirs = [] pluggy = [] +propcache = [] pycparser = [] pygments = [] pyjwt = [] diff --git a/pyproject.toml b/pyproject.toml index 3e20846c..1c7d482d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,20 +15,20 @@ packages = [ python = "^3.8" nulltype = "^2.3.1" python-dateutil = "^2.8.2" -urllib3 = "^1.26.9" -aiohttp = "^3.9.2" +urllib3 = "^1.26.19" +aiohttp = "^3.10.2" pyyaml = "^6.0" PyJWT = "^2.3.0" -cryptography = "^42.0.4" +cryptography = "^43.0.1" tenacity = "^8.0.1" defusedxml = "^0.7.1" docutils = "0.16" [tool.poetry.dev-dependencies] -pytest = "^7.1.1" +pytest = "^8.3.3" pylint = "^2.6.0" -pytest-cov = "^3.0.0" -pytest-asyncio = "^0.18.2" +pytest-cov = "^5.0.0" +pytest-asyncio = "^0.24.0" Sphinx = "^4.4.0" recommonmark = "^0.7.1" furo = "^2022.3.4" diff --git a/symphony/bdk/gen/agent_model/v4_symphony_elements_action.py b/symphony/bdk/gen/agent_model/v4_symphony_elements_action.py index 9cb5fb9a..7658fb5b 100644 --- a/symphony/bdk/gen/agent_model/v4_symphony_elements_action.py +++ b/symphony/bdk/gen/agent_model/v4_symphony_elements_action.py @@ -87,7 +87,7 @@ def openapi_types(): 'stream': (V4Stream, none_type), # noqa: E501 'form_message_id': (str, none_type), # noqa: E501 'form_id': (str, none_type), # noqa: E501 - 'form_values': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type), # noqa: E501 + 'form_values': ({str: (str,)}, none_type), # noqa: E501 } @cached_property @@ -146,7 +146,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 stream (V4Stream): [optional] # noqa: E501 form_message_id (str): The id of the message that contains the Form. [optional] # noqa: E501 form_id (str): The id of the Form element. [optional] # noqa: E501 - form_values ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The values (in JSON format) answered on the Form. [optional] # noqa: E501 + form_values ({str: (str,)}): The values (in JSON format) answered on the Form. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) @@ -231,7 +231,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 stream (V4Stream): [optional] # noqa: E501 form_message_id (str): The id of the message that contains the Form. [optional] # noqa: E501 form_id (str): The id of the Form element. [optional] # noqa: E501 - form_values ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The values (in JSON format) answered on the Form. [optional] # noqa: E501 + form_values ({str: (str,)}): The values (in JSON format) answered on the Form. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) @@ -260,7 +260,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self.stream: V4Stream = None self.form_message_id: str = None self.form_id: str = None - self.form_values: Union[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}] = None + self.form_values: Union[{str: (str,)}] = None for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ diff --git a/tests/ext/group_test.py b/tests/ext/group_test.py index 84c2c323..4895ed7b 100644 --- a/tests/ext/group_test.py +++ b/tests/ext/group_test.py @@ -44,7 +44,7 @@ def fixture_api_client_factory(api_client, login_client): @pytest.fixture(name="api_client") def fixture_api_client(): - api_client = MagicMock(wraps=ApiClient()) + api_client = MagicMock(ApiClient) api_client.call_api = AsyncMock() api_client.configuration = Configuration() return api_client @@ -52,10 +52,10 @@ def fixture_api_client(): @pytest.fixture(name="login_client") def fixture_login_client(): - api_client = MagicMock(ApiClient) - api_client.call_api = AsyncMock() - api_client.configuration = Configuration() - return api_client + login_client = MagicMock(ApiClient) + login_client.call_api = AsyncMock() + login_client.configuration = Configuration() + return login_client @pytest.fixture(name="retry_config")