Den fre 12 juli 2024 kl 19:24 skrev <rin...@apache.org>: > Author: rinrab > Date: Fri Jul 12 17:24:29 2024 > New Revision: 1919169 > > URL: http://svn.apache.org/viewvc?rev=1919169&view=rev > Log: > On the 'cmake' branch: gen_cmake.py: Keep py2 support by removing types of > the variables and objects. > > :( >
I assume it would be better to have types on variables and objects for type checking (I'm not native in Python but I've read PEP 484 so I think I understand the purpose and limitations). Do we really need to keep Py2 support? I would favour to write Python3-only code. This will end up in /trunk and 1.15 - I'm don't think I see it backported to 1.14 - but it also only affects the build system. Is it reasonable to think that someone targeting a platform having CMake also has Python3. Kind regards, Daniel > > * build/generator/gen_cmake.py > (): Cleanup types of the variables. > > Modified: > subversion/branches/cmake/build/generator/gen_cmake.py > > Modified: subversion/branches/cmake/build/generator/gen_cmake.py > URL: > http://svn.apache.org/viewvc/subversion/branches/cmake/build/generator/gen_cmake.py?rev=1919169&r1=1919168&r2=1919169&view=diff > > ============================================================================== > --- subversion/branches/cmake/build/generator/gen_cmake.py (original) > +++ subversion/branches/cmake/build/generator/gen_cmake.py Fri Jul 12 > 17:24:29 2024 > @@ -29,10 +29,10 @@ class _eztdata(object): > vars(self).update(kw) > > class cmake_target(): > - def __init__(self, name: str, type: str, sources, > + def __init__(self, name, type, sources, > libs, msvc_libs, msvc_objects, msvc_export, > - enable_condition, group: str, build_type: str, > - description: str, srcdir: str, install_target: bool): > + enable_condition, group, build_type, > + description, srcdir, install_target): > self.name = name > self.type = type > self.sources = sources > @@ -53,7 +53,7 @@ class cmake_target(): > self.srcdir = srcdir > self.install_target = ezt.boolean(install_target) > > -def get_target_type(target: gen_base.Target): > +def get_target_type(target): > if isinstance(target, gen_base.TargetExe): > if target.install == "test" and target.testing != "skip": > return "test" > @@ -70,7 +70,7 @@ def get_target_type(target: gen_base.Tar > else: > return str(type(target)) > > -def get_module_name(name: str): > +def get_module_name(name): > """ > Returns the name of the library as a module name. Module name > is a library name without `libsvn_` prefix and in upper case. > @@ -99,7 +99,6 @@ class Generator(gen_base.GeneratorBase): > targets = [] > > for target in self.get_install_sources(): > - target: gen_base.Target > group = None > enable_condition = [] > build_type = None > @@ -222,8 +221,6 @@ class Generator(gen_base.GeneratorBase): > result = [] > > for target in install_sources: > - target: gen_base.Target > - > if not self.check_ignore_target(target): > result.append(target) > > @@ -239,7 +236,7 @@ class Generator(gen_base.GeneratorBase): > > return deps > > - def check_ignore_target(self, target: gen_base.Target): > + def check_ignore_target(self, target): > ignore_names = [ > "libsvn_auth_gnome_keyring", > "libsvn_auth_kwallet", > > >