diff --git a/.github/workflows/check_pr_plugin_aws.yml b/.github/workflows/check_pr_plugin_aws.yml index 9c402186a..4e1bd8343 100644 --- a/.github/workflows/check_pr_plugin_aws.yml +++ b/.github/workflows/check_pr_plugin_aws.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/aws/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/aws/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_plugin_aws_k8s.yml b/.github/workflows/check_pr_plugin_aws_k8s.yml index 3af50f392..c5b347661 100644 --- a/.github/workflows/check_pr_plugin_aws_k8s.yml +++ b/.github/workflows/check_pr_plugin_aws_k8s.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/aws_k8s/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/aws_k8s/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_plugin_cleanup_aws_alarms.yml b/.github/workflows/check_pr_plugin_cleanup_aws_alarms.yml index 955517237..30fb361f3 100644 --- a/.github/workflows/check_pr_plugin_cleanup_aws_alarms.yml +++ b/.github/workflows/check_pr_plugin_cleanup_aws_alarms.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/cleanup_aws_alarms/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/cleanup_aws_alarms/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_plugin_cleanup_aws_loadbalancers.yml b/.github/workflows/check_pr_plugin_cleanup_aws_loadbalancers.yml index bed9ca263..b2829fb77 100644 --- a/.github/workflows/check_pr_plugin_cleanup_aws_loadbalancers.yml +++ b/.github/workflows/check_pr_plugin_cleanup_aws_loadbalancers.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/cleanup_aws_loadbalancers/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/cleanup_aws_loadbalancers/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_plugin_cleanup_aws_vpcs.yml b/.github/workflows/check_pr_plugin_cleanup_aws_vpcs.yml index fa275616f..3230d6a6e 100644 --- a/.github/workflows/check_pr_plugin_cleanup_aws_vpcs.yml +++ b/.github/workflows/check_pr_plugin_cleanup_aws_vpcs.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/cleanup_aws_vpcs/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/cleanup_aws_vpcs/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_plugin_cleanup_expired.yml b/.github/workflows/check_pr_plugin_cleanup_expired.yml index 332e23c48..4e7c4125a 100644 --- a/.github/workflows/check_pr_plugin_cleanup_expired.yml +++ b/.github/workflows/check_pr_plugin_cleanup_expired.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/cleanup_expired/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/cleanup_expired/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_plugin_cleanup_untagged.yml b/.github/workflows/check_pr_plugin_cleanup_untagged.yml index 01788dcf5..15473d90e 100644 --- a/.github/workflows/check_pr_plugin_cleanup_untagged.yml +++ b/.github/workflows/check_pr_plugin_cleanup_untagged.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/cleanup_untagged/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/cleanup_untagged/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_plugin_cleanup_volumes.yml b/.github/workflows/check_pr_plugin_cleanup_volumes.yml index be1296469..493b8af1f 100644 --- a/.github/workflows/check_pr_plugin_cleanup_volumes.yml +++ b/.github/workflows/check_pr_plugin_cleanup_volumes.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/cleanup_volumes/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/cleanup_volumes/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_plugin_digitalocean.yml b/.github/workflows/check_pr_plugin_digitalocean.yml index e96160983..edc7f6513 100644 --- a/.github/workflows/check_pr_plugin_digitalocean.yml +++ b/.github/workflows/check_pr_plugin_digitalocean.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/digitalocean/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/digitalocean/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_plugin_digitalocean_k8s.yml b/.github/workflows/check_pr_plugin_digitalocean_k8s.yml index 1b174a93c..31d27314e 100644 --- a/.github/workflows/check_pr_plugin_digitalocean_k8s.yml +++ b/.github/workflows/check_pr_plugin_digitalocean_k8s.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/digitalocean_k8s/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/digitalocean_k8s/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_plugin_dockerhub.yml b/.github/workflows/check_pr_plugin_dockerhub.yml index fcc5f0517..81e4ac515 100644 --- a/.github/workflows/check_pr_plugin_dockerhub.yml +++ b/.github/workflows/check_pr_plugin_dockerhub.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/dockerhub/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/dockerhub/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_plugin_example_collector.yml b/.github/workflows/check_pr_plugin_example_collector.yml index 8b325acb2..b5fb56e98 100644 --- a/.github/workflows/check_pr_plugin_example_collector.yml +++ b/.github/workflows/check_pr_plugin_example_collector.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/example_collector/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/example_collector/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_plugin_gcp.yml b/.github/workflows/check_pr_plugin_gcp.yml index 0fe067a29..72e8639a2 100644 --- a/.github/workflows/check_pr_plugin_gcp.yml +++ b/.github/workflows/check_pr_plugin_gcp.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/gcp/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/gcp/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_plugin_github.yml b/.github/workflows/check_pr_plugin_github.yml index c45d2100c..a05f9c93c 100644 --- a/.github/workflows/check_pr_plugin_github.yml +++ b/.github/workflows/check_pr_plugin_github.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/github/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/github/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_plugin_k8s.yml b/.github/workflows/check_pr_plugin_k8s.yml index be21aacab..ac3eac8c8 100644 --- a/.github/workflows/check_pr_plugin_k8s.yml +++ b/.github/workflows/check_pr_plugin_k8s.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/k8s/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/k8s/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_plugin_onelogin.yml b/.github/workflows/check_pr_plugin_onelogin.yml index c2a955ca3..61867a353 100644 --- a/.github/workflows/check_pr_plugin_onelogin.yml +++ b/.github/workflows/check_pr_plugin_onelogin.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/onelogin/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/onelogin/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_plugin_onprem.yml b/.github/workflows/check_pr_plugin_onprem.yml index 74c1f77c4..c23555b11 100644 --- a/.github/workflows/check_pr_plugin_onprem.yml +++ b/.github/workflows/check_pr_plugin_onprem.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/onprem/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/onprem/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_plugin_posthog.yml b/.github/workflows/check_pr_plugin_posthog.yml index 72c8023b0..0269e2a2c 100644 --- a/.github/workflows/check_pr_plugin_posthog.yml +++ b/.github/workflows/check_pr_plugin_posthog.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/posthog/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/posthog/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_plugin_protector.yml b/.github/workflows/check_pr_plugin_protector.yml index 10d268809..ff1f01da9 100644 --- a/.github/workflows/check_pr_plugin_protector.yml +++ b/.github/workflows/check_pr_plugin_protector.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/protector/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/protector/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_plugin_random.yml b/.github/workflows/check_pr_plugin_random.yml index 2abbb5435..546c21e5b 100644 --- a/.github/workflows/check_pr_plugin_random.yml +++ b/.github/workflows/check_pr_plugin_random.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/random/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/random/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_plugin_scarf.yml b/.github/workflows/check_pr_plugin_scarf.yml index c96e724ab..6e849c2db 100644 --- a/.github/workflows/check_pr_plugin_scarf.yml +++ b/.github/workflows/check_pr_plugin_scarf.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/scarf/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/scarf/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_plugin_slack.yml b/.github/workflows/check_pr_plugin_slack.yml index 4a2d34219..1c7fe94df 100644 --- a/.github/workflows/check_pr_plugin_slack.yml +++ b/.github/workflows/check_pr_plugin_slack.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/slack/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/slack/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_plugin_tagvalidator.yml b/.github/workflows/check_pr_plugin_tagvalidator.yml index 4c5b53482..95bc7f46b 100644 --- a/.github/workflows/check_pr_plugin_tagvalidator.yml +++ b/.github/workflows/check_pr_plugin_tagvalidator.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/tagvalidator/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/tagvalidator/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_plugin_vsphere.yml b/.github/workflows/check_pr_plugin_vsphere.yml index acd1aecab..adf0df947 100644 --- a/.github/workflows/check_pr_plugin_vsphere.yml +++ b/.github/workflows/check_pr_plugin_vsphere.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./plugins/vsphere/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./plugins/vsphere/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/check_pr_resotolib.yml b/.github/workflows/check_pr_resotolib.yml index 54bc40bae..90459ac3c 100644 --- a/.github/workflows/check_pr_resotolib.yml +++ b/.github/workflows/check_pr_resotolib.yml @@ -28,7 +28,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{hashFiles('./resotolib/requirements.txt')}}-${{hashFiles('./resotolib/requirements-test.txt')}} + key: ${{ runner.os }}-pip-${{hashFiles('./resotolib/pyproject.toml')}}-${{hashFiles('./resotolib/requirements-test.txt')}} restore-keys: | ${{ runner.os }}-pip- diff --git a/.github/workflows/check_pr_resotometrics.yml b/.github/workflows/check_pr_resotometrics.yml index ad2e97e20..09bdf1e79 100644 --- a/.github/workflows/check_pr_resotometrics.yml +++ b/.github/workflows/check_pr_resotometrics.yml @@ -29,7 +29,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{hashFiles('./resotometrics/requirements.txt')}} + key: ${{ runner.os }}-pip-${{hashFiles('./resotometrics/pyproject.toml')}} restore-keys: | ${{ runner.os }}-pip- diff --git a/.github/workflows/check_pr_resotoshell.yml b/.github/workflows/check_pr_resotoshell.yml index dd22134cf..6d46b71b3 100644 --- a/.github/workflows/check_pr_resotoshell.yml +++ b/.github/workflows/check_pr_resotoshell.yml @@ -29,7 +29,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('./resotoshell/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./resotoshell/pyproject.toml')}} restore-keys: | ${{ runner.os }}-pip- diff --git a/.github/workflows/check_pr_resotoworker.yml b/.github/workflows/check_pr_resotoworker.yml index 7c4987dae..b263e28f7 100644 --- a/.github/workflows/check_pr_resotoworker.yml +++ b/.github/workflows/check_pr_resotoworker.yml @@ -29,7 +29,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{hashFiles('./resotoworker/requirements.txt')}} + key: ${{ runner.os }}-pip-${{hashFiles('./resotoworker/pyproject.toml')}} restore-keys: | ${{ runner.os }}-pip- diff --git a/.github/workflows/create_plugin_workflows.py b/.github/workflows/create_plugin_workflows.py index 2096c5383..7b455e536 100755 --- a/.github/workflows/create_plugin_workflows.py +++ b/.github/workflows/create_plugin_workflows.py @@ -38,7 +38,7 @@ uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('@directory@/requirements.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('@directory@/pyproject.toml')}} restore-keys: | ${{runner.os}}-pip- diff --git a/.github/workflows/model_check.yml b/.github/workflows/model_check.yml index 1288307fa..feb38b117 100644 --- a/.github/workflows/model_check.yml +++ b/.github/workflows/model_check.yml @@ -38,7 +38,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{hashFiles('./resotolib/requirements.txt')}}-${{hashFiles('./resotolib/requirements-test.txt')}}-${{hashFiles('./plugins/**/requirements.txt')}} + key: ${{ runner.os }}-pip-${{hashFiles('./resotolib/pyproject.toml')}}-${{hashFiles('./resotolib/requirements-test.txt')}}-${{hashFiles('./plugins/**/pyproject.toml')}} restore-keys: | ${{ runner.os }}-pip- @@ -46,22 +46,8 @@ jobs: - name: Install Dependencies run: | python -m pip install --upgrade pip - pip install --upgrade --editable resotolib/ - pip install --upgrade --editable plugins/aws/ - pip install --upgrade --editable plugins/digitalocean/ - pip install --upgrade --editable plugins/dockerhub/ - pip install --upgrade --editable plugins/example_collector/ - pip install --upgrade --editable plugins/gcp/ - pip install --upgrade --editable plugins/github/ - pip install --upgrade --editable plugins/k8s/ - pip install --upgrade --editable plugins/onelogin/ - pip install --upgrade --editable plugins/onprem/ - pip install --upgrade --editable plugins/posthog/ - pip install --upgrade --editable plugins/random/ - pip install --upgrade --editable plugins/scarf/ - pip install --upgrade --editable plugins/slack/ - pip install --upgrade --editable plugins/vsphere/ - pip install pytest + python -m pip install -r requirements-test.txt + pip install resotolib/ plugins/aws/ plugins/digitalocean/ plugins/dockerhub/ plugins/example_collector/ plugins/gcp/ plugins/github/ plugins/k8s/ plugins/onelogin/ plugins/onprem/ plugins/posthog/ plugins/random/ plugins/scarf/ plugins/slack/ plugins/vsphere/ - name: Run tests working-directory: ./resotolib diff --git a/.github/workflows/resotocore_coverage.yml b/.github/workflows/resotocore_coverage.yml index f44fdce60..9ebf01162 100644 --- a/.github/workflows/resotocore_coverage.yml +++ b/.github/workflows/resotocore_coverage.yml @@ -41,7 +41,7 @@ jobs: # This path is specific to Ubuntu path: ~/.cache/pip # Look to see if there is a cache hit for the corresponding requirements file - key: ${{runner.os}}-pip-${{hashFiles('./resotocore/requirements.txt')}}-${{hashFiles('./resotocore/requirements-dev.txt')}}-${{hashFiles('./resotocore/requirements-test.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./resotocore/pyproject.toml')}}-${{hashFiles('./resotocore/requirements-dev.txt')}}-${{hashFiles('./resotocore/requirements-test.txt')}} restore-keys: | ${{ runner.os }}-pip- ${{ runner.os }}- @@ -49,8 +49,8 @@ jobs: run: | python -m pip install --upgrade pip pip install --upgrade --editable ../resotolib - pip install -r requirements-test.txt - pip install -r requirements.txt + pip install -r ../requirements-test.txt + pip install -r ../requirements.txt - name: Run Tests env: RESOTOCORE_ANALYTICS_OPT_OUT: true diff --git a/.github/workflows/resotocore_lint.yml b/.github/workflows/resotocore_lint.yml index d461fec5c..caa70fe2f 100644 --- a/.github/workflows/resotocore_lint.yml +++ b/.github/workflows/resotocore_lint.yml @@ -29,7 +29,7 @@ jobs: # This path is specific to Ubuntu path: ~/.cache/pip # Look to see if there is a cache hit for the corresponding requirements file - key: ${{runner.os}}-pip-${{hashFiles('./resotocore/requirements.txt')}}-${{hashFiles('./resotocore/requirements-dev.txt')}}-${{hashFiles('./resotocore/requirements-test.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./resotocore/pyproject.toml')}}-${{hashFiles('./resotocore/requirements-dev.txt')}}-${{hashFiles('./resotocore/requirements-test.txt')}} - name: Install Dependencies run: ./setup_venv.sh --dev --no-venv --no-plugins - name: Check Formatting diff --git a/.github/workflows/resotocore_test_and_build.yml b/.github/workflows/resotocore_test_and_build.yml index 6cfd8fde5..4a9518dfe 100644 --- a/.github/workflows/resotocore_test_and_build.yml +++ b/.github/workflows/resotocore_test_and_build.yml @@ -47,7 +47,7 @@ jobs: # This path is specific to Ubuntu path: ~/.cache/pip # Look to see if there is a cache hit for the corresponding requirements file - key: ${{runner.os}}-pip-${{hashFiles('./resotocore/requirements.txt')}}-${{hashFiles('./resotocore/requirements-dev.txt')}}-${{hashFiles('./resotocore/requirements-test.txt')}} + key: ${{runner.os}}-pip-${{hashFiles('./resotocore/pyproject.toml')}}-${{hashFiles('./resotocore/requirements-dev.txt')}}-${{hashFiles('./resotocore/requirements-test.txt')}} restore-keys: | ${{ runner.os }}-pip- ${{ runner.os }}- @@ -55,9 +55,9 @@ jobs: run: | python -m pip install --upgrade pip pip install --upgrade --editable ../resotolib - pip install -r requirements-test.txt - pip install -r requirements-dev.txt - pip install -r requirements.txt + pip install -r ../requirements-test.txt + pip install -r ../requirements-dev.txt + pip install -r ../requirements.txt - name: Run Tests env: RESOTOCORE_ANALYTICS_OPT_OUT: true diff --git a/Dockerfile.resotobase b/Dockerfile.resotobase index e9850be13..5481e166f 100644 --- a/Dockerfile.resotobase +++ b/Dockerfile.resotobase @@ -21,6 +21,7 @@ RUN echo "I am running on ${BUILDPLATFORM}, building for ${TARGETPLATFORM}" RUN mkdir -p /build /build-python # Build Resoto +COPY requirements.txt /usr/src/requirements.txt COPY resotolib /usr/src/resotolib COPY resotocore /usr/src/resotocore COPY resotoworker /usr/src/resotoworker @@ -35,10 +36,8 @@ RUN . /build/jupyterlite-venv-python3/bin/activate && python -m jupyter lite bui # Build binary wheels WORKDIR /usr/src -RUN . /usr/local/resoto-venv-python3/bin/activate && find plugins/ -maxdepth 1 -mindepth 1 -type d -print0 | xargs -0 python -m pip wheel -w /build-python -f /build-python ./resotolib ./resotocore ./resotoworker ./resotometrics ./resotoshell - -# Install all wheels -RUN . /usr/local/resoto-venv-python3/bin/activate && python -m pip install -f /build-python /build-python/*.whl +RUN . /usr/local/resoto-venv-python3/bin/activate && pip install -r requirements.txt +RUN . /usr/local/resoto-venv-python3/bin/activate && find plugins/ -maxdepth 1 -mindepth 1 -type d -print0 | xargs -0 python -m pip install ./resotolib ./resotocore ./resotoworker ./resotometrics ./resotoshell # Download and install ArangoDB client on x86 builds (there are no official ArangoDB binaries for arm64) WORKDIR /tmp/arangodb diff --git a/bump.sh b/bump.sh index 6b6639df6..9caf097e1 100755 --- a/bump.sh +++ b/bump.sh @@ -12,7 +12,7 @@ bump_to=$2 git ls-files | grep \ -e setup.py \ -e __init__.py \ - -e requirements.txt \ + -e pyproject.toml \ | xargs grep "$bump_from" \ | cut -d : -f 1 \ | xargs sed -i -e "s/$bump_from/$bump_to/g" diff --git a/plugins/aws/MANIFEST.in b/plugins/aws/MANIFEST.in index 8afbefe8d..bb3ec5f0d 100644 --- a/plugins/aws/MANIFEST.in +++ b/plugins/aws/MANIFEST.in @@ -1,2 +1 @@ include README.md -include requirements.txt diff --git a/plugins/aws/pyproject.toml b/plugins/aws/pyproject.toml new file mode 100644 index 000000000..ab1b59d47 --- /dev/null +++ b/plugins/aws/pyproject.toml @@ -0,0 +1,47 @@ +[project] +name = "resoto-plugin-aws" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +description = "Runs collector plugins and sends the result to resotocore." +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0", + "retrying", + "boto3", + "botocore", +] + +[project.entry-points."resoto.plugins"] +aws = "resoto_plugin_aws:AWSCollectorPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/aws" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/aws/requirements.txt b/plugins/aws/requirements.txt deleted file mode 100644 index 3865a5fce..000000000 --- a/plugins/aws/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -resotolib==3.5.0 -retrying==1.3.4 -boto3>=1.26.139 -botocore>=1.29.139 diff --git a/plugins/aws/resoto_plugin_aws/__init__.py b/plugins/aws/resoto_plugin_aws/__init__.py index 1bedd9a83..065c969ac 100644 --- a/plugins/aws/resoto_plugin_aws/__init__.py +++ b/plugins/aws/resoto_plugin_aws/__init__.py @@ -68,7 +68,7 @@ def auto_enableable() -> bool: log.debug(f"plugin: AWS auto discovery failed: {e}") return False - @metrics_collect.time() # type: ignore + @metrics_collect.time() def collect(self) -> None: try: self.collect_aws() diff --git a/plugins/aws/setup.cfg b/plugins/aws/setup.cfg index c6ff8287c..a8ae35ab7 100644 --- a/plugins/aws/setup.cfg +++ b/plugins/aws/setup.cfg @@ -1,3 +1,8 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/aws/setup.py b/plugins/aws/setup.py deleted file mode 100644 index c88aeae4b..000000000 --- a/plugins/aws/setup.py +++ /dev/null @@ -1,49 +0,0 @@ -import os - -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-aws", - version="3.5.0", - description="Resoto AWS Collector Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={ - "resoto.plugins": ["aws = resoto_plugin_aws:AWSCollectorPlugin"], - }, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/aws", -) diff --git a/plugins/aws/tools/awspolicygen/MANIFEST.in b/plugins/aws/tools/awspolicygen/MANIFEST.in index 85e99df3d..a5d35daa3 100644 --- a/plugins/aws/tools/awspolicygen/MANIFEST.in +++ b/plugins/aws/tools/awspolicygen/MANIFEST.in @@ -1,3 +1,2 @@ include README.md -include requirements.txt include awspolicygen/templates/* diff --git a/plugins/aws/tox.ini b/plugins/aws/tox.ini index 0abb1d73e..5dcc108a5 100644 --- a/plugins/aws/tox.ini +++ b/plugins/aws/tox.ini @@ -13,10 +13,12 @@ asyncio_mode=auto [testenv] usedevelop = true deps = + -r../../requirements-all.txt --editable=file:///{toxinidir}/../../resotolib --editable=file:///{toxinidir}/../aws - -rrequirements.txt - -r../../resotolib/requirements-test.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 diff --git a/plugins/aws_k8s/MANIFEST.in b/plugins/aws_k8s/MANIFEST.in index 93c438dd0..bb3ec5f0d 100644 --- a/plugins/aws_k8s/MANIFEST.in +++ b/plugins/aws_k8s/MANIFEST.in @@ -1,3 +1 @@ include README.md -include requirements.txt -include requirements-test.txt diff --git a/plugins/aws_k8s/pyproject.toml b/plugins/aws_k8s/pyproject.toml new file mode 100644 index 000000000..a880c1a38 --- /dev/null +++ b/plugins/aws_k8s/pyproject.toml @@ -0,0 +1,46 @@ +[project] +name = "resoto-plugin-aws-k8s" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +description = "Resoto AWS-K8s Collector Plugin" +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} +keywords = ["aws", "k8s"] + +dependencies = [ "resotolib==3.5.0" ] + +[project.optional-dependencies] +dev = [ "mypy" ] + +[project.entry-points."resoto.plugins"] +aws_k8s_collector = "resoto_plugin_aws_k8s:AWSK8sCollectorPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/aws_k8s" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/aws_k8s/requirements-test.txt b/plugins/aws_k8s/requirements-test.txt deleted file mode 100644 index 239f9b352..000000000 --- a/plugins/aws_k8s/requirements-test.txt +++ /dev/null @@ -1 +0,0 @@ -mypy>=0.961 diff --git a/plugins/aws_k8s/requirements.txt b/plugins/aws_k8s/requirements.txt deleted file mode 100644 index 5cda6053d..000000000 --- a/plugins/aws_k8s/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -resotolib==3.5.0 diff --git a/plugins/aws_k8s/setup.cfg b/plugins/aws_k8s/setup.cfg index b7e478982..7ca653793 100644 --- a/plugins/aws_k8s/setup.cfg +++ b/plugins/aws_k8s/setup.cfg @@ -1,2 +1,7 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/aws_k8s/setup.py b/plugins/aws_k8s/setup.py deleted file mode 100644 index d173c0ce4..000000000 --- a/plugins/aws_k8s/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-aws-k8s", - version="3.5.0", - description="Resoto AWS-K8s Collector Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={"resoto.plugins": ["aws_k8s_collector = resoto_plugin_aws_k8s:AWSK8sCollectorPlugin"]}, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/aws_k8s", -) diff --git a/plugins/aws_k8s/tox.ini b/plugins/aws_k8s/tox.ini index f4de8cd73..c86e0751b 100644 --- a/plugins/aws_k8s/tox.ini +++ b/plugins/aws_k8s/tox.ini @@ -14,9 +14,10 @@ testpaths= test usedevelop = true deps = --editable=file:///{toxinidir}/../../resotolib - -rrequirements.txt - -r../../resotolib/requirements-test.txt - -rrequirements-test.txt + -r../../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/plugins/cleanup_aws_alarms/MANIFEST.in b/plugins/cleanup_aws_alarms/MANIFEST.in index 8afbefe8d..bb3ec5f0d 100644 --- a/plugins/cleanup_aws_alarms/MANIFEST.in +++ b/plugins/cleanup_aws_alarms/MANIFEST.in @@ -1,2 +1 @@ include README.md -include requirements.txt diff --git a/plugins/cleanup_aws_alarms/pyproject.toml b/plugins/cleanup_aws_alarms/pyproject.toml new file mode 100644 index 000000000..e4598b10a --- /dev/null +++ b/plugins/cleanup_aws_alarms/pyproject.toml @@ -0,0 +1,42 @@ +[project] +name = "resoto-plugin-cleanup-aws-alarms" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +description = "AWS Cloudwatch Alarms Cleaner Plugin" +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ "resotolib==3.5.0" ] + +[project.entry-points."resoto.plugins"] +cleanup_aws_alarms = "resoto_plugin_cleanup_aws_alarms:CleanupAWSAlarmsPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/cleanup_aws_alarms" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/cleanup_aws_alarms/setup.cfg b/plugins/cleanup_aws_alarms/setup.cfg index b7e478982..7ca653793 100644 --- a/plugins/cleanup_aws_alarms/setup.cfg +++ b/plugins/cleanup_aws_alarms/setup.cfg @@ -1,2 +1,7 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/cleanup_aws_alarms/setup.py b/plugins/cleanup_aws_alarms/setup.py deleted file mode 100644 index adbc5fa05..000000000 --- a/plugins/cleanup_aws_alarms/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-cleanup-aws-alarms", - version="3.5.0", - description="AWS Cloudwatch Alarms Cleaner Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={"resoto.plugins": ["cleanup_aws_alarms = resoto_plugin_cleanup_aws_alarms:CleanupAWSAlarmsPlugin"]}, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/cleanup_aws_alarms", -) diff --git a/plugins/cleanup_aws_alarms/tox.ini b/plugins/cleanup_aws_alarms/tox.ini index dfa43402c..907b45766 100644 --- a/plugins/cleanup_aws_alarms/tox.ini +++ b/plugins/cleanup_aws_alarms/tox.ini @@ -15,8 +15,10 @@ usedevelop = true deps = --editable=file:///{toxinidir}/../../resotolib --editable=file:///{toxinidir}/../aws - -rrequirements.txt - -r../../resotolib/requirements-test.txt + -r../../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/plugins/cleanup_aws_loadbalancers/MANIFEST.in b/plugins/cleanup_aws_loadbalancers/MANIFEST.in index 8afbefe8d..bb3ec5f0d 100644 --- a/plugins/cleanup_aws_loadbalancers/MANIFEST.in +++ b/plugins/cleanup_aws_loadbalancers/MANIFEST.in @@ -1,2 +1 @@ include README.md -include requirements.txt diff --git a/plugins/cleanup_aws_loadbalancers/pyproject.toml b/plugins/cleanup_aws_loadbalancers/pyproject.toml new file mode 100644 index 000000000..b81b206f9 --- /dev/null +++ b/plugins/cleanup_aws_loadbalancers/pyproject.toml @@ -0,0 +1,45 @@ +[project] +name = "resoto-plugin-cleanup-aws-loadbalancers" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +description = "AWS Loadbalancers Cleaner Plugin" +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0", + "resoto-plugin-aws==3.5.0" +] + +[project.entry-points."resoto.plugins"] +cleanup_aws_loadbalancers = "resoto_plugin_cleanup_aws_loadbalancers:CleanupAWSLoadbalancersPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/cleanup_aws_loadbalancers" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/cleanup_aws_loadbalancers/requirements.txt b/plugins/cleanup_aws_loadbalancers/requirements.txt deleted file mode 100644 index fcc996b9d..000000000 --- a/plugins/cleanup_aws_loadbalancers/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -resotolib==3.5.0 -resoto-plugin-aws==3.5.0 diff --git a/plugins/cleanup_aws_loadbalancers/setup.cfg b/plugins/cleanup_aws_loadbalancers/setup.cfg index b7e478982..7ca653793 100644 --- a/plugins/cleanup_aws_loadbalancers/setup.cfg +++ b/plugins/cleanup_aws_loadbalancers/setup.cfg @@ -1,2 +1,7 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/cleanup_aws_loadbalancers/setup.py b/plugins/cleanup_aws_loadbalancers/setup.py deleted file mode 100644 index 62cf14a11..000000000 --- a/plugins/cleanup_aws_loadbalancers/setup.py +++ /dev/null @@ -1,50 +0,0 @@ -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-cleanup-aws-loadbalancers", - version="3.5.0", - description="AWS Loadbalancers Cleaner Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={ - "resoto.plugins": [ - "cleanup_aws_loadbalancers = resoto_plugin_cleanup_aws_loadbalancers:CleanupAWSLoadbalancersPlugin" - ] - }, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/cleanup_aws_loadbalancers", -) diff --git a/plugins/cleanup_aws_loadbalancers/tox.ini b/plugins/cleanup_aws_loadbalancers/tox.ini index 618b00f14..eff930530 100644 --- a/plugins/cleanup_aws_loadbalancers/tox.ini +++ b/plugins/cleanup_aws_loadbalancers/tox.ini @@ -15,8 +15,10 @@ usedevelop = true deps = --editable=file:///{toxinidir}/../../resotolib --editable=file:///{toxinidir}/../aws - -rrequirements.txt - -r../../resotolib/requirements-test.txt + -r../../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/plugins/cleanup_aws_vpcs/MANIFEST.in b/plugins/cleanup_aws_vpcs/MANIFEST.in index 8afbefe8d..bb3ec5f0d 100644 --- a/plugins/cleanup_aws_vpcs/MANIFEST.in +++ b/plugins/cleanup_aws_vpcs/MANIFEST.in @@ -1,2 +1 @@ include README.md -include requirements.txt diff --git a/plugins/cleanup_aws_vpcs/pyproject.toml b/plugins/cleanup_aws_vpcs/pyproject.toml new file mode 100644 index 000000000..00c8e7810 --- /dev/null +++ b/plugins/cleanup_aws_vpcs/pyproject.toml @@ -0,0 +1,45 @@ +[project] +name = "resoto-plugin-cleanup-aws-vpcs" +description = "AWS VPC Cleaner Plugin" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0", + "resoto-plugin-aws==3.5.0" +] + +[project.entry-points."resoto.plugins"] +cleanup_aws_vpcs = "resoto_plugin_cleanup_aws_vpcs:CleanupAWSVPCsPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/cleanup_aws_vpcs" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/cleanup_aws_vpcs/requirements.txt b/plugins/cleanup_aws_vpcs/requirements.txt deleted file mode 100644 index fcc996b9d..000000000 --- a/plugins/cleanup_aws_vpcs/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -resotolib==3.5.0 -resoto-plugin-aws==3.5.0 diff --git a/plugins/cleanup_aws_vpcs/setup.cfg b/plugins/cleanup_aws_vpcs/setup.cfg index b7e478982..7ca653793 100644 --- a/plugins/cleanup_aws_vpcs/setup.cfg +++ b/plugins/cleanup_aws_vpcs/setup.cfg @@ -1,2 +1,7 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/cleanup_aws_vpcs/setup.py b/plugins/cleanup_aws_vpcs/setup.py deleted file mode 100644 index 03523604e..000000000 --- a/plugins/cleanup_aws_vpcs/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-cleanup-aws-vpcs", - version="3.5.0", - description="AWS VPC Cleaner Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={"resoto.plugins": ["cleanup_aws_vpcs = resoto_plugin_cleanup_aws_vpcs:CleanupAWSVPCsPlugin"]}, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/cleanup_aws_vpcs", -) diff --git a/plugins/cleanup_aws_vpcs/tox.ini b/plugins/cleanup_aws_vpcs/tox.ini index 6eb0daf3f..b698ad543 100644 --- a/plugins/cleanup_aws_vpcs/tox.ini +++ b/plugins/cleanup_aws_vpcs/tox.ini @@ -15,8 +15,10 @@ usedevelop = true deps = --editable=file:///{toxinidir}/../../resotolib --editable=file:///{toxinidir}/../aws - -rrequirements.txt - -r../../resotolib/requirements-test.txt + -r../../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/plugins/cleanup_expired/MANIFEST.in b/plugins/cleanup_expired/MANIFEST.in index 8afbefe8d..bb3ec5f0d 100644 --- a/plugins/cleanup_expired/MANIFEST.in +++ b/plugins/cleanup_expired/MANIFEST.in @@ -1,2 +1 @@ include README.md -include requirements.txt diff --git a/plugins/cleanup_expired/pyproject.toml b/plugins/cleanup_expired/pyproject.toml new file mode 100644 index 000000000..09d4691dd --- /dev/null +++ b/plugins/cleanup_expired/pyproject.toml @@ -0,0 +1,44 @@ +[project] +name = "resoto-plugin-cleanup-expired" +description = "Resoto Expired Resource Cleanup Plugin" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0", +] + +[project.entry-points."resoto.plugins"] +cleanup_expired = "resoto_plugin_cleanup_expired:CleanupExpiredPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/cleanup_expired" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/cleanup_expired/requirements.txt b/plugins/cleanup_expired/requirements.txt deleted file mode 100644 index 5cda6053d..000000000 --- a/plugins/cleanup_expired/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -resotolib==3.5.0 diff --git a/plugins/cleanup_expired/setup.cfg b/plugins/cleanup_expired/setup.cfg index b7e478982..7ca653793 100644 --- a/plugins/cleanup_expired/setup.cfg +++ b/plugins/cleanup_expired/setup.cfg @@ -1,2 +1,7 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/cleanup_expired/setup.py b/plugins/cleanup_expired/setup.py deleted file mode 100644 index c53385721..000000000 --- a/plugins/cleanup_expired/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-cleanup-expired", - version="3.5.0", - description="Resoto Expired Resource Cleanup Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={"resoto.plugins": ["cleanup_expired = resoto_plugin_cleanup_expired:CleanupExpiredPlugin"]}, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/cleanup_expired", -) diff --git a/plugins/cleanup_expired/tox.ini b/plugins/cleanup_expired/tox.ini index e7e660bbc..902f2964c 100644 --- a/plugins/cleanup_expired/tox.ini +++ b/plugins/cleanup_expired/tox.ini @@ -14,8 +14,10 @@ testpaths= test usedevelop = true deps = --editable=file:///{toxinidir}/../../resotolib - -rrequirements.txt - -r../../resotolib/requirements-test.txt + -r../../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/plugins/cleanup_untagged/MANIFEST.in b/plugins/cleanup_untagged/MANIFEST.in index 8afbefe8d..bb3ec5f0d 100644 --- a/plugins/cleanup_untagged/MANIFEST.in +++ b/plugins/cleanup_untagged/MANIFEST.in @@ -1,2 +1 @@ include README.md -include requirements.txt diff --git a/plugins/cleanup_untagged/pyproject.toml b/plugins/cleanup_untagged/pyproject.toml new file mode 100644 index 000000000..655209f70 --- /dev/null +++ b/plugins/cleanup_untagged/pyproject.toml @@ -0,0 +1,44 @@ +[project] +name = "resoto-plugin-cleanup-untagged" +description = "Resoto Cleanup Untagged Plugin" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0", +] + +[project.entry-points."resoto.plugins"] +cleanup_untagged = "resoto_plugin_cleanup_untagged:CleanupUntaggedPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/cleanup_untagged" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/cleanup_untagged/requirements.txt b/plugins/cleanup_untagged/requirements.txt deleted file mode 100644 index 5cda6053d..000000000 --- a/plugins/cleanup_untagged/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -resotolib==3.5.0 diff --git a/plugins/cleanup_untagged/setup.cfg b/plugins/cleanup_untagged/setup.cfg index b7e478982..7ca653793 100644 --- a/plugins/cleanup_untagged/setup.cfg +++ b/plugins/cleanup_untagged/setup.cfg @@ -1,2 +1,7 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/cleanup_untagged/setup.py b/plugins/cleanup_untagged/setup.py deleted file mode 100644 index 7be8f85c0..000000000 --- a/plugins/cleanup_untagged/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-cleanup-untagged", - version="3.5.0", - description="Resoto Cleanup Untagged Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={"resoto.plugins": ["cleanup_untagged = resoto_plugin_cleanup_untagged:CleanupUntaggedPlugin"]}, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/cleanup_untagged", -) diff --git a/plugins/cleanup_untagged/tox.ini b/plugins/cleanup_untagged/tox.ini index b84f4fa8e..db4eeac4e 100644 --- a/plugins/cleanup_untagged/tox.ini +++ b/plugins/cleanup_untagged/tox.ini @@ -13,8 +13,10 @@ testpaths= test usedevelop = true deps = --editable=file:///{toxinidir}/../../resotolib - -rrequirements.txt - -r../../resotolib/requirements-test.txt + -r../../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/plugins/cleanup_volumes/MANIFEST.in b/plugins/cleanup_volumes/MANIFEST.in index 8afbefe8d..bb3ec5f0d 100644 --- a/plugins/cleanup_volumes/MANIFEST.in +++ b/plugins/cleanup_volumes/MANIFEST.in @@ -1,2 +1 @@ include README.md -include requirements.txt diff --git a/plugins/cleanup_volumes/pyproject.toml b/plugins/cleanup_volumes/pyproject.toml new file mode 100644 index 000000000..eeaa299dc --- /dev/null +++ b/plugins/cleanup_volumes/pyproject.toml @@ -0,0 +1,44 @@ +[project] +name = "resoto-plugin-cleanup-volumes" +description = "Volume Cleaner Plugin" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0", +] + +[project.entry-points."resoto.plugins"] +cleanup_volumes = "resoto_plugin_cleanup_volumes:CleanupVolumesPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/cleanup_volumes" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/cleanup_volumes/requirements.txt b/plugins/cleanup_volumes/requirements.txt deleted file mode 100644 index 5cda6053d..000000000 --- a/plugins/cleanup_volumes/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -resotolib==3.5.0 diff --git a/plugins/cleanup_volumes/setup.cfg b/plugins/cleanup_volumes/setup.cfg index b7e478982..7ca653793 100644 --- a/plugins/cleanup_volumes/setup.cfg +++ b/plugins/cleanup_volumes/setup.cfg @@ -1,2 +1,7 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/cleanup_volumes/setup.py b/plugins/cleanup_volumes/setup.py deleted file mode 100644 index f08385b46..000000000 --- a/plugins/cleanup_volumes/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-cleanup-volumes", - version="3.5.0", - description="Volume Cleaner Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={"resoto.plugins": ["cleanup_volumes = resoto_plugin_cleanup_volumes:CleanupVolumesPlugin"]}, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/cleanup_volumes", -) diff --git a/plugins/cleanup_volumes/tox.ini b/plugins/cleanup_volumes/tox.ini index 8eb0434b9..6fafa4b6e 100644 --- a/plugins/cleanup_volumes/tox.ini +++ b/plugins/cleanup_volumes/tox.ini @@ -14,8 +14,10 @@ testpaths= test usedevelop = true deps = --editable=file:///{toxinidir}/../../resotolib - -rrequirements.txt - -r../../resotolib/requirements-test.txt + -r../../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/plugins/digitalocean/MANIFEST.in b/plugins/digitalocean/MANIFEST.in index 93c438dd0..bb3ec5f0d 100644 --- a/plugins/digitalocean/MANIFEST.in +++ b/plugins/digitalocean/MANIFEST.in @@ -1,3 +1 @@ include README.md -include requirements.txt -include requirements-test.txt diff --git a/plugins/digitalocean/pyproject.toml b/plugins/digitalocean/pyproject.toml new file mode 100644 index 000000000..433148328 --- /dev/null +++ b/plugins/digitalocean/pyproject.toml @@ -0,0 +1,54 @@ +[project] +name = "resoto-plugin-digitalocean" +description = "Resoto DigitalOcean Collector Plugin" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0", + "boto3", + "requests", + "botocore", + "retrying" +] + +[project.optional-dependencies] +dev = [ + "mypy", + "tzlocal", +] + +[project.entry-points."resoto.plugins"] +digitalocean_collector = "resoto_plugin_digitalocean:DigitalOceanCollectorPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/digitalocean" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/digitalocean/requirements-test.txt b/plugins/digitalocean/requirements-test.txt deleted file mode 100644 index c375a6e74..000000000 --- a/plugins/digitalocean/requirements-test.txt +++ /dev/null @@ -1,2 +0,0 @@ -mypy>=0.961 -tzlocal>=4.3 diff --git a/plugins/digitalocean/requirements.txt b/plugins/digitalocean/requirements.txt deleted file mode 100644 index cab0f6c99..000000000 --- a/plugins/digitalocean/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -resotolib==3.5.0 -boto3>=1 -requests>=2.31.0 -botocore>=1 -retrying>=1.3 diff --git a/plugins/digitalocean/resoto_plugin_digitalocean/collector.py b/plugins/digitalocean/resoto_plugin_digitalocean/collector.py index f3ecd965f..dbfd0ee81 100644 --- a/plugins/digitalocean/resoto_plugin_digitalocean/collector.py +++ b/plugins/digitalocean/resoto_plugin_digitalocean/collector.py @@ -320,10 +320,10 @@ def extract_tags(result: Dict[str, Any]) -> Dict[str, Optional[str]]: search_results[map_to].append(search_result) if map_to not in kwargs and map_to in search_results and not str(map_to).startswith("__"): search_result = search_results[map_to] - if len(search_result) == 1: - kwargs[map_to] = search_result[0] + if len(search_result) == 1: # type: ignore + kwargs[map_to] = search_result[0] # type: ignore else: - kwargs[map_to] = list(search_result) + kwargs[map_to] = list(search_result) # type: ignore # If the resource was referencing a zone but not a region we look up its # region based on the zone information we found. @@ -423,7 +423,7 @@ def add_edge(search_map_key: str, is_parent: bool) -> None: else: log.error(f"Key {search_result_name} is missing in search_map") - @metrics_collect_droplets.time() # type: ignore + @metrics_collect_droplets.time() def collect_droplets(self) -> None: instances = self.client.list_droplets() @@ -534,7 +534,7 @@ def get_size(droplet: Json) -> Json: }, ) - @metrics_collect_regions.time() # type: ignore + @metrics_collect_regions.time() def collect_regions(self) -> None: regions = self.client.list_regions() self.collect_resource( @@ -551,7 +551,7 @@ def collect_regions(self) -> None: }, ) - @metrics_collect_volumes.time() # type: ignore + @metrics_collect_volumes.time() def collect_volumes(self) -> None: # taken from https://www.digitalocean.com/pricing/volumes DO_VOLUME_COST_GB_PER_HOUR = 0.000149 @@ -588,7 +588,7 @@ def extract_volume_status(volume: Json) -> VolumeStatus: successors={EdgeType.delete: ["__users"]}, ) - @metrics_collect_databases.time() # type: ignore + @metrics_collect_databases.time() def collect_databases(self) -> None: # this mapping was taken from the digitalocean web console. dbtype_to_size = { @@ -642,7 +642,7 @@ def collect_databases(self) -> None: }, ) - @metrics_collect_vpcs.time() # type: ignore + @metrics_collect_vpcs.time() def collect_vpcs(self) -> None: vpcs = self.client.list_vpcs() self.collect_resource( @@ -660,7 +660,7 @@ def collect_vpcs(self) -> None: }, ) - @metrics_collect_projects.time() # type: ignore + @metrics_collect_projects.time() def collect_projects(self) -> None: def get_resource_id(resource: Json) -> str: return cast(str, resource["urn"]) @@ -693,7 +693,7 @@ def get_resource_id(resource: Json) -> str: }, ) - @metrics_collect_k8s_clusters.time() # type: ignore + @metrics_collect_k8s_clusters.time() def collect_k8s_clusters(self) -> None: clusters = self.client.list_kubernetes_clusters() self.collect_resource( @@ -729,7 +729,7 @@ def collect_k8s_clusters(self) -> None: predecessors={EdgeType.default: ["__vpcs"], EdgeType.delete: ["__vpcs"]}, ) - @metrics_collect_snapshots.time() # type: ignore + @metrics_collect_snapshots.time() def collect_snapshots(self) -> None: def get_resource_id(snapshot: Json) -> str: if snapshot["resource_type"] == "droplet": @@ -774,7 +774,7 @@ def get_region(snapshot: Json) -> str: predecessors={EdgeType.default: ["__resource", "__tags", "__available_regions"]}, ) - @metrics_collect_load_balancers.time() # type: ignore + @metrics_collect_load_balancers.time() def collect_load_balancers(self) -> None: loadbalancers = self.client.list_load_balancers() @@ -816,7 +816,7 @@ def get_nr_nodes(lb: Json) -> int: successors={EdgeType.default: ["__droplets"]}, ) - @metrics_collect_floating_ips.time() # type: ignore + @metrics_collect_floating_ips.time() def collect_floating_ips(self) -> None: floating_ips = self.client.list_floating_ips() self.collect_resource( @@ -839,7 +839,7 @@ def collect_floating_ips(self) -> None: predecessors={EdgeType.default: ["__droplet"]}, ) - @metrics_collect_spaces.time() # type: ignore + @metrics_collect_spaces.time() def collect_spaces(self, region: DigitalOceanRegion) -> None: spaces = self.client.list_spaces(region.do_region_slug or "") self.collect_resource( @@ -859,7 +859,7 @@ def collect_spaces(self, region: DigitalOceanRegion) -> None: }, ) - @metrics_collect_apps.time() # type: ignore + @metrics_collect_apps.time() def collect_apps(self) -> None: apps = self.client.list_apps() @@ -893,7 +893,7 @@ def extract_databases(app: Json) -> List[str]: predecessors={EdgeType.default: ["__databases"]}, ) - @metrics_collect_cdn_endpoints.time() # type: ignore + @metrics_collect_cdn_endpoints.time() def collect_cdn_endpoints(self) -> None: endpoints = self.client.list_cdn_endpoints() self.collect_resource( @@ -910,7 +910,7 @@ def collect_cdn_endpoints(self) -> None: }, ) - @metrics_collect_certificates.time() # type: ignore + @metrics_collect_certificates.time() def collect_certificates(self) -> None: certificates = self.client.list_certificates() self.collect_resource( @@ -927,7 +927,7 @@ def collect_certificates(self) -> None: }, ) - @metrics_collect_container_registry.time() # type: ignore + @metrics_collect_container_registry.time() def collect_container_registry(self) -> None: registries = self.client.get_registry_info() for registry in registries: @@ -999,7 +999,7 @@ def collect_container_registry(self) -> None: predecessors={EdgeType.default: ["__repository", "__registry"]}, ) - @metrics_collect_ssh_keys.time() # type: ignore + @metrics_collect_ssh_keys.time() def collect_ssh_keys(self) -> None: ssh_keys = self.client.list_ssh_keys() self.collect_resource( @@ -1013,7 +1013,7 @@ def collect_ssh_keys(self) -> None: }, ) - @metrics_collect_tags.time() # type: ignore + @metrics_collect_tags.time() def collect_tags(self) -> None: tags = self.client.list_tags() self.collect_resource( @@ -1025,7 +1025,7 @@ def collect_tags(self) -> None: }, ) - @metrics_collect_domains.time() # type: ignore + @metrics_collect_domains.time() def collect_domains(self) -> None: domains = self.client.list_domains() self.collect_resource( @@ -1071,7 +1071,7 @@ def update_record(record: Json, domain: Json) -> Json: predecessors={EdgeType.default: ["__domain"]}, ) - @metrics_collect_firewalls.time() # type: ignore + @metrics_collect_firewalls.time() def collect_firewalls(self) -> None: firewalls = self.client.list_firewalls() self.collect_resource( @@ -1100,7 +1100,7 @@ def collect_firewalls(self) -> None: }, ) - @metrics_collect_alert_policies.time() # type: ignore + @metrics_collect_alert_policies.time() def collect_alert_policies(self) -> None: alert_policies = self.client.list_alert_policies() self.collect_resource( diff --git a/plugins/digitalocean/setup.cfg b/plugins/digitalocean/setup.cfg index b7e478982..7ca653793 100644 --- a/plugins/digitalocean/setup.cfg +++ b/plugins/digitalocean/setup.cfg @@ -1,2 +1,7 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/digitalocean/setup.py b/plugins/digitalocean/setup.py deleted file mode 100644 index 6e646f2c9..000000000 --- a/plugins/digitalocean/setup.py +++ /dev/null @@ -1,48 +0,0 @@ -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-digitalocean", - version="3.5.0", - description="Resoto DigitalOcean Collector Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={ - "resoto.plugins": ["digitalocean_collector = resoto_plugin_digitalocean:DigitalOceanCollectorPlugin"] - }, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/digitalocean", -) diff --git a/plugins/digitalocean/test/test_collector.py b/plugins/digitalocean/test/test_collector.py index 240aaf53c..a8740bf64 100644 --- a/plugins/digitalocean/test/test_collector.py +++ b/plugins/digitalocean/test/test_collector.py @@ -1,7 +1,40 @@ -from resoto_plugin_digitalocean.collector import DigitalOceanTeamCollector -from resoto_plugin_digitalocean.resources import DigitalOceanTeam, DigitalOceanVolume, DigitalOceanDropletSize +import datetime +from typing import Dict, Any, List, cast + from resoto_plugin_digitalocean.client import StreamingWrapper +from resoto_plugin_digitalocean.collector import DigitalOceanTeamCollector +from resoto_plugin_digitalocean.resources import ( + DigitalOceanTeam, + DigitalOceanVolume, + DigitalOceanDropletSize, + DigitalOceanRegion, + DigitalOceanVPC, + DigitalOceanImage, + DigitalOceanDroplet, + DigitalOceanDatabase, + DigitalOceanKubernetesCluster, + DigitalOceanSnapshot, + DigitalOceanLoadBalancer, + DigitalOceanFloatingIP, + DigitalOceanProject, + DigitalOceanSpace, + DigitalOceanApp, + DigitalOceanCdnEndpoint, + DigitalOceanCertificate, + DigitalOceanContainerRegistry, + DigitalOceanContainerRegistryRepositoryTag, + DigitalOceanContainerRegistryRepository, + DigitalOceanSSHKey, + DigitalOceanTag, + DigitalOceanDomain, + DigitalOceanDomainRecord, + DigitalOceanFirewall, + DigitalOceanAlertPolicy, +) +from resotolib.baseresources import Cloud, EdgeType, GraphRoot, InstanceStatus, VolumeStatus from resotolib.core.actions import CoreFeedback +from resotolib.graph import Graph +from resotolib.graph import sanitize from .fixtures import ( droplets, regions, @@ -28,15 +61,11 @@ firewalls, alerts, ) -from resotolib.graph import sanitize -from resotolib.baseresources import Cloud, EdgeType, GraphRoot, InstanceStatus, VolumeStatus -from resotolib.graph import Graph -import datetime -from typing import Dict, Any, List, cast class ClientMock(StreamingWrapper, object): def __init__(self, responses: Dict[str, Any]) -> None: + super().__init__("none", None, None, None) self.responses = responses def with_feedback(self, core_feedback: CoreFeedback) -> StreamingWrapper: @@ -81,7 +110,7 @@ def test_collect_teams() -> None: do_client = ClientMock({}) graph = prepare_graph(do_client) - team_node = graph.search_first("urn", "do:team:test_team") + team_node: DigitalOceanTeam = graph.search_first("urn", "do:team:test_team") # type: ignore assert team_node.name == "test_team" assert team_node.urn == "do:team:test_team" assert team_node.id == "test_team" @@ -98,7 +127,7 @@ def test_collect_regions() -> None: # region nyc1 should not be in the graph since it has no resources in it assert graph.search_first("urn", "do:region:nyc1") is None - region = graph.search_first("urn", "do:region:fra1") + region: DigitalOceanRegion = graph.search_first("urn", "do:region:fra1") # type: ignore assert region.name == "Frankfurt 1" assert region.id == "fra1" assert region.kind == "digitalocean_region" @@ -112,7 +141,7 @@ def test_collect_regions() -> None: "image_transfer", ] droplet_sizes: List[str] = regions[1]["sizes"] - assert set(region.do_region_droplet_sizes) == set(droplet_sizes) + assert set(region.do_region_droplet_sizes) == set(droplet_sizes) # type: ignore assert region.is_available is True @@ -126,7 +155,7 @@ def test_collect_vpcs() -> None: graph = prepare_graph(do_client) check_edges(graph, "do:region:fra1", "do:vpc:0d3176ad-41e0-4021-b831-0c5c45c60959") - vpc = graph.search_first("urn", "do:vpc:0d3176ad-41e0-4021-b831-0c5c45c60959") + vpc: DigitalOceanVPC = graph.search_first("urn", "do:vpc:0d3176ad-41e0-4021-b831-0c5c45c60959") # type: ignore assert vpc.urn == "do:vpc:0d3176ad-41e0-4021-b831-0c5c45c60959" assert vpc.name == "default-fra1" assert vpc.description == "" @@ -157,7 +186,7 @@ def test_collect_droplets() -> None: check_edges(graph, "do:size:s-1vcpu-1gb", "do:droplet:289110074") check_edges(graph, "do:tag:image_tag", "do:image:101111514") check_edges(graph, "do:tag:droplet_tag", "do:droplet:289110074") - image = graph.search_first("urn", "do:image:101111514") + image: DigitalOceanImage = graph.search_first("urn", "do:image:101111514") # type: ignore assert image.urn == "do:image:101111514" assert image.name == "20.04 (LTS) x64" assert image.distribution == "Ubuntu" @@ -176,13 +205,13 @@ def test_collect_droplets() -> None: assert size.instance_memory == 1 assert size.ondemand_cost == 0.00744 - droplet = graph.search_first("urn", "do:droplet:289110074") + droplet: DigitalOceanDroplet = graph.search_first("urn", "do:droplet:289110074") # type: ignore assert droplet.urn == "do:droplet:289110074" assert droplet.name == "ubuntu-s-1vcpu-1gb-fra1-01" assert droplet.instance_memory == 1 assert droplet.instance_cores == 1 assert droplet.instance_status == InstanceStatus.RUNNING - assert droplet.region().urn == "do:region:fra1" + assert droplet.region().urn == "do:region:fra1" # type: ignore assert droplet.droplet_image == "ubuntu-20-04-x64" assert droplet.droplet_backup_ids == ["42"] assert droplet.is_locked is False @@ -237,14 +266,14 @@ def test_collect_database() -> None: delete=True, ) check_edges(graph, "do:tag:database_tag", "do:dbaas:2848a998-e151-4d5a-9813-0904a44c2397") - database = graph.search_first("urn", "do:dbaas:2848a998-e151-4d5a-9813-0904a44c2397") + database: DigitalOceanDatabase = graph.search_first("urn", "do:dbaas:2848a998-e151-4d5a-9813-0904a44c2397") # type: ignore # noqa: E501 assert database.urn == "do:dbaas:2848a998-e151-4d5a-9813-0904a44c2397" assert database.name == "do:dbaas:db-postgresql-fra1-82725" assert database.db_type == "pg" assert database.db_status == "online" assert database.db_version == "14" assert database.db_endpoint == "host.b.db.ondigitalocean.com" - assert database.region().urn == "do:region:fra1" + assert database.region().urn == "do:region:fra1" # type: ignore assert database.instance_type == "db-s-1vcpu-1gb" @@ -276,11 +305,11 @@ def test_collect_k8s_clusters() -> None: "do:droplet:290075243", ) - cluster = graph.search_first("urn", "do:kubernetes:e1c48631-b382-4001-2168-c47c54795a26") + cluster: DigitalOceanKubernetesCluster = graph.search_first("urn", "do:kubernetes:e1c48631-b382-4001-2168-c47c54795a26") # type: ignore # noqa: E501 assert cluster.urn == "do:kubernetes:e1c48631-b382-4001-2168-c47c54795a26" assert cluster.name == "k8s-1-22-7-do-0-fra1-test" assert cluster.k8s_version == "1.22.7-do.0" - assert cluster.region().urn == "do:region:fra1" + assert cluster.region().urn == "do:region:fra1" # type: ignore assert cluster.k8s_cluster_subnet == "10.244.0.0/16" assert cluster.k8s_service_subnet == "10.245.0.0/16" assert cluster.ipv4_address == "127.0.0.1" @@ -305,7 +334,7 @@ def test_collect_snapshots() -> None: check_edges(graph, "do:droplet:289110074", "do:snapshot:103198134") check_edges(graph, "do:tag:snapshot_tag", "do:snapshot:103198134") - snapshot = graph.search_first("urn", "do:snapshot:103198134") + snapshot: DigitalOceanSnapshot = graph.search_first("urn", "do:snapshot:103198134") # type: ignore assert snapshot.urn == "do:snapshot:103198134" assert snapshot.volume_size == 25 assert snapshot.snapshot_size_gigabytes == 2 @@ -340,7 +369,7 @@ def test_collect_loadbalancers() -> None: "do:loadbalancer:9625f517-75f0-4af8-a336-62374e68dc0d", "do:droplet:289110074", ) - lb = graph.search_first("urn", "do:loadbalancer:9625f517-75f0-4af8-a336-62374e68dc0d") + lb: DigitalOceanLoadBalancer = graph.search_first("urn", "do:loadbalancer:9625f517-75f0-4af8-a336-62374e68dc0d") # type: ignore # noqa: E501 assert lb.urn == "do:loadbalancer:9625f517-75f0-4af8-a336-62374e68dc0d" assert lb.name == "fra1-load-balancer-01" assert lb.public_ip_address == "127.0.0.1" @@ -362,7 +391,7 @@ def test_collect_floating_ips() -> None: ) graph = prepare_graph(do_client) check_edges(graph, "do:droplet:289110074", "do:floatingip:127.0.0.1") - floating_ip = graph.search_first("urn", "do:floatingip:127.0.0.1") + floating_ip: DigitalOceanFloatingIP = graph.search_first("urn", "do:floatingip:127.0.0.1") # type: ignore assert floating_ip.urn == "do:floatingip:127.0.0.1" assert floating_ip.ip_address == "127.0.0.1" assert floating_ip.ip_address_family == "ipv4" @@ -416,7 +445,7 @@ def test_collect_projects() -> None: "do:project:75088298-73bd-4c8f-ba4b-91fc220d0ac7", "do:space:api-test-space.resoto", ) - project = graph.search_first("urn", "do:project:75088298-73bd-4c8f-ba4b-91fc220d0ac7") + project: DigitalOceanProject = graph.search_first("urn", "do:project:75088298-73bd-4c8f-ba4b-91fc220d0ac7") # type: ignore # noqa: E501 assert project.owner_uuid == "d63ae7cb6500140c46fdb3585b0c1a874e195760" assert project.owner_id == "10225075" assert project.name == "Resoto DO plugin test project" @@ -436,7 +465,7 @@ def test_collect_space() -> None: ) graph = prepare_graph(do_client) check_edges(graph, "do:region:fra1", "do:space:api-test-space.resoto") - space = graph.search_first("urn", "do:space:api-test-space.resoto") + space: DigitalOceanSpace = graph.search_first("urn", "do:space:api-test-space.resoto") # type: ignore assert space.urn == "do:space:api-test-space.resoto" assert space.name == "api-test-space.resoto" assert space.ctime == datetime.datetime(2022, 2, 23, 13, 42, 21, 455000, datetime.timezone.utc) @@ -457,7 +486,7 @@ def test_collect_apps() -> None: "do:dbaas:2848a998-e151-4d5a-9813-0904a44c2397", "do:app:5dc41512-7523-4eeb-9932-426aa570234b", ) - app = graph.search_first("urn", "do:app:5dc41512-7523-4eeb-9932-426aa570234b") + app: DigitalOceanApp = graph.search_first("urn", "do:app:5dc41512-7523-4eeb-9932-426aa570234b") # type: ignore assert app.urn == "do:app:5dc41512-7523-4eeb-9932-426aa570234b" assert app.default_ingress == "https://resoto_test_app.ondigitalocean.app" assert app.live_url == "https://resoto_test_app.ondigitalocean.app" @@ -478,7 +507,7 @@ def test_cdn_endpoints() -> None: "do:team:test_team", "do:cdn_endpoint:4edbbc3a-79a5-4950-b2d2-ae8f8f8e8e8c", ) - endpoint = graph.search_first("urn", "do:cdn_endpoint:4edbbc3a-79a5-4950-b2d2-ae8f8f8e8e8c") + endpoint: DigitalOceanCdnEndpoint = graph.search_first("urn", "do:cdn_endpoint:4edbbc3a-79a5-4950-b2d2-ae8f8f8e8e8c") # type: ignore # noqa: E501 assert endpoint.urn == "do:cdn_endpoint:4edbbc3a-79a5-4950-b2d2-ae8f8f8e8e8c" assert endpoint.origin == "resoto_test.ams3.digitaloceanspaces.com" assert endpoint.endpoint == "resoto_test.ams3.cdn.digitaloceanspaces.com" @@ -496,7 +525,7 @@ def test_collect_certificates() -> None: "do:team:test_team", "do:certificate:429199eb-7137-4e2b-a15e-f74700173e3c", ) - cert = graph.search_first("urn", "do:certificate:429199eb-7137-4e2b-a15e-f74700173e3c") + cert: DigitalOceanCertificate = graph.search_first("urn", "do:certificate:429199eb-7137-4e2b-a15e-f74700173e3c") # type: ignore # noqa: E501 assert cert.urn == "do:certificate:429199eb-7137-4e2b-a15e-f74700173e3c" assert cert.name == "cdn.resoto.test" assert cert.sha1_fingerprint == "5909e5e05bbce0c63c2e2523542f74700173e3c2" @@ -516,14 +545,14 @@ def test_collect_container_registries() -> None: ) graph = prepare_graph(do_client) check_edges(graph, "do:region:fra1", "do:cr:resoto-do-plugin-test") - container_registry = graph.search_first("urn", "do:cr:resoto-do-plugin-test") + container_registry: DigitalOceanContainerRegistry = graph.search_first("urn", "do:cr:resoto-do-plugin-test") # type: ignore # noqa: E501 assert container_registry.urn == "do:cr:resoto-do-plugin-test" assert container_registry.name == "resoto-do-plugin-test" assert container_registry.storage_usage_bytes == 6144 assert container_registry.is_read_only is False check_edges(graph, "do:cr:resoto-do-plugin-test", "do:crr:resoto-do-plugin-test/hw") - container_registry_repository = graph.search_first("urn", "do:crr:resoto-do-plugin-test/hw") + container_registry_repository: DigitalOceanContainerRegistryRepository = graph.search_first("urn", "do:crr:resoto-do-plugin-test/hw") # type: ignore # noqa: E501 assert container_registry_repository.urn == "do:crr:resoto-do-plugin-test/hw" assert container_registry_repository.name == "hw" assert container_registry_repository.tag_count == 1 @@ -535,7 +564,9 @@ def test_collect_container_registries() -> None: "do:crrt:resoto-do-plugin-test/hw:latest", ) check_edges(graph, "do:cr:resoto-do-plugin-test", "do:crrt:resoto-do-plugin-test/hw:latest") - tag = graph.search_first("urn", "do:crrt:resoto-do-plugin-test/hw:latest") + tag: DigitalOceanContainerRegistryRepositoryTag = graph.search_first( # type: ignore + "urn", "do:crrt:resoto-do-plugin-test/hw:latest" + ) assert tag.urn == "do:crrt:resoto-do-plugin-test/hw:latest" assert tag.name == "latest" assert tag.manifest_digest == "sha256:2ce85c6b306674dcab6eae5fda252037d58f78b0e1bbd41aabf95de6cd7e4a9e" @@ -553,7 +584,7 @@ def test_collect_ssh_keys() -> None: ) graph = prepare_graph(do_client) check_edges(graph, "do:team:test_team", "do:ssh_key:289794") - ssh_key = graph.search_first("urn", "do:ssh_key:289794") + ssh_key: DigitalOceanSSHKey = graph.search_first("urn", "do:ssh_key:289794") # type: ignore assert ssh_key.urn == "do:ssh_key:289794" assert ssh_key.fingerprint == "3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45" assert ssh_key.name == "Other Public Key" @@ -568,7 +599,7 @@ def test_collect_tags() -> None: } ) graph = prepare_graph(do_client) - tag = graph.search_first("urn", "do:tag:droplet_tag") + tag: DigitalOceanTag = graph.search_first("urn", "do:tag:droplet_tag") # type: ignore assert tag.urn == "do:tag:droplet_tag" @@ -582,7 +613,7 @@ def test_collect_domains() -> None: ) graph = prepare_graph(do_client) check_edges(graph, "do:team:test_team", "do:domain:do-plugin-test.resoto") - domain = graph.search_first("urn", "do:domain:do-plugin-test.resoto") + domain: DigitalOceanDomain = graph.search_first("urn", "do:domain:do-plugin-test.resoto") # type: ignore assert domain.ttl == 1800 assert domain.zone_file == "$ORIGIN do-plugin-test.resoto." @@ -591,7 +622,7 @@ def test_collect_domains() -> None: check_edges(graph, "do:domain:do-plugin-test.resoto", "do:domain_record:300035872") check_edges(graph, "do:domain:do-plugin-test.resoto", "do:domain_record:300035874") check_edges(graph, "do:domain:do-plugin-test.resoto", "do:domain_record:300036132") - domain_record = graph.search_first("urn", "do:domain_record:300035870") + domain_record: DigitalOceanDomainRecord = graph.search_first("urn", "do:domain_record:300035870") # type: ignore assert domain_record.urn == "do:domain_record:300035870" assert domain_record.name == "@" assert domain_record.record_type == "SOA" @@ -620,7 +651,7 @@ def test_collect_firewalls() -> None: "do:firewall:fe2e76df-3e15-4895-800f-2d5b3b807711", "do:droplet:289110074", ) - firewall = graph.search_first("urn", "do:firewall:fe2e76df-3e15-4895-800f-2d5b3b807711") + firewall: DigitalOceanFirewall = graph.search_first("urn", "do:firewall:fe2e76df-3e15-4895-800f-2d5b3b807711") # type: ignore # noqa: E501 assert firewall.firewall_status == "succeeded" assert firewall.ctime == datetime.datetime(2022, 3, 10, 13, 10, 50, 0, datetime.timezone.utc) @@ -638,7 +669,7 @@ def test_alert_policies() -> None: "do:team:test_team", "do:alert:d916cb34-6ee3-48c0-bca5-3f3cc08db5d3", ) - alert_policy = graph.search_first("urn", "do:alert:d916cb34-6ee3-48c0-bca5-3f3cc08db5d3") + alert_policy: DigitalOceanAlertPolicy = graph.search_first("urn", "do:alert:d916cb34-6ee3-48c0-bca5-3f3cc08db5d3") # type: ignore # noqa: E501 assert alert_policy.policy_type == "v1/insights/droplet/cpu" assert alert_policy.description == "CPU is running high" assert alert_policy.is_enabled is True diff --git a/plugins/digitalocean/tox.ini b/plugins/digitalocean/tox.ini index 2d2a95d49..daea6f828 100644 --- a/plugins/digitalocean/tox.ini +++ b/plugins/digitalocean/tox.ini @@ -14,9 +14,10 @@ testpaths= test usedevelop = true deps = --editable=file:///{toxinidir}/../../resotolib - -rrequirements.txt - -r../../resotolib/requirements-test.txt - -rrequirements-test.txt + -r../../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/plugins/digitalocean_k8s/MANIFEST.in b/plugins/digitalocean_k8s/MANIFEST.in index 93c438dd0..bb3ec5f0d 100644 --- a/plugins/digitalocean_k8s/MANIFEST.in +++ b/plugins/digitalocean_k8s/MANIFEST.in @@ -1,3 +1 @@ include README.md -include requirements.txt -include requirements-test.txt diff --git a/plugins/digitalocean_k8s/pyproject.toml b/plugins/digitalocean_k8s/pyproject.toml new file mode 100644 index 000000000..e0fbc07da --- /dev/null +++ b/plugins/digitalocean_k8s/pyproject.toml @@ -0,0 +1,49 @@ +[project] +name = "resoto-plugin-digitalocean-k8s" +description = "Resoto DigitalOcean-K8s Collector Plugin" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0", +] + +[project.optional-dependencies] +dev = [ + "mypy", +] + +[project.entry-points."resoto.plugins"] +digitalocean_k8s_collector = "resoto_plugin_digitalocean_k8s:DigitalOceanK8sCollectorPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/digitalocean_k8s" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/digitalocean_k8s/requirements-test.txt b/plugins/digitalocean_k8s/requirements-test.txt deleted file mode 100644 index 239f9b352..000000000 --- a/plugins/digitalocean_k8s/requirements-test.txt +++ /dev/null @@ -1 +0,0 @@ -mypy>=0.961 diff --git a/plugins/digitalocean_k8s/requirements.txt b/plugins/digitalocean_k8s/requirements.txt deleted file mode 100644 index 5cda6053d..000000000 --- a/plugins/digitalocean_k8s/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -resotolib==3.5.0 diff --git a/plugins/digitalocean_k8s/setup.cfg b/plugins/digitalocean_k8s/setup.cfg index b7e478982..7ca653793 100644 --- a/plugins/digitalocean_k8s/setup.cfg +++ b/plugins/digitalocean_k8s/setup.cfg @@ -1,2 +1,7 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/digitalocean_k8s/setup.py b/plugins/digitalocean_k8s/setup.py deleted file mode 100644 index b402ea7e5..000000000 --- a/plugins/digitalocean_k8s/setup.py +++ /dev/null @@ -1,48 +0,0 @@ -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-digitalocean-k8s", - version="3.5.0", - description="Resoto DigitalOcean-K8s Collector Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={ - "resoto.plugins": ["digitalocean_k8s_collector = resoto_plugin_digitalocean_k8s:DigitalOceanK8sCollectorPlugin"] - }, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/digitalocean_k8s", -) diff --git a/plugins/digitalocean_k8s/tox.ini b/plugins/digitalocean_k8s/tox.ini index ff9cba9b2..2e21384a5 100644 --- a/plugins/digitalocean_k8s/tox.ini +++ b/plugins/digitalocean_k8s/tox.ini @@ -14,9 +14,10 @@ testpaths= test usedevelop = true deps = --editable=file:///{toxinidir}/../../resotolib - -rrequirements.txt - -r../../resotolib/requirements-test.txt - -rrequirements-test.txt + -r../../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/plugins/dockerhub/MANIFEST.in b/plugins/dockerhub/MANIFEST.in index 8afbefe8d..bb3ec5f0d 100644 --- a/plugins/dockerhub/MANIFEST.in +++ b/plugins/dockerhub/MANIFEST.in @@ -1,2 +1 @@ include README.md -include requirements.txt diff --git a/plugins/dockerhub/pyproject.toml b/plugins/dockerhub/pyproject.toml new file mode 100644 index 000000000..7acf33e93 --- /dev/null +++ b/plugins/dockerhub/pyproject.toml @@ -0,0 +1,46 @@ +[project] +name = "resoto-plugin-dockerhub" +description = "Resoto Docker Hub Collector Plugin" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0", + "requests", + +] + +[project.entry-points."resoto.plugins"] +dockerhub = "resoto_plugin_dockerhub:DockerHubCollectorPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/dockerhub" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/dockerhub/requirements.txt b/plugins/dockerhub/requirements.txt deleted file mode 100644 index 601fa1115..000000000 --- a/plugins/dockerhub/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -resotolib==3.5.0 -requests>=2.31 diff --git a/plugins/dockerhub/setup.cfg b/plugins/dockerhub/setup.cfg index b7e478982..7ca653793 100644 --- a/plugins/dockerhub/setup.cfg +++ b/plugins/dockerhub/setup.cfg @@ -1,2 +1,7 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/dockerhub/setup.py b/plugins/dockerhub/setup.py deleted file mode 100644 index 182b296c8..000000000 --- a/plugins/dockerhub/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-dockerhub", - version="3.5.0", - description="Resoto Docker Hub Collector Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={"resoto.plugins": ["dockerhub = resoto_plugin_dockerhub:DockerHubCollectorPlugin"]}, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/dockerhub", -) diff --git a/plugins/dockerhub/tox.ini b/plugins/dockerhub/tox.ini index 1ab26ccf5..419914eb6 100644 --- a/plugins/dockerhub/tox.ini +++ b/plugins/dockerhub/tox.ini @@ -14,8 +14,10 @@ testpaths= test usedevelop = true deps = --editable=file:///{toxinidir}/../../resotolib - -rrequirements.txt - -r../../resotolib/requirements-test.txt + -r../../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/plugins/example_collector/MANIFEST.in b/plugins/example_collector/MANIFEST.in index 8afbefe8d..bb3ec5f0d 100644 --- a/plugins/example_collector/MANIFEST.in +++ b/plugins/example_collector/MANIFEST.in @@ -1,2 +1 @@ include README.md -include requirements.txt diff --git a/plugins/example_collector/pyproject.toml b/plugins/example_collector/pyproject.toml new file mode 100644 index 000000000..32c442cd0 --- /dev/null +++ b/plugins/example_collector/pyproject.toml @@ -0,0 +1,44 @@ +[project] +name = "resoto-plugin-example-collector" +description = "Resoto Example Collector Plugin" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0", +] + +[project.entry-points."resoto.plugins"] +example_collector = "resoto_plugin_example_collector:ExampleCollectorPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/example_collector" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/example_collector/requirements.txt b/plugins/example_collector/requirements.txt deleted file mode 100644 index 5cda6053d..000000000 --- a/plugins/example_collector/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -resotolib==3.5.0 diff --git a/plugins/example_collector/setup.cfg b/plugins/example_collector/setup.cfg index b7e478982..7ca653793 100644 --- a/plugins/example_collector/setup.cfg +++ b/plugins/example_collector/setup.cfg @@ -1,2 +1,7 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/example_collector/setup.py b/plugins/example_collector/setup.py deleted file mode 100644 index b32487409..000000000 --- a/plugins/example_collector/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-example-collector", - version="3.5.0", - description="Resoto Example Collector Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={"resoto.plugins": ["example_collector = resoto_plugin_example_collector:ExampleCollectorPlugin"]}, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/example_collector", -) diff --git a/plugins/example_collector/tox.ini b/plugins/example_collector/tox.ini index 0999bf579..033ae44d4 100644 --- a/plugins/example_collector/tox.ini +++ b/plugins/example_collector/tox.ini @@ -14,8 +14,10 @@ testpaths= test usedevelop = true deps = --editable=file:///{toxinidir}/../../resotolib - -rrequirements.txt - -r../../resotolib/requirements-test.txt + -r../../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/plugins/gcp/MANIFEST.in b/plugins/gcp/MANIFEST.in index 8afbefe8d..bb3ec5f0d 100644 --- a/plugins/gcp/MANIFEST.in +++ b/plugins/gcp/MANIFEST.in @@ -1,2 +1 @@ include README.md -include requirements.txt diff --git a/plugins/gcp/pyproject.toml b/plugins/gcp/pyproject.toml new file mode 100644 index 000000000..f93b9ab84 --- /dev/null +++ b/plugins/gcp/pyproject.toml @@ -0,0 +1,48 @@ +[project] +name = "resoto-plugin-gcp" +description = "Resoto GCP Collector Plugin" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0", + "google-api-python-client", + "oauth2client", + "retrying", + "tenacity", +] + +[project.entry-points."resoto.plugins"] +gcp = "resoto_plugin_gcp:GCPCollectorPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/gcp" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/gcp/requirements.txt b/plugins/gcp/requirements.txt deleted file mode 100644 index 73b0426fc..000000000 --- a/plugins/gcp/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -resotolib==3.5.0 -google-api-python-client==2.86.0 -oauth2client==4.1.3 -retrying==1.3.4 -tenacity==8.2.2 diff --git a/plugins/gcp/setup.cfg b/plugins/gcp/setup.cfg index 6e41aae4e..a71eefc67 100644 --- a/plugins/gcp/setup.cfg +++ b/plugins/gcp/setup.cfg @@ -1,3 +1,8 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/gcp/setup.py b/plugins/gcp/setup.py deleted file mode 100644 index 839a722aa..000000000 --- a/plugins/gcp/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-gcp", - version="3.5.0", - description="Resoto GCP Collector Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={"resoto.plugins": ["gcp = resoto_plugin_gcp:GCPCollectorPlugin"]}, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/gcp", -) diff --git a/plugins/gcp/tox.ini b/plugins/gcp/tox.ini index c78034f4e..a09bb132c 100644 --- a/plugins/gcp/tox.ini +++ b/plugins/gcp/tox.ini @@ -13,8 +13,10 @@ testpaths= test usedevelop = true deps = --editable=file:///{toxinidir}/../../resotolib - -rrequirements.txt - -r../../resotolib/requirements-test.txt + -r../../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/plugins/github/MANIFEST.in b/plugins/github/MANIFEST.in index 8afbefe8d..bb3ec5f0d 100644 --- a/plugins/github/MANIFEST.in +++ b/plugins/github/MANIFEST.in @@ -1,2 +1 @@ include README.md -include requirements.txt diff --git a/plugins/github/pyproject.toml b/plugins/github/pyproject.toml new file mode 100644 index 000000000..cef316290 --- /dev/null +++ b/plugins/github/pyproject.toml @@ -0,0 +1,45 @@ +[project] +name = "resoto-plugin-github" +description = "Resoto Github Collector Plugin" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0", + "PyGithub", +] + +[project.entry-points."resoto.plugins"] +github = "resoto_plugin_github:GithubCollectorPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/github" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/github/requirements.txt b/plugins/github/requirements.txt deleted file mode 100644 index 3c5cc7884..000000000 --- a/plugins/github/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -resotolib==3.5.0 -PyGithub==1.58.2 diff --git a/plugins/github/setup.cfg b/plugins/github/setup.cfg index b7e478982..7ca653793 100644 --- a/plugins/github/setup.cfg +++ b/plugins/github/setup.cfg @@ -1,2 +1,7 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/github/setup.py b/plugins/github/setup.py deleted file mode 100644 index 7db65a390..000000000 --- a/plugins/github/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-github", - version="3.5.0", - description="Resoto Github Collector Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={"resoto.plugins": ["github = resoto_plugin_github:GithubCollectorPlugin"]}, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/github", -) diff --git a/plugins/github/tox.ini b/plugins/github/tox.ini index fb3465480..a54b7f8a5 100644 --- a/plugins/github/tox.ini +++ b/plugins/github/tox.ini @@ -14,8 +14,10 @@ testpaths= test usedevelop = true deps = --editable=file:///{toxinidir}/../../resotolib - -rrequirements.txt - -r../../resotolib/requirements-test.txt + -r../../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/plugins/k8s/MANIFEST.in b/plugins/k8s/MANIFEST.in index 8afbefe8d..bb3ec5f0d 100644 --- a/plugins/k8s/MANIFEST.in +++ b/plugins/k8s/MANIFEST.in @@ -1,2 +1 @@ include README.md -include requirements.txt diff --git a/plugins/k8s/pyproject.toml b/plugins/k8s/pyproject.toml new file mode 100644 index 000000000..1c0854817 --- /dev/null +++ b/plugins/k8s/pyproject.toml @@ -0,0 +1,45 @@ +[project] +name = "resoto-plugin-k8s" +description = "Resoto Kubernetes Collector Plugin" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0", + "kubernetes", +] + +[project.entry-points."resoto.plugins"] +k8s_collector = "resoto_plugin_k8s:KubernetesCollectorPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/k8s" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/k8s/requirements.txt b/plugins/k8s/requirements.txt deleted file mode 100644 index 8b6ba7e3f..000000000 --- a/plugins/k8s/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -resotolib==3.5.0 -kubernetes==26.1.0 -setuptools>=67.0.0 # not directly required, pinned by Snyk to avoid a vulnerability diff --git a/plugins/k8s/setup.cfg b/plugins/k8s/setup.cfg index fe8fb4a76..aad70171a 100644 --- a/plugins/k8s/setup.cfg +++ b/plugins/k8s/setup.cfg @@ -1,3 +1,8 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/k8s/setup.py b/plugins/k8s/setup.py deleted file mode 100644 index 2471a7b76..000000000 --- a/plugins/k8s/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-k8s", - version="3.5.0", - description="Resoto Kubernetes Collector Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={"resoto.plugins": ["k8s_collector = resoto_plugin_k8s:KubernetesCollectorPlugin"]}, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/k8s", -) diff --git a/plugins/k8s/tox.ini b/plugins/k8s/tox.ini index d6b8d67f3..2fa09c29d 100644 --- a/plugins/k8s/tox.ini +++ b/plugins/k8s/tox.ini @@ -15,8 +15,10 @@ markers=json_file usedevelop = true deps = --editable=file:///{toxinidir}/../../resotolib - -rrequirements.txt - -r../../resotolib/requirements-test.txt + -r../../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/plugins/onelogin/MANIFEST.in b/plugins/onelogin/MANIFEST.in index 8afbefe8d..bb3ec5f0d 100644 --- a/plugins/onelogin/MANIFEST.in +++ b/plugins/onelogin/MANIFEST.in @@ -1,2 +1 @@ include README.md -include requirements.txt diff --git a/plugins/onelogin/pyproject.toml b/plugins/onelogin/pyproject.toml new file mode 100644 index 000000000..2a6e7d5cf --- /dev/null +++ b/plugins/onelogin/pyproject.toml @@ -0,0 +1,45 @@ +[project] +name = "resoto-plugin-onelogin" +description = "Resoto OneLogin Plugin" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0", + "onelogin==2.0.4", +] + +[project.entry-points."resoto.plugins"] +onelogin = "resoto_plugin_onelogin:OneLoginPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/onelogin" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/onelogin/requirements.txt b/plugins/onelogin/requirements.txt deleted file mode 100644 index 668d4ff7d..000000000 --- a/plugins/onelogin/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -resotolib==3.5.0 -onelogin==2.0.4 # version 3 has breaking changes. diff --git a/plugins/onelogin/setup.cfg b/plugins/onelogin/setup.cfg index b7e478982..7ca653793 100644 --- a/plugins/onelogin/setup.cfg +++ b/plugins/onelogin/setup.cfg @@ -1,2 +1,7 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/onelogin/setup.py b/plugins/onelogin/setup.py deleted file mode 100644 index b1de4dd5c..000000000 --- a/plugins/onelogin/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-onelogin", - version="3.5.0", - description="Resoto OneLogin Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={"resoto.plugins": ["onelogin = resoto_plugin_onelogin:OneLoginPlugin"]}, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/onelogin", -) diff --git a/plugins/onelogin/tox.ini b/plugins/onelogin/tox.ini index 95b41790d..6d82e2b37 100644 --- a/plugins/onelogin/tox.ini +++ b/plugins/onelogin/tox.ini @@ -14,8 +14,10 @@ testpaths= test usedevelop = true deps = --editable=file:///{toxinidir}/../../resotolib - -rrequirements.txt - -r../../resotolib/requirements-test.txt + -r../../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/plugins/onprem/MANIFEST.in b/plugins/onprem/MANIFEST.in index 8afbefe8d..bb3ec5f0d 100644 --- a/plugins/onprem/MANIFEST.in +++ b/plugins/onprem/MANIFEST.in @@ -1,2 +1 @@ include README.md -include requirements.txt diff --git a/plugins/onprem/pyproject.toml b/plugins/onprem/pyproject.toml new file mode 100644 index 000000000..0e63e4103 --- /dev/null +++ b/plugins/onprem/pyproject.toml @@ -0,0 +1,45 @@ +[project] +name = "resoto-plugin-onprem" +description = "Resoto On-Premises Collector Plugin" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0", + "paramiko", +] + +[project.entry-points."resoto.plugins"] +onprem = "resoto_plugin_onprem:OnpremCollectorPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/onelogin" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/onprem/requirements.txt b/plugins/onprem/requirements.txt deleted file mode 100644 index b2d3cb0ff..000000000 --- a/plugins/onprem/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -resotolib==3.5.0 -paramiko==3.1.0 diff --git a/plugins/onprem/setup.cfg b/plugins/onprem/setup.cfg index b7e478982..7ca653793 100644 --- a/plugins/onprem/setup.cfg +++ b/plugins/onprem/setup.cfg @@ -1,2 +1,7 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/onprem/setup.py b/plugins/onprem/setup.py deleted file mode 100644 index e7a89c19c..000000000 --- a/plugins/onprem/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-onprem", - version="3.5.0", - description="Resoto On-Premises Collector Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={"resoto.plugins": ["onprem = resoto_plugin_onprem:OnpremCollectorPlugin"]}, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/onprem", -) diff --git a/plugins/onprem/tox.ini b/plugins/onprem/tox.ini index 59cd5ab3f..70568ed77 100644 --- a/plugins/onprem/tox.ini +++ b/plugins/onprem/tox.ini @@ -14,8 +14,10 @@ testpaths= test usedevelop = true deps = --editable=file:///{toxinidir}/../../resotolib - -rrequirements.txt - -r../../resotolib/requirements-test.txt + -r../../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/plugins/posthog/MANIFEST.in b/plugins/posthog/MANIFEST.in index 8afbefe8d..bb3ec5f0d 100644 --- a/plugins/posthog/MANIFEST.in +++ b/plugins/posthog/MANIFEST.in @@ -1,2 +1 @@ include README.md -include requirements.txt diff --git a/plugins/posthog/pyproject.toml b/plugins/posthog/pyproject.toml new file mode 100644 index 000000000..086febe81 --- /dev/null +++ b/plugins/posthog/pyproject.toml @@ -0,0 +1,45 @@ +[project] +name = "resoto-plugin-posthog" +description = "Resoto Posthog Collector Plugin" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0", + "requests", +] + +[project.entry-points."resoto.plugins"] +posthog = "resoto_plugin_posthog:PosthogCollectorPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/posthog" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/posthog/requirements.txt b/plugins/posthog/requirements.txt deleted file mode 100644 index 601fa1115..000000000 --- a/plugins/posthog/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -resotolib==3.5.0 -requests>=2.31 diff --git a/plugins/posthog/setup.cfg b/plugins/posthog/setup.cfg index b7e478982..7ca653793 100644 --- a/plugins/posthog/setup.cfg +++ b/plugins/posthog/setup.cfg @@ -1,2 +1,7 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/posthog/setup.py b/plugins/posthog/setup.py deleted file mode 100644 index 243e55411..000000000 --- a/plugins/posthog/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-posthog", - version="3.5.0", - description="Resoto Posthog Collector Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={"resoto.plugins": ["posthog = resoto_plugin_posthog:PosthogCollectorPlugin"]}, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/posthog", -) diff --git a/plugins/posthog/tox.ini b/plugins/posthog/tox.ini index 1ab26ccf5..419914eb6 100644 --- a/plugins/posthog/tox.ini +++ b/plugins/posthog/tox.ini @@ -14,8 +14,10 @@ testpaths= test usedevelop = true deps = --editable=file:///{toxinidir}/../../resotolib - -rrequirements.txt - -r../../resotolib/requirements-test.txt + -r../../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/plugins/protector/MANIFEST.in b/plugins/protector/MANIFEST.in index 8afbefe8d..bb3ec5f0d 100644 --- a/plugins/protector/MANIFEST.in +++ b/plugins/protector/MANIFEST.in @@ -1,2 +1 @@ include README.md -include requirements.txt diff --git a/plugins/protector/pyproject.toml b/plugins/protector/pyproject.toml new file mode 100644 index 000000000..f45c589e4 --- /dev/null +++ b/plugins/protector/pyproject.toml @@ -0,0 +1,44 @@ +[project] +name = "resoto-plugin-protector" +description = "Resoto Protector Plugin" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0", +] + +[project.entry-points."resoto.plugins"] +protector = "resoto_plugin_protector:ProtectorPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/protector" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/protector/requirements.txt b/plugins/protector/requirements.txt deleted file mode 100644 index 5cda6053d..000000000 --- a/plugins/protector/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -resotolib==3.5.0 diff --git a/plugins/protector/setup.cfg b/plugins/protector/setup.cfg index b7e478982..7ca653793 100644 --- a/plugins/protector/setup.cfg +++ b/plugins/protector/setup.cfg @@ -1,2 +1,7 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/protector/setup.py b/plugins/protector/setup.py deleted file mode 100644 index d759210c2..000000000 --- a/plugins/protector/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-protector", - version="3.5.0", - description="Resoto Protector Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={"resoto.plugins": ["protector = resoto_plugin_protector:ProtectorPlugin"]}, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/protector", -) diff --git a/plugins/protector/tox.ini b/plugins/protector/tox.ini index 63e4fbe7a..8a8e381ce 100644 --- a/plugins/protector/tox.ini +++ b/plugins/protector/tox.ini @@ -14,8 +14,10 @@ testpaths= test usedevelop = true deps = --editable=file:///{toxinidir}/../../resotolib - -rrequirements.txt - -r../../resotolib/requirements-test.txt + -r../../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/plugins/random/MANIFEST.in b/plugins/random/MANIFEST.in index 8afbefe8d..bb3ec5f0d 100644 --- a/plugins/random/MANIFEST.in +++ b/plugins/random/MANIFEST.in @@ -1,2 +1 @@ include README.md -include requirements.txt diff --git a/plugins/random/pyproject.toml b/plugins/random/pyproject.toml new file mode 100644 index 000000000..5e02fe556 --- /dev/null +++ b/plugins/random/pyproject.toml @@ -0,0 +1,44 @@ +[project] +name = "resoto-plugin-random" +description = "Resoto Random Collector Plugin" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0", +] + +[project.entry-points."resoto.plugins"] +random = "resoto_plugin_random:RandomCollectorPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/random" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/random/requirements.txt b/plugins/random/requirements.txt deleted file mode 100644 index 5cda6053d..000000000 --- a/plugins/random/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -resotolib==3.5.0 diff --git a/plugins/random/setup.cfg b/plugins/random/setup.cfg index b7e478982..7ca653793 100644 --- a/plugins/random/setup.cfg +++ b/plugins/random/setup.cfg @@ -1,2 +1,7 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/random/setup.py b/plugins/random/setup.py deleted file mode 100644 index aee9ef636..000000000 --- a/plugins/random/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-random", - version="3.5.0", - description="Resoto Random Collector Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={"resoto.plugins": ["random = resoto_plugin_random:RandomCollectorPlugin"]}, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/random", -) diff --git a/plugins/random/tox.ini b/plugins/random/tox.ini index 2f521c6d1..5fe1aa1a4 100644 --- a/plugins/random/tox.ini +++ b/plugins/random/tox.ini @@ -14,8 +14,10 @@ testpaths= test usedevelop = true deps = --editable=file:///{toxinidir}/../../resotolib - -rrequirements.txt - -r../../resotolib/requirements-test.txt + -r../../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/plugins/scarf/MANIFEST.in b/plugins/scarf/MANIFEST.in index 8afbefe8d..bb3ec5f0d 100644 --- a/plugins/scarf/MANIFEST.in +++ b/plugins/scarf/MANIFEST.in @@ -1,2 +1 @@ include README.md -include requirements.txt diff --git a/plugins/scarf/pyproject.toml b/plugins/scarf/pyproject.toml new file mode 100644 index 000000000..4ffd7dd53 --- /dev/null +++ b/plugins/scarf/pyproject.toml @@ -0,0 +1,45 @@ +[project] +name = "resoto-plugin-scarf" +description = "Resoto Scarf Collector Plugin" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0", + "requests", +] + +[project.entry-points."resoto.plugins"] +scarf = "resoto_plugin_scarf:ScarfCollectorPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/scarf" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/scarf/requirements.txt b/plugins/scarf/requirements.txt deleted file mode 100644 index 601fa1115..000000000 --- a/plugins/scarf/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -resotolib==3.5.0 -requests>=2.31 diff --git a/plugins/scarf/setup.cfg b/plugins/scarf/setup.cfg index b7e478982..7ca653793 100644 --- a/plugins/scarf/setup.cfg +++ b/plugins/scarf/setup.cfg @@ -1,2 +1,7 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/scarf/setup.py b/plugins/scarf/setup.py deleted file mode 100644 index d8a780937..000000000 --- a/plugins/scarf/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-scarf", - version="3.5.0", - description="Resoto Scarf Collector Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={"resoto.plugins": ["scarf = resoto_plugin_scarf:ScarfCollectorPlugin"]}, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/scarf", -) diff --git a/plugins/scarf/tox.ini b/plugins/scarf/tox.ini index 6b0ed108a..6fc340f7c 100644 --- a/plugins/scarf/tox.ini +++ b/plugins/scarf/tox.ini @@ -14,8 +14,10 @@ testpaths= test usedevelop = true deps = --editable=file:///{toxinidir}/../../resotolib - -rrequirements.txt - -r../../resotolib/requirements-test.txt + -r../../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/plugins/slack/MANIFEST.in b/plugins/slack/MANIFEST.in index 8afbefe8d..bb3ec5f0d 100644 --- a/plugins/slack/MANIFEST.in +++ b/plugins/slack/MANIFEST.in @@ -1,2 +1 @@ include README.md -include requirements.txt diff --git a/plugins/slack/pyproject.toml b/plugins/slack/pyproject.toml new file mode 100644 index 000000000..35b0fbfc1 --- /dev/null +++ b/plugins/slack/pyproject.toml @@ -0,0 +1,47 @@ +[project] +name = "resoto-plugin-slack" +description = "Resoto Slack Plugin" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0", + "slack-sdk", + "retrying", +] + +[project.entry-points."resoto.plugins"] +slack_bot = "resoto_plugin_slack:SlackBotPlugin" +slack_collector = "resoto_plugin_slack:SlackCollectorPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/slack" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/slack/requirements.txt b/plugins/slack/requirements.txt deleted file mode 100644 index 06018a38d..000000000 --- a/plugins/slack/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -resotolib==3.5.0 -slack-sdk==3.21.3 -retrying>=1.3.4 diff --git a/plugins/slack/setup.cfg b/plugins/slack/setup.cfg index b7e478982..7ca653793 100644 --- a/plugins/slack/setup.cfg +++ b/plugins/slack/setup.cfg @@ -1,2 +1,7 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/slack/setup.py b/plugins/slack/setup.py deleted file mode 100644 index f1167ae6f..000000000 --- a/plugins/slack/setup.py +++ /dev/null @@ -1,51 +0,0 @@ -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-slack", - version="3.5.0", - description="Resoto Slack Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={ - "resoto.plugins": [ - "slack_bot = resoto_plugin_slack:SlackBotPlugin", - "slack_collector = resoto_plugin_slack:SlackCollectorPlugin", - ] - }, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - include_package_data=True, - zip_safe=False, - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/slack", -) diff --git a/plugins/slack/tox.ini b/plugins/slack/tox.ini index 9c743b471..c68a96567 100644 --- a/plugins/slack/tox.ini +++ b/plugins/slack/tox.ini @@ -14,8 +14,10 @@ testpaths= test usedevelop = true deps = --editable=file:///{toxinidir}/../../resotolib - -rrequirements.txt - -r../../resotolib/requirements-test.txt + -r../../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/plugins/tagvalidator/MANIFEST.in b/plugins/tagvalidator/MANIFEST.in index 8afbefe8d..bb3ec5f0d 100644 --- a/plugins/tagvalidator/MANIFEST.in +++ b/plugins/tagvalidator/MANIFEST.in @@ -1,2 +1 @@ include README.md -include requirements.txt diff --git a/plugins/tagvalidator/pyproject.toml b/plugins/tagvalidator/pyproject.toml new file mode 100644 index 000000000..37e95209e --- /dev/null +++ b/plugins/tagvalidator/pyproject.toml @@ -0,0 +1,44 @@ +[project] +name = "resoto-plugin-tagvalidator" +description = "Resoto Tag Validator Plugin" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0", +] + +[project.entry-points."resoto.plugins"] +tagvalidator = "resoto_plugin_tagvalidator:TagValidatorPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/tagvalidator" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/tagvalidator/requirements.txt b/plugins/tagvalidator/requirements.txt deleted file mode 100644 index 5cda6053d..000000000 --- a/plugins/tagvalidator/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -resotolib==3.5.0 diff --git a/plugins/tagvalidator/setup.cfg b/plugins/tagvalidator/setup.cfg index b7e478982..7ca653793 100644 --- a/plugins/tagvalidator/setup.cfg +++ b/plugins/tagvalidator/setup.cfg @@ -1,2 +1,7 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/tagvalidator/setup.py b/plugins/tagvalidator/setup.py deleted file mode 100644 index b4d8b37b5..000000000 --- a/plugins/tagvalidator/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-tagvalidator", - version="3.5.0", - description="Resoto Tag Validator Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={"resoto.plugins": ["tagvalidator = resoto_plugin_tagvalidator:TagValidatorPlugin"]}, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/tagvalidator", -) diff --git a/plugins/tagvalidator/tox.ini b/plugins/tagvalidator/tox.ini index df60e77db..6d6154857 100644 --- a/plugins/tagvalidator/tox.ini +++ b/plugins/tagvalidator/tox.ini @@ -13,8 +13,10 @@ testpaths= test usedevelop = true deps = --editable=file:///{toxinidir}/../../resotolib - -rrequirements.txt - -r../../resotolib/requirements-test.txt + -r../../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/plugins/vsphere/MANIFEST.in b/plugins/vsphere/MANIFEST.in index 8afbefe8d..bb3ec5f0d 100644 --- a/plugins/vsphere/MANIFEST.in +++ b/plugins/vsphere/MANIFEST.in @@ -1,2 +1 @@ include README.md -include requirements.txt diff --git a/plugins/vsphere/pyproject.toml b/plugins/vsphere/pyproject.toml new file mode 100644 index 000000000..b8bef6b72 --- /dev/null +++ b/plugins/vsphere/pyproject.toml @@ -0,0 +1,45 @@ +[project] +name = "resoto-plugin-vsphere" +description = "Resoto VSphere Collector Plugin" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0", + "pyvmomi", +] + +[project.entry-points."resoto.plugins"] +vsphere = "resoto_plugin_vsphere:VSphereCollectorPlugin" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/plugins/vsphere" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + + diff --git a/plugins/vsphere/requirements.txt b/plugins/vsphere/requirements.txt deleted file mode 100644 index 12975822c..000000000 --- a/plugins/vsphere/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -resotolib==3.5.0 -pyvmomi==8.0.1.0 diff --git a/plugins/vsphere/setup.cfg b/plugins/vsphere/setup.cfg index b7e478982..7ca653793 100644 --- a/plugins/vsphere/setup.cfg +++ b/plugins/vsphere/setup.cfg @@ -1,2 +1,7 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/plugins/vsphere/setup.py b/plugins/vsphere/setup.py deleted file mode 100644 index 202364f7c..000000000 --- a/plugins/vsphere/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name="resoto-plugin-vsphere", - version="3.5.0", - description="Resoto VSphere Collector Plugin", - license="Apache 2.0", - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={"resoto.plugins": ["vsphere = resoto_plugin_vsphere:VSphereCollectorPlugin"]}, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/plugins/vsphere", -) diff --git a/plugins/vsphere/tox.ini b/plugins/vsphere/tox.ini index 0ae880426..85fb7a440 100644 --- a/plugins/vsphere/tox.ini +++ b/plugins/vsphere/tox.ini @@ -14,8 +14,10 @@ testpaths= test usedevelop = true deps = --editable=file:///{toxinidir}/../../resotolib - -rrequirements.txt - -r../../resotolib/requirements-test.txt + -r../../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/requirements-all.txt b/requirements-all.txt new file mode 100644 index 000000000..1e8f2a19d --- /dev/null +++ b/requirements-all.txt @@ -0,0 +1,154 @@ +aiodns==3.0.0 +aiofiles==23.1.0 +aiohttp[speedups]==3.8.4 +aiohttp-jinja2==1.5.1 +aiohttp-swagger3==0.7.4 +aiosignal==1.3.1 +aiostream==0.4.5 +apscheduler==3.10.1 +astroid==2.15.5 +async-timeout==4.0.2 +attrs==23.1.0 +autocommand==2.2.2 +backoff==2.2.1 +bcrypt==4.0.1 +black==23.3.0 +boto3==1.26.142 +botocore==1.29.142 +brotli==1.0.9 +build==0.10.0 +cachetools==5.3.1 +cattrs==22.2.0 +cerberus==1.3.4 +certifi==2023.5.7 +cffi==1.15.1 +chardet==5.1.0 +charset-normalizer==3.1.0 +cheroot==10.0.0 +cherrypy==18.8.0 +click==8.1.3 +colorama==0.4.6 +coverage[toml]==7.2.7 +cryptography==40.0.2 +deepdiff==6.3.0 +defusedxml==0.7.1 +deprecated==1.2.14 +dill==0.3.6 +distlib==0.3.6 +fastjsonschema==2.16.3 +filelock==3.12.0 +flake8==6.0.0 +frozendict==2.3.8 +frozenlist==1.3.3 +google-api-core==2.11.0 +google-api-python-client==2.87.0 +google-auth==2.19.0 +google-auth-httplib2==0.1.0 +googleapis-common-protos==1.59.0 +httplib2==0.22.0 +hypothesis==6.75.6 +idna==3.4 +inflect==6.0.4 +iniconfig==2.0.0 +isort==5.12.0 +jaraco-collections==4.1.0 +jaraco-context==4.3.0 +jaraco-functools==3.7.0 +jaraco-text==3.11.1 +jinja2==3.1.2 +jmespath==1.0.1 +jq==1.4.1 +jsons==1.6.3 +kubernetes==26.1.0 +lazy-object-proxy==1.9.0 +markdown-it-py==2.2.0 +markupsafe==2.1.2 +mccabe==0.7.0 +mdurl==0.1.2 +monotonic==1.6 +more-itertools==9.1.0 +multidict==6.0.4 +mypy==1.3.0 +mypy-extensions==1.0.0 +networkx==3.1 +oauth2client==4.1.3 +oauthlib==3.2.2 +onelogin==2.0.4 +ordered-set==4.1.0 +packaging==23.1 +paramiko==3.2.0 +parsy==2.1 +pathspec==0.11.1 +pep8-naming==0.13.3 +pint==0.22 +pip==23.1.2 +pip-tools==6.13.0 +plantuml==0.3.0 +platformdirs==3.5.1 +pluggy==1.0.0 +portend==3.1.0 +posthog==3.0.1 +prometheus-client==0.17.0 +prompt-toolkit==3.0.38 +protobuf==4.23.2 +psutil==5.9.5 +pyasn1==0.5.0 +pyasn1-modules==0.3.0 +pycares==4.3.0 +pycodestyle==2.10.0 +pycparser==2.21 +pydantic==1.10.8 +pyflakes==3.0.1 +pygithub==1.58.2 +pygments==2.15.1 +pyjwt[crypto]==2.7.0 +pylint==2.17.4 +pynacl==1.5.0 +pyparsing==3.0.9 +pyproject-api==1.5.1 +pyproject-hooks==1.0.0 +pytest==7.3.1 +pytest-asyncio==0.21.0 +pytest-cov==4.1.0 +pytest-runner==6.0.0 +python-arango==7.5.7 +python-dateutil==2.8.2 +pytz==2023.3 +pyvmomi==8.0.1.0.1 +pyyaml==6.0 +requests==2.31.0 +requests-oauthlib==1.3.1 +requests-toolbelt==1.0.0 +resotoclient==1.4.1 +resotoui==3.5.0 +retrying==1.3.4 +rfc3339-validator==0.1.4 +rich==13.3.5 +rsa==4.9 +s3transfer==0.6.1 +setuptools==67.8.0 +six==1.16.0 +slack-sdk==3.21.3 +sortedcontainers==2.4.0 +tempora==5.2.2 +tenacity==8.2.2 +toml==0.10.2 +tomlkit==0.11.8 +toolz==0.12.0 +tox==4.5.2 +transitions==0.9.0 +typeguard==4.0.0 +typing-extensions==4.6.2 +typish==1.9.3 +tzdata==2023.3 +tzlocal==5.0.1 +uritemplate==4.1.1 +urllib3==1.26.16 +ustache==0.1.5 +virtualenv==20.23.0 +wcwidth==0.2.6 +websocket-client==1.5.2 +wheel==0.40.0 +wrapt==1.15.0 +yarl==1.9.2 +zc-lockfile==3.0.post1 diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 000000000..01267529b --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,147 @@ +aiodns==3.0.0 +aiofiles==23.1.0 +aiohttp[speedups]==3.8.4 +aiohttp-jinja2==1.5.1 +aiohttp-swagger3==0.7.4 +aiosignal==1.3.1 +aiostream==0.4.5 +apscheduler==3.10.1 +astroid==2.15.5 +async-timeout==4.0.2 +attrs==23.1.0 +autocommand==2.2.2 +backoff==2.2.1 +bcrypt==4.0.1 +black==23.3.0 +boto3==1.26.142 +botocore==1.29.142 +brotli==1.0.9 +build==0.10.0 +cachetools==5.3.1 +cattrs==22.2.0 +cerberus==1.3.4 +certifi==2023.5.7 +cffi==1.15.1 +chardet==5.1.0 +charset-normalizer==3.1.0 +cheroot==10.0.0 +cherrypy==18.8.0 +click==8.1.3 +colorama==0.4.6 +coverage==7.2.7 +cryptography==40.0.2 +deepdiff==6.3.0 +defusedxml==0.7.1 +deprecated==1.2.14 +dill==0.3.6 +distlib==0.3.6 +fastjsonschema==2.16.3 +filelock==3.12.0 +flake8==6.0.0 +frozendict==2.3.8 +frozenlist==1.3.3 +google-api-core==2.11.0 +google-api-python-client==2.87.0 +google-auth==2.19.0 +google-auth-httplib2==0.1.0 +googleapis-common-protos==1.59.0 +httplib2==0.22.0 +idna==3.4 +inflect==6.0.4 +isort==5.12.0 +jaraco-collections==4.1.0 +jaraco-context==4.3.0 +jaraco-functools==3.7.0 +jaraco-text==3.11.1 +jinja2==3.1.2 +jmespath==1.0.1 +jq==1.4.1 +jsons==1.6.3 +kubernetes==26.1.0 +lazy-object-proxy==1.9.0 +markdown-it-py==2.2.0 +markupsafe==2.1.2 +mccabe==0.7.0 +mdurl==0.1.2 +monotonic==1.6 +more-itertools==9.1.0 +multidict==6.0.4 +mypy==1.3.0 +mypy-extensions==1.0.0 +networkx==3.1 +oauth2client==4.1.3 +oauthlib==3.2.2 +onelogin==2.0.4 +ordered-set==4.1.0 +packaging==23.1 +paramiko==3.2.0 +parsy==2.1 +pathspec==0.11.1 +pep8-naming==0.13.3 +pint==0.22 +pip==23.1.2 +pip-tools==6.13.0 +plantuml==0.3.0 +platformdirs==3.5.1 +pluggy==1.0.0 +portend==3.1.0 +posthog==3.0.1 +prometheus-client==0.17.0 +prompt-toolkit==3.0.38 +protobuf==4.23.2 +psutil==5.9.5 +pyasn1==0.5.0 +pyasn1-modules==0.3.0 +pycares==4.3.0 +pycodestyle==2.10.0 +pycparser==2.21 +pydantic==1.10.8 +pyflakes==3.0.1 +pygithub==1.58.2 +pygments==2.15.1 +pyjwt[crypto]==2.7.0 +pylint==2.17.4 +pynacl==1.5.0 +pyparsing==3.0.9 +pyproject-api==1.5.1 +pyproject-hooks==1.0.0 +python-arango==7.5.7 +python-dateutil==2.8.2 +pytz==2023.3 +pyvmomi==8.0.1.0.1 +pyyaml==6.0 +requests==2.31.0 +requests-oauthlib==1.3.1 +requests-toolbelt==1.0.0 +resotoclient==1.4.1 +resotoui==3.5.0 +retrying==1.3.4 +rfc3339-validator==0.1.4 +rich==13.3.5 +rsa==4.9 +s3transfer==0.6.1 +setuptools==67.8.0 +six==1.16.0 +slack-sdk==3.21.3 +tempora==5.2.2 +tenacity==8.2.2 +toml==0.10.2 +tomlkit==0.11.8 +toolz==0.12.0 +tox==4.5.2 +transitions==0.9.0 +typeguard==4.0.0 +typing-extensions==4.6.2 +typish==1.9.3 +tzdata==2023.3 +tzlocal==5.0.1 +uritemplate==4.1.1 +urllib3==1.26.16 +ustache==0.1.5 +virtualenv==20.23.0 +wcwidth==0.2.6 +websocket-client==1.5.2 +wheel==0.40.0 +wrapt==1.15.0 +yarl==1.9.2 +zc-lockfile==3.0.post1 diff --git a/requirements-test.txt b/requirements-test.txt new file mode 100644 index 000000000..dae61a866 --- /dev/null +++ b/requirements-test.txt @@ -0,0 +1,149 @@ +aiodns==3.0.0 +aiofiles==23.1.0 +aiohttp[speedups]==3.8.4 +aiohttp-jinja2==1.5.1 +aiohttp-swagger3==0.7.4 +aiosignal==1.3.1 +aiostream==0.4.5 +apscheduler==3.10.1 +astroid==2.15.5 +async-timeout==4.0.2 +attrs==23.1.0 +autocommand==2.2.2 +backoff==2.2.1 +bcrypt==4.0.1 +black==23.3.0 +boto3==1.26.142 +botocore==1.29.142 +brotli==1.0.9 +cachetools==5.3.1 +cattrs==22.2.0 +cerberus==1.3.4 +certifi==2023.5.7 +cffi==1.15.1 +chardet==5.1.0 +charset-normalizer==3.1.0 +cheroot==10.0.0 +cherrypy==18.8.0 +click==8.1.3 +colorama==0.4.6 +coverage[toml]==7.2.7 +cryptography==40.0.2 +deepdiff==6.3.0 +defusedxml==0.7.1 +deprecated==1.2.14 +dill==0.3.6 +distlib==0.3.6 +fastjsonschema==2.16.3 +filelock==3.12.0 +flake8==6.0.0 +frozendict==2.3.8 +frozenlist==1.3.3 +google-api-core==2.11.0 +google-api-python-client==2.87.0 +google-auth==2.19.0 +google-auth-httplib2==0.1.0 +googleapis-common-protos==1.59.0 +httplib2==0.22.0 +hypothesis==6.75.6 +idna==3.4 +inflect==6.0.4 +iniconfig==2.0.0 +isort==5.12.0 +jaraco-collections==4.1.0 +jaraco-context==4.3.0 +jaraco-functools==3.7.0 +jaraco-text==3.11.1 +jinja2==3.1.2 +jmespath==1.0.1 +jq==1.4.1 +jsons==1.6.3 +kubernetes==26.1.0 +lazy-object-proxy==1.9.0 +markdown-it-py==2.2.0 +markupsafe==2.1.2 +mccabe==0.7.0 +mdurl==0.1.2 +monotonic==1.6 +more-itertools==9.1.0 +multidict==6.0.4 +mypy==1.3.0 +mypy-extensions==1.0.0 +networkx==3.1 +oauth2client==4.1.3 +oauthlib==3.2.2 +onelogin==2.0.4 +ordered-set==4.1.0 +packaging==23.1 +paramiko==3.2.0 +parsy==2.1 +pathspec==0.11.1 +pep8-naming==0.13.3 +pint==0.22 +plantuml==0.3.0 +platformdirs==3.5.1 +pluggy==1.0.0 +portend==3.1.0 +posthog==3.0.1 +prometheus-client==0.17.0 +prompt-toolkit==3.0.38 +protobuf==4.23.2 +psutil==5.9.5 +pyasn1==0.5.0 +pyasn1-modules==0.3.0 +pycares==4.3.0 +pycodestyle==2.10.0 +pycparser==2.21 +pydantic==1.10.8 +pyflakes==3.0.1 +pygithub==1.58.2 +pygments==2.15.1 +pyjwt[crypto]==2.7.0 +pylint==2.17.4 +pynacl==1.5.0 +pyparsing==3.0.9 +pyproject-api==1.5.1 +pytest==7.3.1 +pytest-asyncio==0.21.0 +pytest-cov==4.1.0 +pytest-runner==6.0.0 +python-arango==7.5.7 +python-dateutil==2.8.2 +pytz==2023.3 +pyvmomi==8.0.1.0.1 +pyyaml==6.0 +requests==2.31.0 +requests-oauthlib==1.3.1 +requests-toolbelt==1.0.0 +resotoclient==1.4.1 +resotoui==3.5.0 +retrying==1.3.4 +rfc3339-validator==0.1.4 +rich==13.3.5 +rsa==4.9 +s3transfer==0.6.1 +setuptools==67.8.0 +six==1.16.0 +slack-sdk==3.21.3 +sortedcontainers==2.4.0 +tempora==5.2.2 +tenacity==8.2.2 +tomlkit==0.11.8 +toolz==0.12.0 +tox==4.5.2 +transitions==0.9.0 +typeguard==4.0.0 +typing-extensions==4.6.2 +typish==1.9.3 +tzdata==2023.3 +tzlocal==5.0.1 +uritemplate==4.1.1 +urllib3==1.26.16 +ustache==0.1.5 +virtualenv==20.23.0 +wcwidth==0.2.6 +websocket-client==1.5.2 +wheel==0.40.0 +wrapt==1.15.0 +yarl==1.9.2 +zc-lockfile==3.0.post1 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..66f3f60e0 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,114 @@ +aiodns==3.0.0 +aiofiles==23.1.0 +aiohttp[speedups]==3.8.4 +aiohttp-jinja2==1.5.1 +aiohttp-swagger3==0.7.4 +aiosignal==1.3.1 +aiostream==0.4.5 +apscheduler==3.10.1 +async-timeout==4.0.2 +attrs==23.1.0 +autocommand==2.2.2 +backoff==2.2.1 +bcrypt==4.0.1 +boto3==1.26.142 +botocore==1.29.142 +brotli==1.0.9 +cachetools==5.3.1 +cattrs==22.2.0 +cerberus==1.3.4 +certifi==2023.5.7 +cffi==1.15.1 +charset-normalizer==3.1.0 +cheroot==10.0.0 +cherrypy==18.8.0 +cryptography==40.0.2 +deepdiff==6.3.0 +defusedxml==0.7.1 +deprecated==1.2.14 +fastjsonschema==2.16.3 +frozendict==2.3.8 +frozenlist==1.3.3 +google-api-core==2.11.0 +google-api-python-client==2.87.0 +google-auth==2.19.0 +google-auth-httplib2==0.1.0 +googleapis-common-protos==1.59.0 +httplib2==0.22.0 +idna==3.4 +inflect==6.0.4 +jaraco-collections==4.1.0 +jaraco-context==4.3.0 +jaraco-functools==3.7.0 +jaraco-text==3.11.1 +jinja2==3.1.2 +jmespath==1.0.1 +jq==1.4.1 +jsons==1.6.3 +kubernetes==26.1.0 +markdown-it-py==2.2.0 +markupsafe==2.1.2 +mdurl==0.1.2 +monotonic==1.6 +more-itertools==9.1.0 +multidict==6.0.4 +networkx==3.1 +oauth2client==4.1.3 +oauthlib==3.2.2 +onelogin==2.0.4 +ordered-set==4.1.0 +paramiko==3.2.0 +parsy==2.1 +pint==0.22 +plantuml==0.3.0 +portend==3.1.0 +posthog==3.0.1 +prometheus-client==0.17.0 +prompt-toolkit==3.0.38 +protobuf==4.23.2 +psutil==5.9.5 +pyasn1==0.5.0 +pyasn1-modules==0.3.0 +pycares==4.3.0 +pycparser==2.21 +pydantic==1.10.8 +pygithub==1.58.2 +pygments==2.15.1 +pyjwt[crypto]==2.7.0 +pynacl==1.5.0 +pyparsing==3.0.9 +python-arango==7.5.7 +python-dateutil==2.8.2 +pytz==2023.3 +pyvmomi==8.0.1.0.1 +pyyaml==6.0 +requests==2.31.0 +requests-oauthlib==1.3.1 +requests-toolbelt==1.0.0 +resotoclient==1.4.1 +resotoui==3.5.0 +retrying==1.3.4 +rfc3339-validator==0.1.4 +rich==13.3.5 +rsa==4.9 +s3transfer==0.6.1 +setuptools==67.8.0 +six==1.16.0 +slack-sdk==3.21.3 +tempora==5.2.2 +tenacity==8.2.2 +toolz==0.12.0 +transitions==0.9.0 +typeguard==4.0.0 +typing-extensions==4.6.2 +typish==1.9.3 +tzdata==2023.3 +tzlocal==5.0.1 +uritemplate==4.1.1 +urllib3==1.26.16 +ustache==0.1.5 +wcwidth==0.2.6 +websocket-client==1.5.2 +wrapt==1.15.0 +yarl==1.9.2 +zc-lockfile==3.0.post1 diff --git a/resotocore/MANIFEST.in b/resotocore/MANIFEST.in index e9fdca40a..99c2bda6c 100644 --- a/resotocore/MANIFEST.in +++ b/resotocore/MANIFEST.in @@ -1,7 +1,4 @@ include README.md -include requirements-dev.txt -include requirements-test.txt -include requirements.txt recursive-include resotocore/static * recursive-include resotocore/templates * recursive-include resotocore/jupyterlite * diff --git a/resotocore/Makefile b/resotocore/Makefile index b83b2c7a4..b3c4e4521 100644 --- a/resotocore/Makefile +++ b/resotocore/Makefile @@ -74,14 +74,6 @@ coverage: ## check code coverage quickly with the default Python coverage html $(BROWSER) htmlcov/index.html -venv-pypy: - pypy3.9 -m venv venv-pypy - . ./venv-pypy/bin/activate && python3 -m pip install --upgrade pip - . ./venv-pypy/bin/activate && pip install --upgrade --editable ../resotolib - . ./venv-pypy/bin/activate && pip install -r requirements-test.txt - . ./venv-pypy/bin/activate && pip install -r requirements.txt - - setup: clean clean-env venv-pypy list-outdated: diff --git a/resotocore/pyproject.toml b/resotocore/pyproject.toml new file mode 100644 index 000000000..bdc0cf5f9 --- /dev/null +++ b/resotocore/pyproject.toml @@ -0,0 +1,65 @@ +[project] +name = "resotocore" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +description = "Keeps all the things." +license = {file="LICENSE"} +urls = {"Homepage" = "https://resoto.com"} +requires-python = ">=3.9" +classifiers = [ "Programming Language :: Python :: 3" ] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "APScheduler", + "Cerberus", + "Jinja2", + "aiofiles", + "aiohttp-jinja2", + "aiohttp-swagger3", + "aiohttp[speedups]", + "aiostream", + "cryptography", + "deepdiff", + "frozendict", + "jq", + "jsons", + "parsy", + "plantuml", + "posthog", + "python-arango", + "python-dateutil", + "resotoui", + "rich", + "toolz", + "transitions", + "tzlocal", + "ustache", +] + +[project.optional-dependencies] +dev = [ + "mypy", + "flake8", + "pep8-naming", + "tox", + "coverage", + "pylint", + "black", + "toml", + "pip-tools", +] +test = [ + "pytest", + "pytest-cov", + "pytest-asyncio", + "hypothesis", + "resotoclient", +] + +[project.scripts] +resotocore = "resotocore.__main__:main" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + diff --git a/resotocore/requirements-dev.txt b/resotocore/requirements-dev.txt deleted file mode 100644 index 5d8b6298e..000000000 --- a/resotocore/requirements-dev.txt +++ /dev/null @@ -1,10 +0,0 @@ -# dev dependencies -mypy==1.3.0 -wheel==0.40.0 -flake8==6.0.0 -pep8-naming==0.13.3 -tox==4.5.1 -coverage==7.2.6 -pylint==2.17.4 -black==23.3.0 -build==0.10.0 diff --git a/resotocore/requirements-test.txt b/resotocore/requirements-test.txt deleted file mode 100644 index a51532814..000000000 --- a/resotocore/requirements-test.txt +++ /dev/null @@ -1,7 +0,0 @@ -# test dependencies -pytest==7.3.1 -pytest-cov==4.0.0 -pytest-runner==6.0.0 -pytest-asyncio==0.21.0 -hypothesis==6.75.3 -resotoclient==1.4.1 diff --git a/resotocore/requirements.txt b/resotocore/requirements.txt deleted file mode 100644 index 052656946..000000000 --- a/resotocore/requirements.txt +++ /dev/null @@ -1,28 +0,0 @@ -# Only list production dependencies. Everything else can be added to requirements-test.txt and requirements-dev.txt. - -aiohttp-swagger3==0.7.4 -aiohttp[speedups]==3.8.4 -aiohttp-jinja2==1.5.1 -jsons==1.6.3 -parsy==2.1 -plantuml==0.3.0 -python-arango==7.5.7 -python-dateutil==2.8.2 -toolz==0.12.0 -transitions==0.9.0 -APScheduler==3.10.1 -aiostream==0.4.5 -tzlocal==5.0.1 -frozendict==2.3.8 -resotolib==3.5.0 -jq==1.4.1 -posthog==3.0.1 -ustache==0.1.5 -aiofiles==23.1.0 -cryptography==40.0.2 -rich==13.3.5 -Cerberus~=1.3.4 -setuptools>=67.8.0 # not directly required, pinned by Snyk to avoid a vulnerability -resotoui==3.5.0 -deepdiff==6.3.0 -Jinja2==3.1.2 diff --git a/resotocore/setup.cfg b/resotocore/setup.cfg index 0ce084647..67327cd5c 100644 --- a/resotocore/setup.cfg +++ b/resotocore/setup.cfg @@ -1,18 +1,9 @@ -[bumpversion] -current_version = 0.1.0 -commit = True -tag = True -[bumpversion:file:setup.py] -search = version='{current_version}' -replace = version='{new_version}' - -[bumpversion:file:resotocore/__init__.py] -search = __version__ = '{current_version}' -replace = __version__ = '{new_version}' - -[bdist_wheel] -universal = 1 +[options] +packages = find: +include_package_data = True +# we use __file__ --> move to pkg_resources.resource_stream +zip_safe = False [flake8] max-line-length = 120 @@ -20,11 +11,6 @@ exclude = .git,.tox,__pycache__,.idea,.pytest_cache,docs application-import-names = resotocore tests ignore = N818, W503, E203 - -[aliases] -# Define setup.py command aliases here -test = pytest - [tool:pytest] #collect_ignore = ['setup.py'] #log_format = %(asctime)s [%(levelname)s] %(message)s [%(name)s:%(lineno)d] diff --git a/resotocore/setup.py b/resotocore/setup.py deleted file mode 100644 index a573ddffc..000000000 --- a/resotocore/setup.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python - -"""The setup script.""" - -from setuptools import setup, find_packages -from setuptools.command.develop import develop -from subprocess import check_call -import os -import pkg_resources - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -def read_requirements(fname): - return [str(requirement) for requirement in pkg_resources.parse_requirements(read(fname))] - - -setup_requirements = ["pytest-runner"] - - -class PostDevelopCommand(develop): - """Post-installation for development mode.""" - - def run(self): - develop.run(self) - - import sys - - is_pypy = "__pypy__" in sys.builtin_module_names - if not is_pypy: - import pip - - pip.main(["install", "-r", "requirements-jupyterlite.txt"]) - check_call(["jupyter", "lite", "build", "--config", "jupyter_lite_config.json"]) - - -setup( - name="resotocore", - version="3.5.0", - description="Keeps all the things.", - python_requires=">=3.5", - classifiers=["Programming Language :: Python :: 3"], - entry_points={"console_scripts": ["resotocore=resotocore.__main__:main"]}, - install_requires=read_requirements("requirements.txt"), - license="Apache Software License 2.0", - long_description=read("README.md"), - long_description_content_type="text/markdown", - include_package_data=True, - packages=find_packages(include=["resotocore", "resotocore.*"]), - setup_requires=setup_requirements, - test_suite="tests", - tests_require=read_requirements("requirements-dev.txt") + read_requirements("requirements-test.txt"), - url="https://github.com/someengineering/resoto/tree/main/resotocore", - cmdclass={ - "develop": PostDevelopCommand, - }, -) diff --git a/resotocore/tests/resotocore/query/model_test.py b/resotocore/tests/resotocore/query/model_test.py index 08a9abed5..4775e907f 100644 --- a/resotocore/tests/resotocore/query/model_test.py +++ b/resotocore/tests/resotocore/query/model_test.py @@ -317,6 +317,6 @@ def test_merge_term_combination() -> None: @given(query) -@settings(max_examples=30, suppress_health_check=HealthCheck.all()) +@settings(max_examples=200, suppress_health_check=HealthCheck.all()) def test_generated_query(q: Query) -> None: assert q.structure() diff --git a/resotocore/tests/resotocore/query/query_parser_test.py b/resotocore/tests/resotocore/query/query_parser_test.py index 119614b1f..c5444fb2d 100644 --- a/resotocore/tests/resotocore/query/query_parser_test.py +++ b/resotocore/tests/resotocore/query/query_parser_test.py @@ -333,7 +333,7 @@ def test_special_cases() -> None: @given(query) -@settings(max_examples=50, suppress_health_check=HealthCheck.all()) +@settings(max_examples=200, suppress_health_check=HealthCheck.all()) def test_generated_query(q: Query) -> None: assert str(q) == str(parse_query(str(q))) diff --git a/resotocore/tox.ini b/resotocore/tox.ini index db19eee81..fcefc6e7d 100644 --- a/resotocore/tox.ini +++ b/resotocore/tox.ini @@ -9,9 +9,10 @@ asyncio_mode= auto usedevelop = true deps = --editable=file:///{toxinidir}/../resotolib - -rrequirements-dev.txt - -rrequirements-test.txt - -rrequirements.txt + -r../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:black] commands = black --line-length 120 --check --diff --target-version py39 . diff --git a/resotolib/MANIFEST.in b/resotolib/MANIFEST.in index 96d27d10e..4df0c482b 100644 --- a/resotolib/MANIFEST.in +++ b/resotolib/MANIFEST.in @@ -1,4 +1,2 @@ include README.md -include requirements.txt -include requirements-test.txt include resotolib/web/static/* diff --git a/resotolib/pyproject.toml b/resotolib/pyproject.toml new file mode 100644 index 000000000..468a45312 --- /dev/null +++ b/resotolib/pyproject.toml @@ -0,0 +1,78 @@ +[project] +name = "resotolib" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +description = "Resoto common library." +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} +keywords = ["cloud security"] + +dependencies = [ + "CherryPy", + "Pint", + "PyJWT", + "PyYAML", + "aiohttp[speedups]", + "attrs", + "cattrs", + "cryptography", + "jsons", + "networkx", + "parsy", + "prometheus-client", + "psutil", + "requests", + "typeguard", + "tzdata", + "tzlocal", + "websocket-client", +] + +[project.optional-dependencies] +test = [ + "black", + "coverage", + "flake8", + "hypothesis", + "mypy", + "pep8-naming", + "pylint", + "pytest", + "pytest-asyncio", + "pytest-cov", + "pytest-runner", + "tox", + "wheel", +] + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/resotolib" + +[tool.setuptools.package-data] +resotolib = ["py.typed"] + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + diff --git a/resotolib/requirements-test.txt b/resotolib/requirements-test.txt deleted file mode 100644 index f2b0af3fa..000000000 --- a/resotolib/requirements-test.txt +++ /dev/null @@ -1,13 +0,0 @@ -wheel==0.40.0 -flake8==6.0.0 -pep8-naming==0.13.3 -tox==4.5.1 -coverage==7.2.6 -pylint==2.17.4 -black==23.3.0 -pytest==7.3.1 -pytest-cov==4.0.0 -pytest-runner==6.0.0 -mypy==1.3.0 -pytest-asyncio==0.21.0 -hypothesis==6.75.3 diff --git a/resotolib/requirements.txt b/resotolib/requirements.txt deleted file mode 100644 index 8b2583584..000000000 --- a/resotolib/requirements.txt +++ /dev/null @@ -1,19 +0,0 @@ -networkx==3.1 -jsons==1.6.3 -typeguard==4.0.0 -websocket-client==1.5.2 -psutil==5.9.5 -requests==2.31.0 -prometheus-client==0.16.0 -PyJWT==2.7.0 -CherryPy==18.8.0 -cryptography==40.0.2 -aiohttp[speedups]==3.8.4 -Pint==0.21 -parsy==2.1 -tzlocal==5.0.1 -tzdata==2023.3 -cattrs==22.2.0 -attrs==23.1.0 -setuptools>=67.6.1 # always allow latest version -PyYAML==6.0 diff --git a/resotolib/resotolib/baseplugin.py b/resotolib/resotolib/baseplugin.py index a37e1fb6e..5e420ca5d 100644 --- a/resotolib/resotolib/baseplugin.py +++ b/resotolib/resotolib/baseplugin.py @@ -236,7 +236,7 @@ def pre_cleanup(config: Config, resource: BaseResource, graph: Graph) -> bool: @staticmethod def cleanup(config: Config, resource: BaseResource, graph: Graph) -> bool: - return resource.cleanup(graph) # type: ignore + return resource.cleanup(graph) def go(self) -> None: self.collect() diff --git a/resotolib/resotolib/baseresources.py b/resotolib/resotolib/baseresources.py index f7f8ecaf0..2b8e707be 100644 --- a/resotolib/resotolib/baseresources.py +++ b/resotolib/resotolib/baseresources.py @@ -388,7 +388,7 @@ def protected(self, value: bool) -> None: # deprecated. future collectors plugins should be responsible for running pre_cleanup # and calling delete_resource on resources - @metrics_resource_cleanup.time() # type: ignore + @metrics_resource_cleanup.time() @unless_protected def cleanup(self, graph: Optional[Any] = None) -> bool: if self.phantom: diff --git a/resotolib/resotolib/graph/__init__.py b/resotolib/resotolib/graph/__init__.py index 4a5412a7b..6a6892dd7 100644 --- a/resotolib/resotolib/graph/__init__.py +++ b/resotolib/resotolib/graph/__init__.py @@ -277,7 +277,7 @@ def find_cycle(self) -> Optional[List[EdgeKey]]: return [edge[2] for edge in networkx.algorithms.cycles.find_cycle(typed_graph)] return None - @metrics_graph_search.time() # type: ignore + @metrics_graph_search.time() def search(self, attr: str, value: Any, regex_search: bool = False) -> Iterator[BaseResource]: """Search for graph nodes by their attribute value""" if value is None: @@ -296,20 +296,20 @@ def search(self, attr: str, value: Any, regex_search: bool = False) -> Iterator[ ): yield node - @metrics_graph_searchre.time() # type: ignore + @metrics_graph_searchre.time() def searchre(self, attr: str, regex: str) -> Iterator[BaseResource]: """Regex search for graph nodes by their attribute value""" log.debug(f"Regex searching graph for nodes with attribute values {attr}: {regex}") yield from self.search(attr, regex, regex_search=True) - @metrics_graph_searchall.time() # type: ignore + @metrics_graph_searchall.time() def searchall(self, match: Dict[str, Any]) -> Iterator[BaseResource]: """Search for graph nodes by multiple attributes and values""" for node in self.nodes(): if all(getattr(node, attr, None) == value for attr, value in match.items()): yield node - @metrics_graph_search_first.time() # type: ignore + @metrics_graph_search_first.time() def search_first(self, attr: str, value: Any) -> Optional[BaseResource]: """Return the first graph node that matches a certain attribute value""" node = next(iter(self.search(attr, value)), None) @@ -317,9 +317,9 @@ def search_first(self, attr: str, value: Any) -> Optional[BaseResource]: log.debug(f"Found node {node} with {attr}: {value}") else: log.debug(f"Found no node with {attr}: {value}") - return node # type: ignore + return node # type - @metrics_graph_search_first_all.time() # type: ignore + @metrics_graph_search_first_all.time() def search_first_all(self, match: Dict[str, Any]) -> Optional[BaseResource]: """Return the first graph node that matches multiple attributes and values""" node = next(iter(self.searchall(match)), None) @@ -327,9 +327,9 @@ def search_first_all(self, match: Dict[str, Any]) -> Optional[BaseResource]: log.debug(f"Found node {node} with {match}") else: log.debug(f"Found no node with {match}") - return node # type: ignore + return node - @metrics_graph_search_first_parent_class.time() # type: ignore + @metrics_graph_search_first_parent_class.time() def search_first_parent_class(self, node: BaseResource, cls: Type[T]) -> Optional[T]: """Return the first parent node matching a certain class @@ -348,7 +348,7 @@ def search_first_parent_class(self, node: BaseResource, cls: Type[T]) -> Optiona queue.append(n) return None - @metrics_graph_resolve_deferred_connections.time() # type: ignore + @metrics_graph_resolve_deferred_connections.time() def resolve_deferred_connections(self) -> None: log.debug("Resolving deferred graph connections") for node in self.nodes: diff --git a/resotolib/resotolib/units.py b/resotolib/resotolib/units.py index 22e02c259..08fb20c4b 100644 --- a/resotolib/resotolib/units.py +++ b/resotolib/resotolib/units.py @@ -1,21 +1,20 @@ import pint -from pint.facets.plain import PlainUnit, PlainQuantity reg = pint.UnitRegistry() # Xi bytes are not known to pint -reg.define("Ei = 1 EiB") # type: ignore -reg.define("Pi = 1 PiB") # type: ignore -reg.define("Ti = 1 TiB") # type: ignore -reg.define("Gi = 1 GiB") # type: ignore -reg.define("Mi = 1 MiB") # type: ignore -reg.define("Ki = 1 KiB") # type: ignore -reg.define("KB = 1000 B") # type: ignore +reg.define("Ei = 1 EiB") +reg.define("Pi = 1 PiB") +reg.define("Ti = 1 TiB") +reg.define("Gi = 1 GiB") +reg.define("Mi = 1 MiB") +reg.define("Ki = 1 KiB") +reg.define("KB = 1000 B") # globally define or register units -bytes_u: PlainUnit = reg.byte +bytes_u: pint.Quantity = reg.byte -def parse(s: str) -> PlainQuantity[PlainUnit]: +def parse(s: str) -> pint.Quantity: return reg.parse_expression(s) diff --git a/resotolib/setup.cfg b/resotolib/setup.cfg index c8c6eac54..00c7925e0 100644 --- a/resotolib/setup.cfg +++ b/resotolib/setup.cfg @@ -1,3 +1,8 @@ +[options] +include_package_data = True +# we use __file__ --> move to pkg_resources.resource_stream +zip_safe = False + [aliases] test=pytest diff --git a/resotolib/setup.py b/resotolib/setup.py deleted file mode 100644 index c3f323435..000000000 --- a/resotolib/setup.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import resotolib -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name=resotolib.__title__, - version=resotolib.__version__, - description=resotolib.__description__, - license=resotolib.__license__, - packages=find_packages(), - package_data={"resotolib": ["py.typed"]}, - long_description=read("README.md"), - long_description_content_type="text/markdown", - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/resotolib", -) diff --git a/resotolib/tox.ini b/resotolib/tox.ini index a272562ec..3ade9d607 100644 --- a/resotolib/tox.ini +++ b/resotolib/tox.ini @@ -13,8 +13,10 @@ asyncio_mode= auto [testenv] usedevelop = true deps = - -rrequirements.txt - -rrequirements-test.txt + -r../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/resotometrics/MANIFEST.in b/resotometrics/MANIFEST.in index e0cdbee5d..6847328b0 100644 --- a/resotometrics/MANIFEST.in +++ b/resotometrics/MANIFEST.in @@ -1,3 +1,2 @@ include README.md -include requirements.txt include resotometrics/default_metrics.yaml diff --git a/resotometrics/pyproject.toml b/resotometrics/pyproject.toml new file mode 100644 index 000000000..af97c6dc5 --- /dev/null +++ b/resotometrics/pyproject.toml @@ -0,0 +1,46 @@ +[project] +name = "resotometrics" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +description = "Exports Resoto metrics in Prometheus format." +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0" +] + +[pyproject.optional-dependencies] +test = ["pytest"] + +[project.scripts] +resotometrics = "resotometrics.__main__:main" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/resotometrics" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + diff --git a/resotometrics/requirements.txt b/resotometrics/requirements.txt deleted file mode 100644 index 5cda6053d..000000000 --- a/resotometrics/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -resotolib==3.5.0 diff --git a/resotometrics/setup.cfg b/resotometrics/setup.cfg index b7e478982..7ca653793 100644 --- a/resotometrics/setup.cfg +++ b/resotometrics/setup.cfg @@ -1,2 +1,7 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/resotometrics/setup.py b/resotometrics/setup.py deleted file mode 100644 index a86b8f5a5..000000000 --- a/resotometrics/setup.py +++ /dev/null @@ -1,51 +0,0 @@ -import os -import pkg_resources -import resotometrics -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name=resotometrics.__title__, - version=resotometrics.__version__, - description=resotometrics.__description__, - license=resotometrics.__license__, - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={ - "console_scripts": [ - "resotometrics = resotometrics.__main__:main", - ] - }, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/resotometrics", -) diff --git a/resotometrics/tox.ini b/resotometrics/tox.ini index 6f1a652c1..ad1364186 100644 --- a/resotometrics/tox.ini +++ b/resotometrics/tox.ini @@ -14,8 +14,10 @@ testpaths= test usedevelop = true deps = --editable=file:///{toxinidir}/../resotolib - -rrequirements.txt - -r../resotolib/requirements-test.txt + -r../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/resotoshell/MANIFEST.in b/resotoshell/MANIFEST.in index 8afbefe8d..bb3ec5f0d 100644 --- a/resotoshell/MANIFEST.in +++ b/resotoshell/MANIFEST.in @@ -1,2 +1 @@ include README.md -include requirements.txt diff --git a/resotoshell/pyproject.toml b/resotoshell/pyproject.toml new file mode 100644 index 000000000..80045bb33 --- /dev/null +++ b/resotoshell/pyproject.toml @@ -0,0 +1,48 @@ +[project] +name = "resotoshell" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +description = "Commandline interpreter to interact with Resoto." +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ + # Current project status + "Development Status :: 4 - Beta", + # Audience + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + # License information + "License :: OSI Approved :: Apache Software License", + # Supported python versions + "Programming Language :: Python :: 3.9", + # Supported OS's + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + # Extra metadata + "Environment :: Console", + "Natural Language :: English", + "Topic :: Security", + "Topic :: Utilities", +] +readme = {file="README.md", content-type="text/markdown"} +keywords = ["cloud security"] + +dependencies = [ + "resotolib==3.5.0", + "prompt-toolkit", + "rich", + "resotoclient", + "aiohttp[speedups]", +] + +[project.scripts] +resh = "resotoshell.__main__:main" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/resotoshell" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + diff --git a/resotoshell/requirements.txt b/resotoshell/requirements.txt deleted file mode 100644 index f9841fefa..000000000 --- a/resotoshell/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -prompt-toolkit==3.0.38 -rich==13.3.5 -resotolib==3.5.0 -resotoclient==1.4.1 -aiohttp[speedups]==3.8.4 - diff --git a/resotoshell/setup.cfg b/resotoshell/setup.cfg index fe8fb4a76..aad70171a 100644 --- a/resotoshell/setup.cfg +++ b/resotoshell/setup.cfg @@ -1,3 +1,8 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/resotoshell/setup.py b/resotoshell/setup.py deleted file mode 100644 index a9190e54d..000000000 --- a/resotoshell/setup.py +++ /dev/null @@ -1,51 +0,0 @@ -import os -import pkg_resources -import resotoshell -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name=resotoshell.__title__, - version=resotoshell.__version__, - description=resotoshell.__description__, - license=resotoshell.__license__, - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={ - "console_scripts": [ - "resh = resotoshell.__main__:main", - ] - }, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/resotoshell", -) diff --git a/resotoshell/tox.ini b/resotoshell/tox.ini index 2b1acab54..376ec497b 100644 --- a/resotoshell/tox.ini +++ b/resotoshell/tox.ini @@ -14,8 +14,10 @@ asyncio_mode= auto usedevelop = true deps = --editable=file:///{toxinidir}/../resotolib - -rrequirements.txt - -r../resotolib/requirements-test.txt + -r../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/resotoworker/MANIFEST.in b/resotoworker/MANIFEST.in index 8afbefe8d..bb3ec5f0d 100644 --- a/resotoworker/MANIFEST.in +++ b/resotoworker/MANIFEST.in @@ -1,2 +1 @@ include README.md -include requirements.txt diff --git a/resotoworker/pyproject.toml b/resotoworker/pyproject.toml new file mode 100644 index 000000000..204904345 --- /dev/null +++ b/resotoworker/pyproject.toml @@ -0,0 +1,27 @@ +[project] +name = "resotoworker" +version = "3.5.0" +authors = [{name="Some Engineering Inc."}] +description = "Runs collector plugins and sends the result to resotocore." +license = {file="LICENSE"} +requires-python = ">=3.9" +classifiers = [ "Programming Language :: Python :: 3" ] +readme = {file="README.md", content-type="text/markdown"} + +dependencies = [ + "resotolib==3.5.0", + "tenacity", + "CherryPy", +] + +[project.scripts] +resotoworker = "resotoworker.__main__:main" + +[project.urls] +Documentation = "https://resoto.com" +Source = "https://github.com/someengineering/resoto/tree/main/resotoworker" + +[build-system] +requires = ["setuptools>=67.8.0", "wheel>=0.40.0", "build>=0.10.0"] +build-backend = "setuptools.build_meta" + diff --git a/resotoworker/requirements.txt b/resotoworker/requirements.txt deleted file mode 100644 index 9ab2098bf..000000000 --- a/resotoworker/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -resotolib==3.5.0 -tenacity==8.2.2 -CherryPy==18.8.0 -setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability diff --git a/resotoworker/resotoworker/cleanup.py b/resotoworker/resotoworker/cleanup.py index 590f1f7d6..5965c658f 100644 --- a/resotoworker/resotoworker/cleanup.py +++ b/resotoworker/resotoworker/cleanup.py @@ -50,7 +50,7 @@ def __init__(self, graph: Graph, feedback: CoreFeedback) -> None: self.graph = graph self.feedback = feedback - @metrics_cleanup.time() # type: ignore + @metrics_cleanup.time() def cleanup(self, config: Config, plugins: Dict[str, Type[BaseCollectorPlugin]]) -> None: if not Config.resotoworker.cleanup: log.debug("Cleanup called but resotoworker.cleanup not configured" " - ignoring call") diff --git a/resotoworker/setup.cfg b/resotoworker/setup.cfg index b7e478982..7ca653793 100644 --- a/resotoworker/setup.cfg +++ b/resotoworker/setup.cfg @@ -1,2 +1,7 @@ +[options] +packages = find: +include_package_data = True +zip_safe = False + [aliases] test=pytest diff --git a/resotoworker/setup.py b/resotoworker/setup.py deleted file mode 100644 index f17812215..000000000 --- a/resotoworker/setup.py +++ /dev/null @@ -1,51 +0,0 @@ -import resotoworker -import os -import pkg_resources -from setuptools import setup, find_packages - - -def read(file_name: str) -> str: - with open(os.path.join(os.path.dirname(__file__), file_name)) as of: - return of.read() - - -setup( - name=resotoworker.__title__, - version=resotoworker.__version__, - description=resotoworker.__description__, - license=resotoworker.__license__, - packages=find_packages(), - long_description=read("README.md"), - long_description_content_type="text/markdown", - entry_points={ - "console_scripts": [ - "resotoworker = resotoworker.__main__:main", - ] - }, - include_package_data=True, - zip_safe=False, - install_requires=[str(requirement) for requirement in pkg_resources.parse_requirements(read("requirements.txt"))], - setup_requires=["pytest-runner"], - tests_require=["pytest"], - classifiers=[ - # Current project status - "Development Status :: 4 - Beta", - # Audience - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - # License information - "License :: OSI Approved :: Apache Software License", - # Supported python versions - "Programming Language :: Python :: 3.9", - # Supported OS's - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - # Extra metadata - "Environment :: Console", - "Natural Language :: English", - "Topic :: Security", - "Topic :: Utilities", - ], - keywords="cloud security", - url="https://github.com/someengineering/resoto/tree/main/resotoworker", -) diff --git a/resotoworker/tox.ini b/resotoworker/tox.ini index 9975c4dbc..44987df40 100644 --- a/resotoworker/tox.ini +++ b/resotoworker/tox.ini @@ -14,8 +14,10 @@ testpaths= test usedevelop = true deps = --editable=file:///{toxinidir}/../resotolib - -rrequirements.txt - -r../resotolib/requirements-test.txt + -r../requirements-all.txt +# until this is fixed: https://github.com/pypa/setuptools/issues/3518 +setenv = + SETUPTOOLS_ENABLE_FEATURES = legacy-editable [testenv:syntax] commands = flake8 --verbose diff --git a/setup_venv.sh b/setup_venv.sh index bce71bb80..31ede16b4 100755 --- a/setup_venv.sh +++ b/setup_venv.sh @@ -159,23 +159,20 @@ ensure_pip() { install_dev() { echo "Installing development dependencies" - if [ -f "resotocore/requirements-dev.txt" ]; then - pip install -q -r "resotocore/requirements-dev.txt" + if [ -f "requirements-all.txt" ]; then + pip install -q -r "requirements-all.txt" else - pip install -q -r "https://raw.githubusercontent.com/someengineering/resoto/main/resotocore/requirements-dev.txt" + pip install -q -r "https://raw.githubusercontent.com/someengineering/resoto/main/requirements-all.txt" fi - if [ -f "resotocore/requirements-test.txt" ]; then - pip install -q -r "resotocore/requirements-test.txt" - else - pip install -q -r "https://raw.githubusercontent.com/someengineering/resoto/main/resotocore/requirements-test.txt" - fi - # Install required types (first run is required to detect required packages) - (cd resotocore; mypy --python-version 3.9 resotocore tests > /dev/null 2>&1 || true; mypy --python-version 3.9 --install-types --non-interactive resotocore tests > /dev/null 2>&1 || true) - } install_resoto() { echo "Installing resoto" + if [ -f "requirements.txt" ]; then + pip install -q -r "requirements.txt" + else + pip install -q -r "https://raw.githubusercontent.com/someengineering/resoto/main/requirements.txt" + fi local resoto_components=(resotolib resotocore resotoshell resotoworker resotometrics) for component in "${resoto_components[@]}"; do pip_install "$component" @@ -210,7 +207,8 @@ pip_install() { local relative_path="${path_prefix}${package}/" if [ -d "$relative_path" ] && [ "$git_install" = false ]; then echo "Installing $package_name editable from local path $relative_path" - pip install -q --editable "$relative_path" + # until this is fixed: https://github.com/pypa/setuptools/issues/3518 + pip install -q --editable "$relative_path" --config-settings editable_mode=compat else ensure_git local git_repo="git+https://github.com/someengineering/resoto.git@${branch}#egg=${package_name}&subdirectory=${relative_path}" diff --git a/tools/requirements.py b/tools/requirements.py new file mode 100644 index 000000000..d6e620eec --- /dev/null +++ b/tools/requirements.py @@ -0,0 +1,88 @@ +# Before calling this script: +# pip install toml pip-tools +# +# Run this script from the root of the repository +# python tools/requirements.py +# +# It will gather all project requirements and compile them into +# - a single requirements.txt file +# - a requirements-all.txt file with all dependencies +# - a requirements-dev.txt file with project and development dependencies +# - a requirements-test.txt file with project and test dependencies +# +import os +from collections import defaultdict +from typing import Any, Dict, List, Iterator, Optional +import toml + + +class ProjectDefinition: + def __init__(self, definition: Dict[str, Any]) -> None: + self.definition = definition + + @property + def name(self) -> str: + return self.definition["project"]["name"] + + @property + def dependencies(self) -> List[str]: + return self.definition["project"].get("dependencies", []) + + @property + def optional_dependencies(self) -> Dict[str, List[str]]: + return self.definition["project"].get("optional-dependencies", {}) + + @property + def all_dependencies(self) -> List[str]: + return self.dependencies + [dep for deps in self.optional_dependencies.values() for dep in deps] + + +def all_project_definitions() -> Iterator[ProjectDefinition]: + for root, _, files in os.walk("."): + if "site-packages" in root or ".git" in root: + continue + for file in files: + if file == "pyproject.toml": + print(f"Found pyproject.toml in {root}") + file_path = os.path.join(root, file) + try: + with open(file_path) as f: + yield ProjectDefinition(toml.load(f)) + except Exception as e: + print(f"Failed to parse {file_path}: {e}") + raise + + +filter_out = ["resotolib", "resoto-plugin-aws"] + + +def filter_dependencies(deps: List[str]) -> List[str]: + return [dep for dep in deps if not any(name in dep for name in filter_out)] + + +def compile_dependencies(name: Optional[str], deps: List[str]) -> None: + delim = "-" + name if name else "" + with open(f"requirements{delim}-in.txt", "w") as f: + f.write("\n".join(deps)) + args = "-q --no-annotate --resolver=backtracking --upgrade --allow-unsafe --no-header --unsafe-package n/a" + os.system(f"pip-compile {args} --output-file requirements{delim}.txt requirements{delim}-in.txt") + os.remove(f"requirements{delim}-in.txt") + + +def combine_dependencies() -> None: + prod_dependencies = [] + optional_dependencies = defaultdict(list) + for project in all_project_definitions(): + prod_dependencies.extend(filter_dependencies(project.dependencies)) + for name, deps in project.optional_dependencies.items(): + optional_dependencies[name].extend(filter_dependencies(deps)) + all_dependencies = prod_dependencies.copy() + + compile_dependencies(None, prod_dependencies) + for name, deps in optional_dependencies.items(): + all_dependencies.extend(deps) + compile_dependencies(name, deps + prod_dependencies) + compile_dependencies("all", all_dependencies) + + +combine_dependencies()