From dbb7a4bcc685e8b4611c77a57bf342410958094c Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Tue, 24 Oct 2017 10:14:33 -0400 Subject: [PATCH] do not assume that modules with setup.py are packaged with python jobs Back in a5e6f88e1 we made the assumption that repos containing puppet and node.js modules that also have a setup.py were packaged as python projects. That is not a valid assumption, so remove it. Projects can now explicitly select between the packaging type. Change-Id: Ie98b7677d07acdfaebf3fa725a481491101922eb Signed-off-by: Doug Hellmann --- openstack_releases/npmutils.py | 2 -- openstack_releases/puppetutils.py | 2 -- openstack_releases/tests/test_npmutils.py | 13 ------------- openstack_releases/tests/test_puppetutils.py | 16 ---------------- 4 files changed, 33 deletions(-) diff --git a/openstack_releases/npmutils.py b/openstack_releases/npmutils.py index 701345ae8e..4f38426510 100644 --- a/openstack_releases/npmutils.py +++ b/openstack_releases/npmutils.py @@ -18,8 +18,6 @@ import os.path def looks_like_a_module(workdir, repo): "Does the directory look like it contains an npm module?" - if os.path.exists(os.path.join(workdir, repo, 'setup.py')): - return False return os.path.exists(os.path.join(workdir, repo, 'package.json')) diff --git a/openstack_releases/puppetutils.py b/openstack_releases/puppetutils.py index f9957e7ca0..a319e83bf0 100644 --- a/openstack_releases/puppetutils.py +++ b/openstack_releases/puppetutils.py @@ -18,8 +18,6 @@ import os.path def looks_like_a_module(workdir, repo): "Does the directory look like it contains a puppet module?" - if os.path.exists(os.path.join(workdir, repo, 'setup.py')): - return False if not os.path.exists(os.path.join(workdir, repo, 'metadata.json')): return False return any([ diff --git a/openstack_releases/tests/test_npmutils.py b/openstack_releases/tests/test_npmutils.py index 1bb74c0459..07f50c4b23 100644 --- a/openstack_releases/tests/test_npmutils.py +++ b/openstack_releases/tests/test_npmutils.py @@ -48,19 +48,6 @@ class TestModuleDetection(base.BaseTestCase): '.', 'openstack/monasca-kibana-plugin') self.assertTrue(is_mod) - def test_actually_python(self): - - def exists(name): - if name.endswith('package.json'): - return True - if name.endswith('setup.py'): - return True - - with mock.patch('os.path.exists', exists): - is_mod = npmutils.looks_like_a_module( - '.', 'openstack/monasca-kibana-plugin') - self.assertFalse(is_mod) - class TestGetMetadata(base.BaseTestCase): diff --git a/openstack_releases/tests/test_puppetutils.py b/openstack_releases/tests/test_puppetutils.py index 11d58d30db..78a9b76ced 100644 --- a/openstack_releases/tests/test_puppetutils.py +++ b/openstack_releases/tests/test_puppetutils.py @@ -77,22 +77,6 @@ class TestModuleDetection(base.BaseTestCase): '.', 'openstack/puppet-watcher') self.assertTrue(is_mod) - def test_actually_python(self): - - def exists(name): - if name.endswith('setup.py'): - return True - if name.endswith('metadata.json'): - return True - if name.endswith('manifests'): - return True - return False - - with mock.patch('os.path.exists', exists): - is_mod = puppetutils.looks_like_a_module( - '.', 'openstack/puppet-watcher') - self.assertFalse(is_mod) - class TestGetMetadata(base.BaseTestCase):