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
7 changes: 4 additions & 3 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ jobs:
- uses: actions/checkout@v3
# Every interpreter in the tox.ini envlist must exist or tox cannot create
# that environment. The *last* entry becomes the default `python`, so keep
# 3.11 last: `uv python pin 3.11` and `make build` below are unaffected.
# 3.14 last: `uv python pin 3.11` and `make build` below are unaffected.
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: |
3.9
3.10
3.13
3.12
3.11
3.14

- name: Install pypa/build
run: |
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ jobs:
- uses: actions/checkout@v3

# Set up every interpreter in the tox.ini envlist. The *last* entry becomes
# the default `python`, so keep 3.9 last: `make test` stays on the
# requires-python = ">=3.9" floor, and only tox reaches for 3.10/3.11.
# the default `python`, so keep 3.14 last: every step below behaves as
# before, with only tox reaching for the others.
- name: Prepare python env
uses: actions/setup-python@v4
with:
python-version: |
3.13
3.12
3.11
3.10
3.9
3.14

# Install uv
- name: Install uv
Expand All @@ -31,9 +32,9 @@ jobs:
run: make test

# Exercise tox on every PR instead of only at release time.
# tox >= 4.31 requires Python >= 3.10, so install it with 3.11 to resolve
# the same tox release the publish workflow uses.
# tox >= 4.31 requires Python >= 3.10, so install it with 3.14, the
# default `python`.
- name: Install tox
run: python3.11 -m pip install tox
run: python3.14 -m pip install tox
- name: Run tox
run: python3.11 -m tox
run: python3.14 -m tox
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG

## 1.5.1 - 2026-10-27

- Drop Python 3.9 and 3.10 support (both end-of-life). Requires Python 3.11+; existing 3.9/3.10 users stay on older releases.
- Add Python 3.14 support (supported range is now 3.11–3.14).
- Bump grpcio to 1.84.1 for all supported Python versions, replacing the
version-conditional pins (1.71.x below 3.14, 1.75.1 on 3.14), to pick up
grpcio's eMudhra CA remediation.

## 1.5.0 - 2026-09-15

- Add `scan_reader` (sync and aio) for scanning a data source through a reader implementing
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ version:

proto: version
uv sync --dev
uv run python -m grpc_tools.protoc -Iamaas/grpc/protos=./protos \
# grpcio-tools is pinned out of the project env on Python >= 3.14 (no
# cp314 wheel for 1.71.2, and 1.75.1 needs protobuf 6 while the runtime
# stays on 5.29.x). Generate the pb2 sources through an isolated uvx
# environment on 3.13 instead, so protoc runs the same way regardless of
# which interpreter make itself is invoked under (tox runs make build
# inside every py311..py314 env).
uvx --from "grpcio-tools==1.71.2" --python 3.13 \
python -m grpc_tools.protoc -Iamaas/grpc/protos=./protos \
--python_out=. \
--pyi_out=. \
--grpc_python_out=. \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Follow the steps below to set up your development environment and configure your

## Checking prerequisites

