Skip to content

Commit

Permalink
chore: Test Python 3.10+ and bump version (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgmacias95 authored Apr 22, 2024
1 parent ef45dd8 commit 8a07bb6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 15 additions & 15 deletions examples/file_provenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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:
Expand All @@ -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()
1 change: 1 addition & 0 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion vt/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Defines VT release version."""

__version__ = "0.18.1"
__version__ = "0.18.2"

0 comments on commit 8a07bb6

Please sign in to comment.