Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 8 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v3
with:
path: ~/.local
key: poetry-0

- name: Install Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies if cache does not exist
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Install library
run: poetry install --no-interaction
- name: Set up Python
run: uv python install

- name: Run tests
- name: Run linter and tests
run: |
source .venv/bin/activate
black . --check
pytest tests/ --cov=virustotal_python
uv run black . --check
uv run pytest tests/ --cov=virustotal_python
37 changes: 16 additions & 21 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,26 @@ on:
- "*.*.*"

jobs:
Publish:
publish:
if: github.repository == 'dbrennand/virustotal-python' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
environment:
name: publish
permissions:
id-token: write
contents: read
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v3
with:
path: ~/.local
key: poetry-0
- name: Install Python
run: uv python install

- name: Install Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
- name: Build
run: uv build

- name: Configure Poetry
run: poetry config pypi-token.pypi "${{ secrets.PYPI_API_KEY }}"

- name: Publish virustotal-python
run: poetry publish --build
- name: Publish
run: uv publish
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 1.1.1

* chore(deps): Update all dependencies.
* chore: update license year.
* chore: ci maintenance.
* chore: migrate to uv instead of poetry.

## 1.1.0

* chore(deps): Update all dependencies.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Daniel Brennand
Copyright (c) 2026 Daniel Brennand

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,11 @@ with virustotal_python.Virustotal("<VirusTotal API Key>") as vtotal:

### Unit Tests

Install the development dependencies using Poetry:

```bash
poetry install && poetry shell
```

To run the unit tests, run `pytest` from the root of the project:

```bash
pytest --cov=virustotal_python
uv sync --dev
uv run pytest --cov=virustotal_python
```

### Publishing a new release
Expand Down
936 changes: 0 additions & 936 deletions poetry.lock

This file was deleted.

54 changes: 31 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
[tool.poetry]
[project]
name = "virustotal-python"
version = "1.1.0"
version = "1.1.1"
description = "A Python library to interact with the public VirusTotal v3 and v2 APIs."
authors = ["dbrennand"]
license = "MIT"
authors = [{ name = "dbrennand" }]
requires-python = ">=3.12"
readme = "README.md"
homepage = "https://github.com/dbrennand/virustotal-python"
repository = "https://github.com/dbrennand/virustotal-python"
license = "MIT"
keywords = [
"VirusTotal",
"Wrapper",
"Public API",
"Library",
"v3",
"v2"
"v2",
]
classifiers = [
"Programming Language :: Python :: 3",
Expand All @@ -23,25 +22,34 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = [
"requests>=2.32.5",
]
exclude = [".gitignore"]

[tool.poetry.dependencies]
python = "^3.12"
requests = { version = "^2.31.0" }
PySocks = { version = "^1.7.1", optional = true }
[project.optional-dependencies]
socks = ["PySocks>=1.7.1"]

[tool.poetry.extras]
socks = ["PySocks"]
[project.urls]
Homepage = "https://github.com/dbrennand/virustotal-python"
Repository = "https://github.com/dbrennand/virustotal-python"

[tool.poetry.dev-dependencies]
black = "^24.4.2"
twine = "^5.1.0"
pytest = "^8.2.0"
pytest-mock = "^3.14.0"
requests-mock = "^1.12.1"
pytest-cov = "^5.0.0"
[dependency-groups]
dev = [
"black>=25.12.0",
"pytest>=9.0.2",
"pytest-mock>=3.15.1",
"requests-mock>=1.12.1",
"pytest-cov>=7.0.0",
]

[tool.hatch.build.targets.sdist]
exclude = [".gitignore"]

[tool.hatch.build.targets.wheel]
exclude = [".gitignore"]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"
3 changes: 1 addition & 2 deletions tests/test_virustotal_python.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for virustotal-python.
"""
"""Tests for virustotal-python."""

import virustotal_python
import json
Expand Down
Loading