- Python 3.9 to 3.13
- Python 3.11 to 3.14
- Trend Vision One account with a chosen region - for more information, see the [Trend Vision One documentation](https://docs.trendmicro.com/en-us/documentation/article/trend-vision-one-trend-micro-xdr-abou_001).
- A Trend Vision One API key with proper role - for more information, see the [Trend Vision One API key documentation](https://docs.trendmicro.com/en-us/documentation/article/trend-vision-one-api-keys).

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.0
1.5.1
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This guide outlines the steps to establish your development environment and conf

## Requirements

- Python 3.9 or newer
- Python 3.11 to 3.14
- Trend Vision One account with a chosen region - for more information, see the [Trend Vision One documentation](https://docs.trendmicro.com/en-us/enterprise/trend-micro-xdr-help/Home).
- A Trend Vision One API key with proper role - for more information, see the [Trend Vision One API key documentation](https://docs.trendmicro.com/en-us/enterprise/trend-vision-one/administrative-setti/accountspartfoundati/api-keys.aspx).

Expand Down
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
[project]
name = "visionone_filesecurity"
version = _VERSION_
requires-python = ">=3.9,<=3.13"
requires-python = ">=3.11,<3.15"
authors = [{ name = "Trend Micro VisionOne File Security Team" }]
description = "Trend Micro VisionOne File Security SDK for python"
readme = "README.md"
license = { file = "public/LICENSE" }
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"License :: OSI Approved :: MIT License",
]
urls = { Homepage = "https://github.com/trendmicro/tm-v1-fs-python-sdk" }

dependencies = [
"protobuf~=5.29.4",
"grpcio~=1.71.0",
"grpcio~=1.84.1",
]

[dependency-groups]
dev = [
"grpcio-tools~=1.51",
"grpcio-tools~=1.51; python_version < '3.14'",
"setuptools~=65.3",
"pytest~=7.1",
"twine~=6.1.0",
Expand Down
2 changes: 1 addition & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Kept in ruff.toml instead of pyproject.toml because pyproject.toml holds a
# `version = _VERSION_` placeholder until `make version` fills it in, which
# makes it invalid TOML for tools that run before the fill-in (e.g. tox lint).
target-version = "py39"
target-version = "py311"
line-length = 120

[lint]
Expand Down
102 changes: 102 additions & 0 deletions tests/test_packaging_metadata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
"""Guard against Requires-Python metadata regressions."""

import configparser
import pathlib
import re
import sys
import tomllib

PUBLIC_DIR = pathlib.Path(__file__).resolve().parent.parent
SUPPORTED_SERIES = [(3, 11), (3, 12), (3, 13), (3, 14)]
# Retired from the support floor (both end-of-life; C1AMAAS-21165).
RETIRED_SERIES = [(3, 9), (3, 10)]

try:
from packaging.specifiers import SpecifierSet
except ImportError: # pragma: no cover - packaging is a pytest dependency
SpecifierSet = None


def _requires_python() -> str:
"""Read requires-python from pyproject.toml.

The checked-in file carries the `_VERSION_` placeholder in `version =`,
which is not valid TOML, so parse only when the Makefile has substituted
it and fall back to a line match otherwise.
"""
text = (PUBLIC_DIR / "pyproject.toml").read_text()
try:
return tomllib.loads(text)["project"]["requires-python"]
except tomllib.TOMLDecodeError:
pass
m = re.search(r'^requires-python\s*=\s*"([^"]+)"', text, re.M)
if not m:
raise AssertionError("requires-python not found in pyproject.toml")
return m.group(1)


def test_requires_python_admits_patch_releases_of_supported_series():
assert SpecifierSet is not None
spec = SpecifierSet(_requires_python())
for major, minor in SUPPORTED_SERIES:
# Latest plausible patch of the series, as a full release version.
assert spec.contains(f"{major}.{minor}.99"), (
f"requires-python={_requires_python()!r} excludes Python "
f"{major}.{minor}.99 — an upper bound must be a bound on the "
f"series (<3.{minor + 1}), not on a single release (<=3.{minor})"
)


def test_requires_python_rejects_unsupported_series():
assert SpecifierSet is not None
spec = SpecifierSet(_requires_python())
first_unsupported = SUPPORTED_SERIES[-1][1] + 1
assert not spec.contains(f"3.{first_unsupported}.0")
for major, minor in RETIRED_SERIES:
assert not spec.contains(f"{major}.{minor}.0"), (
f"requires-python={_requires_python()!r} still admits retired Python {major}.{minor}"
)


def _expand_envlist(envlist: str) -> set[str]:
"""Expand tox factor syntax: 'py{39,310}' -> {'py39', 'py310'}."""
envs: set[str] = {""}
i = 0
while i < len(envlist):
ch = envlist[i]
if ch == "{":
close = envlist.index("}", i)
factors = envlist[i + 1 : close].split(",")
envs = {e + f for e in envs for f in factors}
i = close + 1
else:
run = i
while run < len(envlist) and envlist[run] not in "{,":
run += 1
envs = {e + envlist[i:run] for e in envs}
i = run
return envs


def test_tox_envlist_covers_every_supported_series():
tox = configparser.ConfigParser()
tox.read(PUBLIC_DIR / "tox.ini")
envs = _expand_envlist(tox["tox"]["envlist"])
for major, minor in SUPPORTED_SERIES:
assert f"py{major}{minor}" in envs, f"tox envlist is missing py{major}{minor}"


def test_tox_envlist_excludes_retired_series():
tox = configparser.ConfigParser()
tox.read(PUBLIC_DIR / "tox.ini")
envs = _expand_envlist(tox["tox"]["envlist"])
for major, minor in RETIRED_SERIES:
assert f"py{major}{minor}" not in envs, f"tox envlist still lists retired py{major}{minor}"


def test_current_interpreter_is_inside_declared_range():
spec = SpecifierSet(_requires_python())
current = ".".join(str(p) for p in sys.version_info[:3])
assert spec.contains(current), (
f"running interpreter {current} is excluded by requires-python={_requires_python()!r}"
)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# and also to help confirm pull requests to this project.

[tox]
envlist = py{39,310,311}
envlist = py{311,312,313,314}

# Fail loudly when an interpreter in envlist is missing instead of silently
# skipping that environment. tox <= 4.30 skips by default, tox >= 4.31 fails,
Expand Down
Loading
Loading