From fae54e6995c8a1048538b110ea4a327e25144460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Thu, 26 Dec 2019 13:40:11 +0100 Subject: [PATCH 1/3] Do not "twine check" wheels if none was generated --- src/oca_github_bot/build_wheels.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/oca_github_bot/build_wheels.py b/src/oca_github_bot/build_wheels.py index 8c7d47ac..c0d12128 100644 --- a/src/oca_github_bot/build_wheels.py +++ b/src/oca_github_bot/build_wheels.py @@ -12,7 +12,7 @@ _logger = logging.getLogger(__name__) -def _build_wheel(addon_dir, dist_dir): +def _build_and_check_wheel(addon_dir, dist_dir): manifest = get_manifest(addon_dir) if not manifest.get("installable", True): return @@ -39,6 +39,7 @@ def _build_wheel(addon_dir, dist_dir): "py2" if series < (11, 0) else "py3", ] check_call(cmd, cwd=setup_dir) + _check_wheels(dist_dir) def _check_wheels(dist_dir): @@ -48,14 +49,12 @@ def _check_wheels(dist_dir): def build_and_check_wheel(addon_dir): with tempfile.TemporaryDirectory() as dist_dir: - _build_wheel(addon_dir, dist_dir) - _check_wheels(dist_dir) + _build_and_check_wheel(addon_dir, dist_dir) def build_and_publish_wheel(addon_dir, simple_index_root, dry_run=False): with tempfile.TemporaryDirectory() as dist_dir: - _build_wheel(addon_dir, dist_dir) - _check_wheels(dist_dir) + _build_and_check_wheel(addon_dir, dist_dir) _publish_dist_dir_to_simple_index(dist_dir, simple_index_root, dry_run) From c68a0706c3d44c156694918bde2706226d087e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Thu, 26 Dec 2019 13:53:23 +0100 Subject: [PATCH 2/3] Do not publish wheels if none was generated --- src/oca_github_bot/build_wheels.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/oca_github_bot/build_wheels.py b/src/oca_github_bot/build_wheels.py index c0d12128..e72bb435 100644 --- a/src/oca_github_bot/build_wheels.py +++ b/src/oca_github_bot/build_wheels.py @@ -15,15 +15,15 @@ def _build_and_check_wheel(addon_dir, dist_dir): manifest = get_manifest(addon_dir) if not manifest.get("installable", True): - return + return False series = get_odoo_series_from_version(manifest.get("version", "")) if series < (8, 0): - return + return False addon_name = os.path.basename(addon_dir) setup_dir = os.path.join(addon_dir, "..", "setup", addon_name) setup_file = os.path.join(setup_dir, "setup.py") if not os.path.isfile(setup_file): - return + return False with tempfile.TemporaryDirectory() as tempdir: bdist_dir = os.path.join(tempdir, "build") os.mkdir(bdist_dir) @@ -40,6 +40,7 @@ def _build_and_check_wheel(addon_dir, dist_dir): ] check_call(cmd, cwd=setup_dir) _check_wheels(dist_dir) + return True def _check_wheels(dist_dir): @@ -54,8 +55,8 @@ def build_and_check_wheel(addon_dir): def build_and_publish_wheel(addon_dir, simple_index_root, dry_run=False): with tempfile.TemporaryDirectory() as dist_dir: - _build_and_check_wheel(addon_dir, dist_dir) - _publish_dist_dir_to_simple_index(dist_dir, simple_index_root, dry_run) + if _build_and_check_wheel(addon_dir, dist_dir): + _publish_dist_dir_to_simple_index(dist_dir, simple_index_root, dry_run) def build_and_publish_wheels(addons_dir, simple_index_root, dry_run=False): From 4a1483ad3e58f8f96e9cbefbf76e0c2f1ba917e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Thu, 26 Dec 2019 14:01:35 +0100 Subject: [PATCH 3/3] Update changelog --- HISTORY.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index 190c996d..eeee1f61 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,3 +1,11 @@ +20191226 +~~~~~~~~ + +**Bug fixes** + +- do not fail on ``twine check`` when an addon has no ``setup.py`` + `#96 `_ + 20191126 ~~~~~~~~