diff --git a/CHANGELOG.md b/CHANGELOG.md index f396b2e4ef63ca5f446341366daec9bb79db2fa7..3507f4a3d1faa7d8d9e4ee19ac24c00f58a1a424 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# v1.1.2 + +* bugfix release: fixed behaviour if there was only + a single file in Multibuild + # v1.1.1 * allowed Linux-style paths on Windows build environments diff --git a/example/example3/example3/example3/__init__.py b/example/example3/example3/example3/__init__.py index fa84e47ee529b348bfcf12c1c64433e3c127dde4..7d924a09bcd26e1553cdb89a03d7ba9789a77374 100644 --- a/example/example3/example3/example3/__init__.py +++ b/example/example3/example3/example3/__init__.py @@ -1,3 +1,5 @@ +from example3.example3.example3.__bootstrap__ import bootstrap_cython_submodules +bootstrap_cython_submodules() import logging import typing as tp diff --git a/snakehouse/__init__.py b/snakehouse/__init__.py index 982a623f9e735b5c636e7fa9fc0bded18c8f65f4..8ee34e415eb1987cf0ee1b5930dac69015df8d49 100644 --- a/snakehouse/__init__.py +++ b/snakehouse/__init__.py @@ -1,4 +1,4 @@ from .build import build from .multibuild import Multibuild -__version__ = '1.1.1' +__version__ = '1.1.2' diff --git a/snakehouse/multibuild.py b/snakehouse/multibuild.py index c9d7bb96db94aba79ed04238eb8252d57a924ebc..52d998e3a4f084f555ff1bd40babdfc3ceb63b69 100644 --- a/snakehouse/multibuild.py +++ b/snakehouse/multibuild.py @@ -1,5 +1,6 @@ import os import collections +import typing as tp import pkg_resources from satella.files import split from mako.template import Template @@ -21,7 +22,7 @@ class Multibuild: """ This specifies a single Cython extension, called {extension_name}.__bootstrap__ """ - def __init__(self, extension_name: str, files): + def __init__(self, extension_name: str, files: tp.Iterator[str]): """ :param extension_name: the module name :param files: list of pyx and c files @@ -36,9 +37,12 @@ class Multibuild: self.pyx_files = [file for file in files if file.endswith('.pyx')] - self.extension_name = extension_name - self.bootstrap_directory = os.path.commonpath(self.files) - self.modules = set() # tp.Set[tp.Tuple[str, str]] + self.extension_name = extension_name # type: str + if len(self.files) == 1: + self.bootstrap_directory, _ = os.path.split(self.files[0]) # type: str + else: + self.bootstrap_directory = os.path.commonpath(self.files) # type: str + self.modules = set() # type: tp.Set[tp.Tuple[str, str]] def generate_header_files(self): for filename in self.pyx_files: