From 16bc2c1d447d2a20a903617732e62aa0a1e58485 Mon Sep 17 00:00:00 2001 From: Christian Toepfer Date: Wed, 30 Nov 2022 16:05:04 +0100 Subject: [PATCH] (remove extra lines) --- .gitignore | 3 +-- pyrobuf/compile.py | 5 ++--- pyrobuf/protobuf/templates/proto_pyx.tmpl | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 140ac80..311da27 100644 --- a/.gitignore +++ b/.gitignore @@ -15,5 +15,4 @@ tests/out/ tests/build/ /.tox pyrobuf/src/pyrobuf_defs.pxi -.pytest_cache -.mypy_cache \ No newline at end of file +.pytest_cache \ No newline at end of file diff --git a/pyrobuf/compile.py b/pyrobuf/compile.py index 88746fd..6d01150 100644 --- a/pyrobuf/compile.py +++ b/pyrobuf/compile.py @@ -3,7 +3,6 @@ import os import sys from setuptools import setup -from distutils.sysconfig import get_python_lib from Cython.Build import cythonize from pathlib import Path @@ -18,6 +17,7 @@ _VM = sys.version_info.major + class Compiler(object): _env = Environment(loader=PackageLoader('pyrobuf.protobuf', 'templates')) @@ -137,7 +137,6 @@ def _generate(self, filename): self._messages.append(msg_def) for f in msg_def['imports']: - print("parsing dependency '{}'".format(f)) depends = None @@ -150,7 +149,7 @@ def _generate(self, filename): self._generate(depends) except FileNotFoundError: raise FileNotFoundError("can't find message spec for '{}'" - .format(f)) + .format(f)) if self.package is None: self._write(name, msg_def) diff --git a/pyrobuf/protobuf/templates/proto_pyx.tmpl b/pyrobuf/protobuf/templates/proto_pyx.tmpl index fb30b09..6e758e4 100644 --- a/pyrobuf/protobuf/templates/proto_pyx.tmpl +++ b/pyrobuf/protobuf/templates/proto_pyx.tmpl @@ -13,7 +13,6 @@ import enum from pyrogen.{{ import }}_proto cimport * {%- endfor %} - {%- macro enum_fields_def(enum) %} class {{enum.full_name}}(enum.IntEnum): {%- for field in enum.fields.values() %} @@ -23,6 +22,7 @@ class {{enum.full_name}}(enum.IntEnum): {%- macro classdef(message) %} cdef class {{ message.full_name }}: + def __cinit__(self): self._listener = noop_listener