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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ jobs:

steps:
- uses: actions/[email protected]
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: 3.12
Expand Down
44 changes: 19 additions & 25 deletions scripts/populate_tox/populate_tox.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import hashlib
import json
import os
import subprocess
import sys
import time
from bisect import bisect_left
Expand Down Expand Up @@ -509,9 +510,7 @@ def _render_dependencies(integration: str, releases: list[Version]) -> list[str]
return rendered


def write_tox_file(
packages: dict, update_timestamp: bool, last_updated: datetime
) -> None:
def write_tox_file(packages: dict) -> None:
template = ENV.get_template("tox.jinja")

context = {"groups": {}}
Expand All @@ -530,11 +529,6 @@ def write_tox_file(
}
)

if update_timestamp:
context["updated"] = datetime.now(tz=timezone.utc).isoformat()
else:
context["updated"] = last_updated.isoformat()

rendered = template.render(context)

with open(TOX_FILE, "w") as file:
Expand Down Expand Up @@ -623,19 +617,21 @@ def get_file_hash() -> str:


def get_last_updated() -> Optional[datetime]:
timestamp = None

with open(TOX_FILE, "r") as f:
for line in f:
if line.startswith("# Last generated:"):
timestamp = datetime.fromisoformat(line.strip().split()[-1])
break

if timestamp is None:
print(
"Failed to find out when tox.ini was last generated; the timestamp seems to be missing from the file."
)

repo_root = subprocess.run(
["git", "rev-parse", "--show-toplevel"],
capture_output=True,
text=True,
).stdout.strip()
tox_ini_path = Path(repo_root) / "tox.ini"

timestamp = subprocess.run(
["git", "log", "-1", "--pretty=%ct", str(tox_ini_path)],
capture_output=True,
text=True,
).stdout.strip()

timestamp = datetime.fromtimestamp(int(timestamp), timezone.utc)
print(f"Last committed tox.ini update: {timestamp}")
return timestamp


Expand Down Expand Up @@ -675,7 +671,7 @@ def main(fail_on_changes: bool = False) -> None:
print(f"Running in {'fail_on_changes' if fail_on_changes else 'normal'} mode.")
last_updated = get_last_updated()
if fail_on_changes:
# We need to make the script ignore any new releases after the `last_updated`
# We need to make the script ignore any new releases after the last updated
# timestamp so that we don't fail CI on a PR just because a new package
# version was released, leading to unrelated changes in tox.ini.
print(
Expand Down Expand Up @@ -769,9 +765,7 @@ def main(fail_on_changes: bool = False) -> None:
if fail_on_changes:
old_file_hash = get_file_hash()

write_tox_file(
packages, update_timestamp=not fail_on_changes, last_updated=last_updated
)
write_tox_file(packages)

# Sort the release cache file
releases = []
Expand Down
2 changes: 1 addition & 1 deletion scripts/populate_tox/releases.jsonl
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
{"info": {"classifiers": ["Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Topic :: Internet", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: HTTP Servers", "Topic :: Software Development", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Application Frameworks", "Topic :: Software Development :: Libraries :: Python Modules", "Typing :: Typed"], "name": "litestar", "requires_python": "<4.0,>=3.8", "version": "2.6.4", "yanked": false}}
{"info": {"classifiers": ["Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: System :: Logging"], "name": "loguru", "requires_python": "<4.0,>=3.5", "version": "0.7.3", "yanked": false}}
{"info": {"classifiers": ["Intended Audience :: Developers", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: OS Independent", "Operating System :: POSIX", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Topic :: Software Development :: Libraries :: Python Modules", "Typing :: Typed"], "name": "openai", "requires_python": ">=3.7.1", "version": "1.0.1", "yanked": false}}
{"info": {"classifiers": ["Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: OS Independent", "Operating System :: POSIX", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Topic :: Software Development :: Libraries :: Python Modules", "Typing :: Typed"], "name": "openai", "requires_python": ">=3.8", "version": "1.109.0", "yanked": false}}
{"info": {"classifiers": ["Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: OS Independent", "Operating System :: POSIX", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Topic :: Software Development :: Libraries :: Python Modules", "Typing :: Typed"], "name": "openai", "requires_python": ">=3.8", "version": "1.109.1", "yanked": false}}
{"info": {"classifiers": ["Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: OS Independent", "Operating System :: POSIX", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Topic :: Software Development :: Libraries :: Python Modules", "Typing :: Typed"], "name": "openai", "requires_python": ">=3.7.1", "version": "1.37.2", "yanked": false}}
{"info": {"classifiers": ["Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: OS Independent", "Operating System :: POSIX", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Topic :: Software Development :: Libraries :: Python Modules", "Typing :: Typed"], "name": "openai", "requires_python": ">=3.8", "version": "1.73.0", "yanked": false}}
{"info": {"classifiers": ["Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.9", "Topic :: Software Development :: Libraries :: Python Modules", "Typing :: Typed"], "name": "openai-agents", "requires_python": ">=3.9", "version": "0.0.19", "yanked": false}}
Expand Down
2 changes: 0 additions & 2 deletions scripts/populate_tox/tox.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
# or in the script (if you want to change the auto-generated part).
# The file (and all resulting CI YAMLs) then needs to be regenerated via
# "scripts/generate-test-files.sh".
#
# Last generated: {{ updated }}

[tox]
requires =
Expand Down
10 changes: 4 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
# or in the script (if you want to change the auto-generated part).
# The file (and all resulting CI YAMLs) then needs to be regenerated via
# "scripts/generate-test-files.sh".
#
# Last generated: 2025-09-24T10:52:00.519014+00:00

[tox]
requires =
Expand Down Expand Up @@ -68,12 +66,12 @@ envlist =
{py3.8,py3.11,py3.12}-openai-base-v1.0.1
{py3.8,py3.11,py3.12}-openai-base-v1.37.2
{py3.8,py3.11,py3.12}-openai-base-v1.73.0
{py3.8,py3.12,py3.13}-openai-base-v1.109.0
{py3.8,py3.12,py3.13}-openai-base-v1.109.1

{py3.8,py3.11,py3.12}-openai-notiktoken-v1.0.1
{py3.8,py3.11,py3.12}-openai-notiktoken-v1.37.2
{py3.8,py3.11,py3.12}-openai-notiktoken-v1.73.0
{py3.8,py3.12,py3.13}-openai-notiktoken-v1.109.0
{py3.8,py3.12,py3.13}-openai-notiktoken-v1.109.1

{py3.9,py3.12,py3.13}-langgraph-v0.6.7
{py3.10,py3.12,py3.13}-langgraph-v1.0.0a3
Expand Down Expand Up @@ -364,7 +362,7 @@ deps =
openai-base-v1.0.1: openai==1.0.1
openai-base-v1.37.2: openai==1.37.2
openai-base-v1.73.0: openai==1.73.0
openai-base-v1.109.0: openai==1.109.0
openai-base-v1.109.1: openai==1.109.1
openai-base: pytest-asyncio
openai-base: tiktoken
openai-base-v1.0.1: httpx<0.28
Expand All @@ -373,7 +371,7 @@ deps =
openai-notiktoken-v1.0.1: openai==1.0.1
openai-notiktoken-v1.37.2: openai==1.37.2
openai-notiktoken-v1.73.0: openai==1.73.0
openai-notiktoken-v1.109.0: openai==1.109.0
openai-notiktoken-v1.109.1: openai==1.109.1
openai-notiktoken: pytest-asyncio
openai-notiktoken-v1.0.1: httpx<0.28
openai-notiktoken-v1.37.2: httpx<0.28
Expand Down
Loading