From 8a07bb6f6f2f40e210435ea37503c286c644c9bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20G=C3=B3mez=20Mac=C3=ADas?= Date: Mon, 22 Apr 2024 09:54:05 +0200 Subject: [PATCH] chore: Test Python 3.10+ and bump version (#189) --- .github/workflows/testing.yaml | 2 +- examples/file_provenance.py | 30 +++++++++++++++--------------- pylintrc | 1 + vt/version.py | 2 +- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/workflows/testing.yaml b/.github/workflows/testing.yaml index 58f266f..7b1d719 100644 --- a/.github/workflows/testing.yaml +++ b/.github/workflows/testing.yaml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v3 diff --git a/examples/file_provenance.py b/examples/file_provenance.py index c2e4206..148019a 100644 --- a/examples/file_provenance.py +++ b/examples/file_provenance.py @@ -27,28 +27,28 @@ async def get_provenance_info(apikey, file_hash): async with vt.Client(apikey) as client: - file_obj = await client.get_object_async(f"/files/{file_hash}") + file_obj = await client.get_object_async(f'/files/{file_hash}') return ( - getattr(file_obj, "monitor_info", None), - getattr(file_obj, "nsrl_info", None), - getattr(file_obj, "signature_info", None), - getattr(file_obj, "tags", []), - getattr(file_obj, "trusted_verdict", None), + getattr(file_obj, 'monitor_info', None), + getattr(file_obj, 'nsrl_info', None), + getattr(file_obj, 'signature_info', None), + getattr(file_obj, 'tags', []), + getattr(file_obj, 'trusted_verdict', None), ) async def main(): parser = argparse.ArgumentParser( - description="Get provenance info for a given file." + description='Get provenance info for a given file.' ) - parser.add_argument("--apikey", required=True, help="your VirusTotal API key") + parser.add_argument('--apikey', required=True, help='your VirusTotal API key') parser.add_argument( - "--path", + '--path', required=True, - type=argparse.FileType("rb"), - help="path to the file check.", + type=argparse.FileType('rb'), + help='path to the file check.', ) args = parser.parse_args() @@ -59,13 +59,13 @@ async def main(): args.apikey, file_hash ) except vt.error.APIError as e: - print(f"ERROR: {e}") + print(f'ERROR: {e}') sys.exit(1) if monitor: print( - "Present in monitor collections " - f"of {', '.join(monitor['organizations'])}" + 'Present in monitor collections ' + f'of {", ".join(monitor["organizations"])}' ) if nslr: @@ -80,7 +80,7 @@ async def main(): print(f'Trusted file by {trusted["organization"]}') -if __name__ == "__main__": +if __name__ == '__main__': loop = asyncio.get_event_loop() loop.run_until_complete(main()) loop.close() diff --git a/pylintrc b/pylintrc index 140a876..1c4760e 100644 --- a/pylintrc +++ b/pylintrc @@ -81,6 +81,7 @@ disable=abstract-method, import-self, import-star-module-level, inconsistent-return-statements, + inconsistent-quotes, input-builtin, intern-builtin, invalid-str-codec, diff --git a/vt/version.py b/vt/version.py index 0279081..9c3c264 100644 --- a/vt/version.py +++ b/vt/version.py @@ -1,3 +1,3 @@ """Defines VT release version.""" -__version__ = "0.18.1" +__version__ = "0.18.2"