Skip to content

Commit

Permalink
feat: python 3.12 support added
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrdjan committed Oct 5, 2023
1 parent 627dfd5 commit c7930ea
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion examples/server/server_app_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ def launch_server():

# stop server
server_thread.join()
print("Server stoped")
print("Server stoped")
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "pyrfc"
version = "3.2"
version = "3.3"
readme = "README.md"
license = { file = "LICENSES/Apache-2.0.txt" }
description = "Python bindings for SAP NetWeaver RFC SDK"
Expand All @@ -26,6 +26,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only"
]
dependencies = []
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# SPDX-License-Identifier: Apache-2.0

import inspect
import sys
import os
from setuptools import setup, Extension
import sys

from setuptools import Extension, setup

PACKAGE_NAME = "pyrfc"
MODULE_NAME = "_cyrfc"
Expand All @@ -17,8 +17,8 @@
CMDCLASS = {}
if build_cython:
try:
from Cython.Distutils import build_ext
from Cython.Build import cythonize
from Cython.Distutils import build_ext
except ImportError:
sys.exit("Cython not installed: https://cython.readthedocs.io/en/latest/src/quickstart/install.html")
CMDCLASS = {"build_ext": build_ext}
Expand Down Expand Up @@ -189,7 +189,7 @@
setup(
name=PACKAGE_NAME,
cmdclass=CMDCLASS, # type: ignore
ext_modules=cythonize(PYRFC_EXT, annotate=True, compiler_directives={"language_level": "3"}) # type: ignore
ext_modules=cythonize(PYRFC_EXT, annotate=True, compiler_directives={"language_level": "3", "embedsignature": True}) # type: ignore
if build_cython
else [PYRFC_EXT], # type: ignore
test_suite="tests",
Expand Down
9 changes: 6 additions & 3 deletions src/pyrfc/_cyrfc.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ from decimal import Decimal
from enum import Enum, auto
from locale import localeconv
from os.path import isfile, join
from sys import exc_info, platform
from sys import exc_info, platform, version_info
from threading import Thread, Timer

from pyrfc.csapnwrfc cimport *

from pyrfc._exception import *
from pyrfc._utils import enum_names, enum_values

Expand Down Expand Up @@ -1530,7 +1529,11 @@ def default_auth_check(func_name=False, request_context = None):

def _server_log(origin, log_message):
if server_context["server_log"]:
print (f"[{datetime.utcnow()} UTC] {origin} '{log_message}'")
if version_info > (3, 12):
from datetime import UTC
print (f"[{datetime.now(UTC).replace(tzinfo=None)} UTC] {origin} '{log_message}'")
else:
print (f"[{datetime.utcnow()} UTC] {origin} '{log_message}'")


cdef RFC_RC metadataLookup(
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
description = "PyRFC Build"
minversion = 4.5
envlist =
lint_format, docs, reuse, sdist, pack,
py38, py39, py310, py311
linter, docs, reuse, sdist, pack,
py38, py39, py310, py311, py312
package = wheel
skip_missing_interpreters = false
isolated_build = true
Expand All @@ -26,7 +26,7 @@ commands =
# unit test
python -m pytest tests --testdox --html-report=./report {posargs}

[testenv:lint_format]
[testenv:linter]
description = Check linting
platform = darwin
basepython = python3.11
Expand Down

0 comments on commit c7930ea

Please sign in to comment.