Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: python3.13 support #202

Merged
merged 1 commit into from
Dec 19, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# We need mypy-protobuf during build - it is a plugin to protoc.
# The version requirement is iffy, there is no way to know whether
# this is going to be compatible to the installed protoc or not.
requires = ["setuptools>=55.0.0", "wheel", "mypy-protobuf~=3.4.0"]
requires = ["setuptools>=75.6.0", "wheel", "mypy-protobuf~=3.4.0"]
build-backend = 'setuptools.build_meta'

[tool.black]
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ dev =
%(cli)s
tox
pandas =
pandas ~= 2.0.1
pandas ~= 2.2.0
cli =
click
click-log
Expand Down
13 changes: 7 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@
import logging
import os
import re
import shutil
import subprocess
import sys
from bisect import bisect_right
from datetime import datetime
from distutils.errors import DistutilsFileError
from distutils.log import ERROR, INFO
from distutils.spawn import find_executable
from operator import itemgetter
from typing import Any, Iterable, Optional

Expand All @@ -29,14 +27,17 @@
metricq_package_dir = "metricq"
protobuf_version_module_file = "_protobuf_version.py"

INFO = 2
ERROR = 4


class ProtocWrapper:
@staticmethod
def _find_protoc() -> str | None:
if "PROTOC" in os.environ and os.path.exists(os.environ["PROTOC"]):
return os.environ["PROTOC"]

return find_executable("protoc")
return shutil.which("protoc")

@staticmethod
def _get_protoc_version(protoc: str) -> tuple[int, int, int]:
Expand Down Expand Up @@ -78,7 +79,7 @@ def _assert_has_executable(self) -> None:
os.environ.get("PROTOC", "Not set")
)
)
raise DistutilsFileError("protoc not found")
raise ValueError("protoc not found")

@property
def executable(self) -> str:
Expand Down Expand Up @@ -242,7 +243,7 @@ def _protobuf_filenames(self) -> Iterable[str]:

if not filenames:
self.error(f"no protobuf files found in {self.proto_dir}")
raise DistutilsFileError(f"No protobuf files found in {self.proto_dir}")
raise ValueError(f"No protobuf files found in {self.proto_dir}")

self.info(f"found protobuf files: {filenames}")

Expand Down
Loading