Skip to content

Commit

Permalink
Test on Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss committed Feb 11, 2025
1 parent a8559c1 commit 728fc17
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ jobs:
run: |
if [ -z $ACT ]
then
_ver="['3.10','3.11']"
_ver="['3.10','3.11','3.12']"
_cache="1"
else
# 3.10 instead of '3.10' to make github act work.
_ver="[3.10,3.11]"
_ver="[3.10,3.11,3.12]"
_cache="0"
fi
echo "version_matrix=$_ver" >> $GITHUB_OUTPUT
Expand Down
7 changes: 4 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@ name = "pypi"

[packages]
absl-py = "==2.1.0"
dm-reverb = "==0.14.0"
gin-config = "==0.5.0"
psutil = "==6.1.0"
tf-agents = "==0.19.0"
setuptools = {version = "75.8.0", markers="python_version >= '3.12'"}
tensorflow = "==2.15.0"
dm-reverb = "==0.14.0"
tf-agents = "==0.19.0"

[dev-packages]
pylint = "==3.3.2"
pytest = "==8.3.4"
pytype = "==2024.10.11"
ruff = "==0.9.6"
yapf = "==0.43.0"
ruff = "==0.9.3"

[ci]
joblib = "==1.4.2"
Expand Down
7 changes: 7 additions & 0 deletions compiler_opt/rl/compilation_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import shlex
import signal
import subprocess
import sys
import tempfile
import threading
from typing import Callable, Dict, List, Optional, Tuple
Expand Down Expand Up @@ -80,6 +81,12 @@ def __exit__(self, exc, value, tb):
pass


if sys.version_info >= (3, 12):
from functools import partial

NonTemporaryDirectory = partial(tempfile.TemporaryDirectory, delete=False)


def get_workdir_context(explicit_temps_dir: Optional[str] = None):
"""Return a context which manages how the temperory directories are handled.
Expand Down
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ filterwarnings = [
"ignore:Using or importing the ABCs from 'collections':DeprecationWarning",
# Issue #119
"ignore:Encoding a StructuredValue with type tfp.distributions.Deterministic_ACTTypeSpec:UserWarning",
# This warning stems from tensorflow and tf-agents and will presumably
# be fixed by them before v3.12
"ignore:The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives:DeprecationWarning",
# Also an issue internal to tensorflow
# An issue internal to tensorflow
"ignore:Call to deprecated create function .*Descriptor.*:DeprecationWarning",
# Also internal to tensorflow
"ignore:non-integer arguments to randrange.*:DeprecationWarning",
Expand Down

0 comments on commit 728fc17

Please sign in to comment.