From 6d2248c6a62f80cf2fe0f41857c1b700346e2547 Mon Sep 17 00:00:00 2001 From: Abhishek Patra Date: Sat, 27 Mar 2021 19:10:18 +0530 Subject: [PATCH 01/24] Support a config field for adding link to associated commit --- src/screwdrivercd/version/arguments.py | 17 +++++++++++++---- src/screwdrivercd/version/cli.py | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/screwdrivercd/version/arguments.py b/src/screwdrivercd/version/arguments.py index 456d85a..c190b2e 100644 --- a/src/screwdrivercd/version/arguments.py +++ b/src/screwdrivercd/version/arguments.py @@ -36,6 +36,14 @@ def get_config_default(key, default=None, setup_cfg_filename='setup.cfg'): return default +def get_bool_equivalent(key) -> bool: + """ Get the equivalent bool value for a string key in the config file. """ + + if isinstance(key, str) and key.lower() in ['false', '0', 'off']: + return False + return True + + def parse_arguments(): """ Parse the command line arguments @@ -47,10 +55,10 @@ def parse_arguments(): """ version_type = get_config_default('version_type', default='default') update_meta = get_config_default('update_screwdriver_meta', default='false') - if isinstance(update_meta, str) and update_meta.lower() in ['false', '0', 'off']: - update_meta = False - else: - update_meta = True + update_meta = get_bool_equivalent(update_meta) + link_to_commit = get_config_default('link_to_commit', default='false') + link_to_commit = get_bool_equivalent(link_to_commit) + version_choices = list(versioners.keys()) if version_type not in version_choices: raise VersionError(f'The version_type in the [screwdrivercd.version] section of setup.cfg has an invalid version type of {version_type!r}') @@ -60,5 +68,6 @@ def parse_arguments(): parser.add_argument('--version_type', default=version_type, choices=version_choices, help='Type of version number to generate') parser.add_argument('--ignore_meta', default=False, action='store_true', help='Ignore the screwdriver v4 metadata') parser.add_argument('--update_meta', default=update_meta, action='store_true', help='Update the screwdriver v4 metadata with the new version') + parser.add_argument('--link_to_commit', default=link_to_commit, action='store_true', help='Add/update link to build-triggering commit using its SHA hash') result = parser.parse_args() return result diff --git a/src/screwdrivercd/version/cli.py b/src/screwdrivercd/version/cli.py index cc87b5a..1ee31e1 100644 --- a/src/screwdrivercd/version/cli.py +++ b/src/screwdrivercd/version/cli.py @@ -24,7 +24,7 @@ def main(): if args.force_update or setupcfg_has_metadata(): versioner = versioners[args.version_type] print(f'Updating version using the {versioner.name} version plugin', flush=True) - version = versioner(ignore_meta_version=args.ignore_meta, update_sdv4_meta=args.update_meta) + version = versioner(ignore_meta_version=args.ignore_meta, update_sdv4_meta=args.update_meta, link_to_commit=args.link_to_commit) version.update_setup_cfg_metadata() if args.update_meta: From 697a7cbcf81a64294c037e1585126b5b1540bfbc Mon Sep 17 00:00:00 2001 From: Abhishek Patra Date: Sat, 27 Mar 2021 19:10:42 +0530 Subject: [PATCH 02/24] Generate link to build-triggering commit using its SHA hash --- src/screwdrivercd/version/version_types.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/screwdrivercd/version/version_types.py b/src/screwdrivercd/version/version_types.py index 5a9112d..0b2ed01 100644 --- a/src/screwdrivercd/version/version_types.py +++ b/src/screwdrivercd/version/version_types.py @@ -13,7 +13,7 @@ LOG = logging.getLogger(__name__) -class Version(): +class Version: """ Base Screwdriver Versioning class """ @@ -22,12 +22,13 @@ class Version(): setup_cfg_filename: str = 'setup.cfg' _meta_version: str = '' - def __init__(self, setup_cfg_filename=None, ignore_meta_version: bool=False, update_sdv4_meta: bool=True, meta_command: str='meta'): + def __init__(self, setup_cfg_filename=None, ignore_meta_version: bool = False, update_sdv4_meta: bool = True, link_to_commit: bool = False, meta_command: str = 'meta'): if setup_cfg_filename: # pragma: no cover self.setup_cfg_filename = setup_cfg_filename self.meta_command = meta_command self.ignore_meta_version = ignore_meta_version self.update_sdv4_meta = update_sdv4_meta + self.link_to_commit = link_to_commit def __repr__(self): return repr(self.version) @@ -67,18 +68,29 @@ def generate(self): """ return self.read_setup_version() + def get_link_to_commit_using_hash(self): + """ + Generate and return link to build-triggering commit using its SHA hash + """ + if self.link_to_commit and os.environ.get('SCM_URL') and os.environ.get('SD_BUILD_SHA'): + return os.environ.get('SCM_URL') + '/commit/' + os.environ.get('SD_BUILD_SHA') + return '' + def update_setup_cfg_metadata(self): """ Update the version value in the setup.cfg file """ if not self.version: # pragma: no cover return + link_to_commit = self.get_link_to_commit_using_hash() config = configparser.ConfigParser() config.read(self.setup_cfg_filename) if 'metadata' not in config.sections(): config['metadata'] = {} config['metadata']['version'] = self.version + if link_to_commit: + config['metadata']['link_to_commit'] = link_to_commit with open(self.setup_cfg_filename, 'w') as config_file_handle: config.write(config_file_handle) @@ -187,7 +199,7 @@ def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) def revision_value(self): # pragma: no cover - "Method to return a newly generatated revision value" + """Method to return a newly generated revision value""" return self.default_revision_value def generate(self): # pragma: no cover @@ -245,6 +257,7 @@ class VersionSDV4Build(VersionUpdateRevision): Each new screwdriver job run will increment the revision number. """ name = 'sdv4_SD_BUILD' + def revision_value(self): revision = os.environ.get('SD_BUILD', None) if not revision: @@ -305,6 +318,6 @@ def generate(self): } # Make sure the versioners are listed all lowercase to make identifying them easier -for key, value in list(versioners.items()): +for key, value in list(versioners.items()): if key.lower() not in versioners.keys(): versioners[key.lower()] = value From 28d992aa0b932e982d2bf34fcd622d32462759a5 Mon Sep 17 00:00:00 2001 From: Abhishek Patra Date: Sat, 27 Mar 2021 19:10:57 +0530 Subject: [PATCH 03/24] Add tests --- tests/test_versioners.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/test_versioners.py b/tests/test_versioners.py index 3821b5d..7dd19b5 100644 --- a/tests/test_versioners.py +++ b/tests/test_versioners.py @@ -14,13 +14,28 @@ class TestVersioners(ScrewdriverTestCase): environ_keys = { 'BASE_PYTHON', 'PACKAGE_DIR', 'PACKAGE_DIRECTORY', 'SD_ARTIFACTS_DIR', 'SD_BUILD', 'SD_BUILD_ID', - 'SD_PULL_REQUEST', + 'SD_PULL_REQUEST', 'SCM_URL', 'SD_BUILD_SHA', } def test__version__read_setup_version__no_version(self): version = Version(ignore_meta_version=True).read_setup_version() self.assertEqual(version, Version.default_version) + def test__version__get_link_to_commit_using_hash__unset_env_variables(self): + version = Version(ignore_meta_version=True, link_to_commit=True).get_link_to_commit_using_hash() + self.assertEqual(version.get_link_to_commit_using_hash(), '') + + def test__version__get_link_to_commit_using_hash__set_and_unset_env_variables(self): + os.environ['SD_BUILD_SHA'] = 'a5c3785ed8d6a35868bc169f07e40e889087fd2e' + version = Version(ignore_meta_version=True, link_to_commit=True).get_link_to_commit_using_hash() + self.assertEqual(version.get_link_to_commit_using_hash(), '') + + def test__version__get_link_to_commit_using_hash__set_env_variables(self): + os.environ['SCM_URL'] = 'https://github.com' + os.environ['SD_BUILD_SHA'] = 'a5c3785ed8d6a35868bc169f07e40e889087fd2e' + version = Version(ignore_meta_version=True, link_to_commit=True).get_link_to_commit_using_hash() + self.assertEqual(version.get_link_to_commit_using_hash(), 'https://github.com/commit/a5c3785ed8d6a35868bc169f07e40e889087fd2e') + def test__manual_version_update(self): with NamedTemporaryFile('w') as file: setup_cfg_content = '[metadata]\nversion = 1.0.5' From de41072ec1fca1fbbd62d5ecbfa8286c25c21910 Mon Sep 17 00:00:00 2001 From: Abhishek Patra Date: Sat, 27 Mar 2021 20:00:06 +0530 Subject: [PATCH 04/24] Fix logical errors in tests --- tests/test_versioners.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/test_versioners.py b/tests/test_versioners.py index 7dd19b5..2f47af8 100644 --- a/tests/test_versioners.py +++ b/tests/test_versioners.py @@ -22,19 +22,19 @@ def test__version__read_setup_version__no_version(self): self.assertEqual(version, Version.default_version) def test__version__get_link_to_commit_using_hash__unset_env_variables(self): - version = Version(ignore_meta_version=True, link_to_commit=True).get_link_to_commit_using_hash() - self.assertEqual(version.get_link_to_commit_using_hash(), '') + link = Version(ignore_meta_version=True, link_to_commit=True).get_link_to_commit_using_hash() + self.assertEqual(link, '') def test__version__get_link_to_commit_using_hash__set_and_unset_env_variables(self): os.environ['SD_BUILD_SHA'] = 'a5c3785ed8d6a35868bc169f07e40e889087fd2e' - version = Version(ignore_meta_version=True, link_to_commit=True).get_link_to_commit_using_hash() - self.assertEqual(version.get_link_to_commit_using_hash(), '') + link = Version(ignore_meta_version=True, link_to_commit=True).get_link_to_commit_using_hash() + self.assertEqual(link, '') def test__version__get_link_to_commit_using_hash__set_env_variables(self): - os.environ['SCM_URL'] = 'https://github.com' + os.environ['SCM_URL'] = 'https://github.com/org/project' os.environ['SD_BUILD_SHA'] = 'a5c3785ed8d6a35868bc169f07e40e889087fd2e' - version = Version(ignore_meta_version=True, link_to_commit=True).get_link_to_commit_using_hash() - self.assertEqual(version.get_link_to_commit_using_hash(), 'https://github.com/commit/a5c3785ed8d6a35868bc169f07e40e889087fd2e') + link = Version(ignore_meta_version=True, link_to_commit=True).get_link_to_commit_using_hash() + self.assertEqual(link, 'https://github.com/org/project/commit/a5c3785ed8d6a35868bc169f07e40e889087fd2e') def test__manual_version_update(self): with NamedTemporaryFile('w') as file: From 888fbd07ce43add1d6dce84be5269a42277b1823 Mon Sep 17 00:00:00 2001 From: Abhishek Patra Date: Sat, 27 Mar 2021 22:20:59 +0530 Subject: [PATCH 05/24] Add link to source project tree instead of commit in package metadata --- src/screwdrivercd/version/arguments.py | 6 +++--- src/screwdrivercd/version/cli.py | 2 +- src/screwdrivercd/version/version_types.py | 16 ++++++++-------- tests/test_versioners.py | 14 +++++++------- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/screwdrivercd/version/arguments.py b/src/screwdrivercd/version/arguments.py index c190b2e..395234f 100644 --- a/src/screwdrivercd/version/arguments.py +++ b/src/screwdrivercd/version/arguments.py @@ -56,8 +56,8 @@ def parse_arguments(): version_type = get_config_default('version_type', default='default') update_meta = get_config_default('update_screwdriver_meta', default='false') update_meta = get_bool_equivalent(update_meta) - link_to_commit = get_config_default('link_to_commit', default='false') - link_to_commit = get_bool_equivalent(link_to_commit) + link_to_project = get_config_default('link_to_project', default='false') + link_to_project = get_bool_equivalent(link_to_project) version_choices = list(versioners.keys()) if version_type not in version_choices: @@ -68,6 +68,6 @@ def parse_arguments(): parser.add_argument('--version_type', default=version_type, choices=version_choices, help='Type of version number to generate') parser.add_argument('--ignore_meta', default=False, action='store_true', help='Ignore the screwdriver v4 metadata') parser.add_argument('--update_meta', default=update_meta, action='store_true', help='Update the screwdriver v4 metadata with the new version') - parser.add_argument('--link_to_commit', default=link_to_commit, action='store_true', help='Add/update link to build-triggering commit using its SHA hash') + parser.add_argument('--link_to_project', default=link_to_project, action='store_true', help='Add/update link to source project tree for current package version') result = parser.parse_args() return result diff --git a/src/screwdrivercd/version/cli.py b/src/screwdrivercd/version/cli.py index 1ee31e1..79a9ca5 100644 --- a/src/screwdrivercd/version/cli.py +++ b/src/screwdrivercd/version/cli.py @@ -24,7 +24,7 @@ def main(): if args.force_update or setupcfg_has_metadata(): versioner = versioners[args.version_type] print(f'Updating version using the {versioner.name} version plugin', flush=True) - version = versioner(ignore_meta_version=args.ignore_meta, update_sdv4_meta=args.update_meta, link_to_commit=args.link_to_commit) + version = versioner(ignore_meta_version=args.ignore_meta, update_sdv4_meta=args.update_meta, link_to_project=args.link_to_project) version.update_setup_cfg_metadata() if args.update_meta: diff --git a/src/screwdrivercd/version/version_types.py b/src/screwdrivercd/version/version_types.py index 0b2ed01..d89308f 100644 --- a/src/screwdrivercd/version/version_types.py +++ b/src/screwdrivercd/version/version_types.py @@ -22,13 +22,13 @@ class Version: setup_cfg_filename: str = 'setup.cfg' _meta_version: str = '' - def __init__(self, setup_cfg_filename=None, ignore_meta_version: bool = False, update_sdv4_meta: bool = True, link_to_commit: bool = False, meta_command: str = 'meta'): + def __init__(self, setup_cfg_filename=None, ignore_meta_version: bool = False, update_sdv4_meta: bool = True, link_to_project: bool = False, meta_command: str = 'meta'): if setup_cfg_filename: # pragma: no cover self.setup_cfg_filename = setup_cfg_filename self.meta_command = meta_command self.ignore_meta_version = ignore_meta_version self.update_sdv4_meta = update_sdv4_meta - self.link_to_commit = link_to_commit + self.link_to_project = link_to_project def __repr__(self): return repr(self.version) @@ -68,12 +68,12 @@ def generate(self): """ return self.read_setup_version() - def get_link_to_commit_using_hash(self): + def get_link_to_project_using_hash(self): """ Generate and return link to build-triggering commit using its SHA hash """ - if self.link_to_commit and os.environ.get('SCM_URL') and os.environ.get('SD_BUILD_SHA'): - return os.environ.get('SCM_URL') + '/commit/' + os.environ.get('SD_BUILD_SHA') + if self.link_to_project and os.environ.get('SCM_URL') and os.environ.get('SD_BUILD_SHA'): + return os.environ.get('SCM_URL') + '/tree/' + os.environ.get('SD_BUILD_SHA') return '' def update_setup_cfg_metadata(self): @@ -82,15 +82,15 @@ def update_setup_cfg_metadata(self): """ if not self.version: # pragma: no cover return - link_to_commit = self.get_link_to_commit_using_hash() + link_to_project = self.get_link_to_project_using_hash() config = configparser.ConfigParser() config.read(self.setup_cfg_filename) if 'metadata' not in config.sections(): config['metadata'] = {} config['metadata']['version'] = self.version - if link_to_commit: - config['metadata']['link_to_commit'] = link_to_commit + if link_to_project: + config['metadata']['link_to_project'] = link_to_project with open(self.setup_cfg_filename, 'w') as config_file_handle: config.write(config_file_handle) diff --git a/tests/test_versioners.py b/tests/test_versioners.py index 2f47af8..672ba33 100644 --- a/tests/test_versioners.py +++ b/tests/test_versioners.py @@ -21,20 +21,20 @@ def test__version__read_setup_version__no_version(self): version = Version(ignore_meta_version=True).read_setup_version() self.assertEqual(version, Version.default_version) - def test__version__get_link_to_commit_using_hash__unset_env_variables(self): - link = Version(ignore_meta_version=True, link_to_commit=True).get_link_to_commit_using_hash() + def test__version__get_link_to_project_using_hash__unset_env_variables(self): + link = Version(ignore_meta_version=True, link_to_project=True).get_link_to_project_using_hash() self.assertEqual(link, '') - def test__version__get_link_to_commit_using_hash__set_and_unset_env_variables(self): + def test__version__get_link_to_project_using_hash__set_and_unset_env_variables(self): os.environ['SD_BUILD_SHA'] = 'a5c3785ed8d6a35868bc169f07e40e889087fd2e' - link = Version(ignore_meta_version=True, link_to_commit=True).get_link_to_commit_using_hash() + link = Version(ignore_meta_version=True, link_to_project=True).get_link_to_project_using_hash() self.assertEqual(link, '') - def test__version__get_link_to_commit_using_hash__set_env_variables(self): + def test__version__get_link_to_project_using_hash__set_env_variables(self): os.environ['SCM_URL'] = 'https://github.com/org/project' os.environ['SD_BUILD_SHA'] = 'a5c3785ed8d6a35868bc169f07e40e889087fd2e' - link = Version(ignore_meta_version=True, link_to_commit=True).get_link_to_commit_using_hash() - self.assertEqual(link, 'https://github.com/org/project/commit/a5c3785ed8d6a35868bc169f07e40e889087fd2e') + link = Version(ignore_meta_version=True, link_to_project=True).get_link_to_project_using_hash() + self.assertEqual(link, 'https://github.com/org/project/tree/a5c3785ed8d6a35868bc169f07e40e889087fd2e') def test__manual_version_update(self): with NamedTemporaryFile('w') as file: From 92b93cbfff0cc355f6ce015344ae4ca8e9fa5634 Mon Sep 17 00:00:00 2001 From: Dwight Hubbard Date: Thu, 23 Jun 2022 15:15:53 -0700 Subject: [PATCH 06/24] Updated version --- setup.cfg | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/setup.cfg b/setup.cfg index cc79116..d088563 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] author = Verizon Media Python Platform Team -author_email = python@verizonmedia.com +author_email = python@yahooinc.com classifiers = Development Status :: 5 - Production/Stable Intended Audience :: Developers @@ -15,18 +15,18 @@ keywords = ci, cd, screwdriver long_description = file:README.md long_description_content_type = text/markdown name = screwdrivercd -project_urls = - Documentation = https://yahoo.github.io/python-screwdrivercd/ - Source = https://github.com/yahoo/python-screwdrivercd - Change Log = https://yahoo.github.io/python-screwdrivercd/changelog/ - CI Pipeline = https://cd.screwdriver.cd/pipelines/3063 +project_urls = Documentation = https://yahoo.github.io/python-screwdrivercd/] + Source = https://github.com/yahoo/python-screwdrivercd] + Change Log = https://yahoo.github.io/python-screwdrivercd/changelog/] + CI Pipeline = https://cd.screwdriver.cd/pipelines/3063] + Source=https://github.com/org/project/tree/a5c3785ed8d6a35868bc169f07e40e889087fd2e] url = https://github.com/yahoo/python-screwdrivercd version = 0.3.0 [options] namespace_packages = screwdrivercd -packages = +packages = screwdrivercd.changelog screwdrivercd.documentation screwdrivercd.documentation.mkdocs @@ -63,7 +63,7 @@ python_requires = >="3.6" zip_safe = True [options.entry_points] -console_scripts = +console_scripts = screwdrivercd_changelog=screwdrivercd.changelog.generate:main screwdrivercd_documentation=screwdrivercd.documentation.cli:main screwdrivercd_install_deps=screwdrivercd.installdeps.cli:main @@ -78,8 +78,7 @@ console_scripts = screwdrivercd_validate_style=screwdrivercd.validation.validate_style:main screwdrivercd_validate_type=screwdrivercd.validation.validate_type:main screwdrivercd_validate_unittest=screwdrivercd.validation.validate_unittest:main - -screwdrivercd.documentation.plugin = +screwdrivercd.documentation.plugin = base = screwdrivercd.documentation.plugin:DocumentationPlugin mkdocs = screwdrivercd.documentation.mkdocs.plugin:MkDocsDocumentationPlugin mkdocs_venv = screwdrivercd.documentation.mkdocs.plugin:MkDocsDocumentationVenvPlugin @@ -87,9 +86,6 @@ screwdrivercd.documentation.plugin = [options.extras_require] documentation = - # dhubbard-sphinx-markdown-tables - # markdown<3.2 # This is only needed for the mkdocs-material package to install - # pymdown-extensions<6.3 # This is needed to allow markdown < 3.2 to install markdown pymdown-extensions markdown-include @@ -98,10 +94,7 @@ documentation = mkdocs-material pygments recommonmark -doc_build = - # dhubbard-sphinx-markdown-tables - # markdown<3.2 # This is only needed for the mkdocs-material package to install - # pymdown-extensions<6.3 # This is needed to allow markdown < 3.2 to install +doc_build = markdown pymdown-extensions markdown-include @@ -109,7 +102,7 @@ doc_build = mkdocs-material pygments recommonmark -test = +test = pytest pytest-cov pypirun From d173e2bd57d76cb5bf12242f1bbc0cbab62a4180 Mon Sep 17 00:00:00 2001 From: Dwight Hubbard Date: Thu, 23 Jun 2022 15:27:42 -0700 Subject: [PATCH 07/24] Updated version --- setup.cfg | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/setup.cfg b/setup.cfg index d088563..68cef11 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,11 +15,12 @@ keywords = ci, cd, screwdriver long_description = file:README.md long_description_content_type = text/markdown name = screwdrivercd -project_urls = Documentation = https://yahoo.github.io/python-screwdrivercd/] - Source = https://github.com/yahoo/python-screwdrivercd] - Change Log = https://yahoo.github.io/python-screwdrivercd/changelog/] - CI Pipeline = https://cd.screwdriver.cd/pipelines/3063] - Source=https://github.com/org/project/tree/a5c3785ed8d6a35868bc169f07e40e889087fd2e] +project_urls = + Documentation = https://yahoo.github.io/python-screwdrivercd/ + Source = https://github.com/yahoo/python-screwdrivercd + Change Log = https://yahoo.github.io/python-screwdrivercd/changelog/ + CI Pipeline = https://cd.screwdriver.cd/pipelines/3063 + Source=https://github.com/org/project/tree/a5c3785ed8d6a35868bc169f07e40e889087fd2e url = https://github.com/yahoo/python-screwdrivercd version = 0.3.0 From ae9e908ea266a8544492ef44405658966d391991 Mon Sep 17 00:00:00 2001 From: Dwight Hubbard Date: Thu, 23 Jun 2022 15:38:58 -0700 Subject: [PATCH 08/24] Updated version --- setup.cfg | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/setup.cfg b/setup.cfg index 68cef11..ddc8d18 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,11 +16,10 @@ long_description = file:README.md long_description_content_type = text/markdown name = screwdrivercd project_urls = - Documentation = https://yahoo.github.io/python-screwdrivercd/ - Source = https://github.com/yahoo/python-screwdrivercd - Change Log = https://yahoo.github.io/python-screwdrivercd/changelog/ - CI Pipeline = https://cd.screwdriver.cd/pipelines/3063 - Source=https://github.com/org/project/tree/a5c3785ed8d6a35868bc169f07e40e889087fd2e + Documentation = https://yahoo.github.io/python-screwdrivercd/ + Source = https://github.com/yahoo/python-screwdrivercd + Change Log = https://yahoo.github.io/python-screwdrivercd/changelog/ + CI Pipeline = https://cd.screwdriver.cd/pipelines/3063 url = https://github.com/yahoo/python-screwdrivercd version = 0.3.0 From 63e8dc1b1752ff8496c1661b79fec68099b24440 Mon Sep 17 00:00:00 2001 From: Dwight Hubbard Date: Thu, 23 Jun 2022 15:39:28 -0700 Subject: [PATCH 09/24] Updated version --- setup.cfg | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/setup.cfg b/setup.cfg index ddc8d18..eb8dfa7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,10 +16,11 @@ long_description = file:README.md long_description_content_type = text/markdown name = screwdrivercd project_urls = - Documentation = https://yahoo.github.io/python-screwdrivercd/ - Source = https://github.com/yahoo/python-screwdrivercd - Change Log = https://yahoo.github.io/python-screwdrivercd/changelog/ - CI Pipeline = https://cd.screwdriver.cd/pipelines/3063 + Documentation = https://yahoo.github.io/python-screwdrivercd/ + Source = https://github.com/yahoo/python-screwdrivercd + Change Log = https://yahoo.github.io/python-screwdrivercd/changelog/ + CI Pipeline = https://cd.screwdriver.cd/pipelines/3063 + Source = https://github.com/org/project/tree/a5c3785ed8d6a35868bc169f07e40e889087fd2e url = https://github.com/yahoo/python-screwdrivercd version = 0.3.0 From cf5eda701abb449bd0601fb0632243a2240d4ea1 Mon Sep 17 00:00:00 2001 From: Dwight Hubbard Date: Thu, 23 Jun 2022 15:42:27 -0700 Subject: [PATCH 10/24] Updated version --- setup.cfg | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/setup.cfg b/setup.cfg index eb8dfa7..ed9363a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,11 +16,10 @@ long_description = file:README.md long_description_content_type = text/markdown name = screwdrivercd project_urls = - Documentation = https://yahoo.github.io/python-screwdrivercd/ - Source = https://github.com/yahoo/python-screwdrivercd - Change Log = https://yahoo.github.io/python-screwdrivercd/changelog/ - CI Pipeline = https://cd.screwdriver.cd/pipelines/3063 + Documentation = https://yahoo.github.io/python-screwdrivercd/ Source = https://github.com/org/project/tree/a5c3785ed8d6a35868bc169f07e40e889087fd2e + Change Log = https://yahoo.github.io/python-screwdrivercd/changelog/ + CI Pipeline = https://cd.screwdriver.cd/pipelines/3063 url = https://github.com/yahoo/python-screwdrivercd version = 0.3.0 From c57ad9d71d7ae66b1560a27c99611ef3b426c416 Mon Sep 17 00:00:00 2001 From: Dwight Hubbard Date: Thu, 23 Jun 2022 15:44:35 -0700 Subject: [PATCH 11/24] Updated version --- setup.cfg | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.cfg b/setup.cfg index ed9363a..e36f4e4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,10 +16,10 @@ long_description = file:README.md long_description_content_type = text/markdown name = screwdrivercd project_urls = - Documentation = https://yahoo.github.io/python-screwdrivercd/ - Source = https://github.com/org/project/tree/a5c3785ed8d6a35868bc169f07e40e889087fd2e - Change Log = https://yahoo.github.io/python-screwdrivercd/changelog/ - CI Pipeline = https://cd.screwdriver.cd/pipelines/3063 + Documentation = https://yahoo.github.io/python-screwdrivercd/ + Source = https://github.com/org/project/tree/a5c3785ed8d6a35868bc169f07e40e889087fd2e + Change Log = https://yahoo.github.io/python-screwdrivercd/changelog/ + CI Pipeline = https://cd.screwdriver.cd/pipelines/3063 url = https://github.com/yahoo/python-screwdrivercd version = 0.3.0 From c59a47f7baec51de6ea1cac0e16264a37a5bd834 Mon Sep 17 00:00:00 2001 From: Dwight Hubbard Date: Thu, 23 Jun 2022 16:11:39 -0700 Subject: [PATCH 12/24] Updated version --- setup.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index e36f4e4..0ad9405 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,7 +17,7 @@ long_description_content_type = text/markdown name = screwdrivercd project_urls = Documentation = https://yahoo.github.io/python-screwdrivercd/ - Source = https://github.com/org/project/tree/a5c3785ed8d6a35868bc169f07e40e889087fd2e + Source = https://github.com/yahoo/python-screwdrivercd Change Log = https://yahoo.github.io/python-screwdrivercd/changelog/ CI Pipeline = https://cd.screwdriver.cd/pipelines/3063 url = https://github.com/yahoo/python-screwdrivercd @@ -110,4 +110,5 @@ test = [screwdrivercd.version] version_type = sdv4_SD_BUILD +link_to_project = True From c6035db94308bf8051e72b0ae9e5cb7ca8b184ba Mon Sep 17 00:00:00 2001 From: Dwight Hubbard Date: Thu, 23 Jun 2022 16:13:56 -0700 Subject: [PATCH 13/24] Updated version --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 0ad9405..a95ebc6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,9 +17,9 @@ long_description_content_type = text/markdown name = screwdrivercd project_urls = Documentation = https://yahoo.github.io/python-screwdrivercd/ - Source = https://github.com/yahoo/python-screwdrivercd Change Log = https://yahoo.github.io/python-screwdrivercd/changelog/ CI Pipeline = https://cd.screwdriver.cd/pipelines/3063 + Source = https://github.com/org/project/tree/a5c3785ed8d6a35868bc169f07e40e889087fd2e url = https://github.com/yahoo/python-screwdrivercd version = 0.3.0 From dbd5cd744b91f92eb3ca855d4e9bcf897a87ccae Mon Sep 17 00:00:00 2001 From: Dwight Hubbard Date: Mon, 27 Jun 2022 17:59:51 -0700 Subject: [PATCH 14/24] Updates to unloved pr#107 - Handle both ssh and https git urls - Update the project_urls configuration argument that setuptools expects - Add more through tests to bring coverage of the new code to 100% --- src/screwdrivercd/documentation/cli.py | 2 +- src/screwdrivercd/version/version_types.py | 32 +++++++++-- tests/test_versioners.py | 64 +++++++++++++++++++++- tox.ini | 2 +- 4 files changed, 92 insertions(+), 8 deletions(-) diff --git a/src/screwdrivercd/documentation/cli.py b/src/screwdrivercd/documentation/cli.py index 48a652e..24fd75b 100644 --- a/src/screwdrivercd/documentation/cli.py +++ b/src/screwdrivercd/documentation/cli.py @@ -56,5 +56,5 @@ def main(): # pragma: no cover rc = 1 if is_pull_request(): status = 'SUCCESS' if rc == 0 else 'FAILURE' - update_job_status(status=status, message=f'{operation} {", ".join(documentation_formats)} documentation') + # update_job_status(status=status, message=f'{operation} {", ".join(documentation_formats)} documentation') return rc diff --git a/src/screwdrivercd/version/version_types.py b/src/screwdrivercd/version/version_types.py index d89308f..470f0a5 100644 --- a/src/screwdrivercd/version/version_types.py +++ b/src/screwdrivercd/version/version_types.py @@ -22,7 +22,7 @@ class Version: setup_cfg_filename: str = 'setup.cfg' _meta_version: str = '' - def __init__(self, setup_cfg_filename=None, ignore_meta_version: bool = False, update_sdv4_meta: bool = True, link_to_project: bool = False, meta_command: str = 'meta'): + def __init__(self, setup_cfg_filename=None, ignore_meta_version: bool = False, update_sdv4_meta: bool = True, meta_command: str = 'meta', link_to_project: bool = False): if setup_cfg_filename: # pragma: no cover self.setup_cfg_filename = setup_cfg_filename self.meta_command = meta_command @@ -72,8 +72,15 @@ def get_link_to_project_using_hash(self): """ Generate and return link to build-triggering commit using its SHA hash """ - if self.link_to_project and os.environ.get('SCM_URL') and os.environ.get('SD_BUILD_SHA'): - return os.environ.get('SCM_URL') + '/tree/' + os.environ.get('SD_BUILD_SHA') + scm_url = os.environ.get('SCM_URL', '') + sha = os.environ.get('SD_BUILD_SHA', '') + if self.link_to_project and scm_url and sha: + if scm_url.startswith('git@'): + hostname = scm_url.split(':')[0].split('@')[1] + path = ':'.join(scm_url.split(':')[1:]) + return f'https://{hostname}/{path}/tree/{sha}' + else: + return f'{scm_url}/tree/{sha}' return '' def update_setup_cfg_metadata(self): @@ -90,7 +97,24 @@ def update_setup_cfg_metadata(self): config['metadata']['version'] = self.version if link_to_project: - config['metadata']['link_to_project'] = link_to_project + project_urls_str = config['metadata'].get('project_urls', '') + project_urls_dict = {} + if project_urls_str: + for entry in project_urls_str.split(os.linesep): + entry = entry.strip() + if '=' in entry: + key, value = entry.split('=') + key = key.strip() + value = value.strip() + project_urls_dict[key] = value + + project_urls_dict['Source'] = link_to_project + + project_urls_str = '\n' + for key, value in project_urls_dict.items(): + project_urls_str += f'{key} = {value}\n' + + config['metadata']['project_urls'] = project_urls_str.rstrip('\n') with open(self.setup_cfg_filename, 'w') as config_file_handle: config.write(config_file_handle) diff --git a/tests/test_versioners.py b/tests/test_versioners.py index 672ba33..d744438 100644 --- a/tests/test_versioners.py +++ b/tests/test_versioners.py @@ -11,6 +11,29 @@ from screwdrivercd.version.version_types import versioners, Version, VersionGitRevisionCount, VersionSDV4Build, VersionDateSDV4Build, VersionUTCDate, VersionManualUpdate +existing_project_url_config = { + 'setup.cfg': b""" +[metadata] +author = Yahoo Python Platform Team +author_email = python@verizonmedia.com +name=mypyvalidator +project_urls = + Documentation = https://yahoo.github.io/mypyvalidator/ + Change Log = https://yahoo.github.io/python-screwdrivercd/changelog/ + CI Pipeline = https://cd.screwdriver.cd/pipelines/1 + Source = https://github.com/yahoo/mypyvalidator/tree/a5c3785ed8d6a35868bc169f07e40e889087fd2e +version=0.0.0 + +[options] +packages = + mypyvalidator + +package_dir = + =src +""" +} + + class TestVersioners(ScrewdriverTestCase): environ_keys = { 'BASE_PYTHON', 'PACKAGE_DIR', 'PACKAGE_DIRECTORY', 'SD_ARTIFACTS_DIR', 'SD_BUILD', 'SD_BUILD_ID', @@ -30,12 +53,48 @@ def test__version__get_link_to_project_using_hash__set_and_unset_env_variables(s link = Version(ignore_meta_version=True, link_to_project=True).get_link_to_project_using_hash() self.assertEqual(link, '') - def test__version__get_link_to_project_using_hash__set_env_variables(self): + def test__version__get_link_to_project_using_hash__set_env_variables__https_git(self): os.environ['SCM_URL'] = 'https://github.com/org/project' os.environ['SD_BUILD_SHA'] = 'a5c3785ed8d6a35868bc169f07e40e889087fd2e' - link = Version(ignore_meta_version=True, link_to_project=True).get_link_to_project_using_hash() + ver = Version(ignore_meta_version=True, link_to_project=True) + link = ver.get_link_to_project_using_hash() + self.assertEqual(link, 'https://github.com/org/project/tree/a5c3785ed8d6a35868bc169f07e40e889087fd2e') + + ver.update_setup_cfg_metadata() + self.assertTrue(os.path.exists('setup.cfg')) + with open('setup.cfg') as fh: + setup_cfg = fh.read() + self.assertIn(link, setup_cfg) + + def test__version__get_link_to_project_using_hash__set_env_variables__https_git__existing_project_urls(self): + os.environ['SCM_URL'] = 'https://github.com/org/project' + os.environ['SD_BUILD_SHA'] = 'a5c3785ed8d6a35868bc169f07e40e889087fd2e' + self.write_config_files(existing_project_url_config) + + ver = Version(ignore_meta_version=True, link_to_project=True) + link = ver.get_link_to_project_using_hash() self.assertEqual(link, 'https://github.com/org/project/tree/a5c3785ed8d6a35868bc169f07e40e889087fd2e') + ver.update_setup_cfg_metadata() + self.assertTrue(os.path.exists('setup.cfg')) + with open('setup.cfg') as fh: + setup_cfg = fh.read() + self.assertIn(link, setup_cfg) + self.assertIn('Documentation = https://yahoo.github.io/mypyvalidator/', setup_cfg) + + def test__version__get_link_to_project_using_hash__set_env_variables__ssh_git(self): + os.environ['SCM_URL'] = 'git@github.com:org/project' + os.environ['SD_BUILD_SHA'] = 'a5c3785ed8d6a35868bc169f07e40e889087fd2e' + ver = Version(ignore_meta_version=True, link_to_project=True) + link = ver.get_link_to_project_using_hash() + self.assertEqual(link, 'https://github.com/org/project/tree/a5c3785ed8d6a35868bc169f07e40e889087fd2e') + + ver.update_setup_cfg_metadata() + self.assertTrue(os.path.exists('setup.cfg')) + with open('setup.cfg') as fh: + setup_cfg = fh.read() + self.assertIn(link, setup_cfg) + def test__manual_version_update(self): with NamedTemporaryFile('w') as file: setup_cfg_content = '[metadata]\nversion = 1.0.5' @@ -92,6 +151,7 @@ def test__sdv4_SD_BUILD__set(self): def test__sdv4_SD_BUILD__PR__unset(self): self.delkeys(['SD_BUILD', 'SD_BUILD_ID', 'SD_PULL_REQUEST']) + os.environ['SD_PULL_REQUEST'] = '1' with self.assertRaises(VersionError): version = str(VersionSDV4Build(ignore_meta_version=True, log_errors=False)) diff --git a/tox.ini b/tox.ini index 3e425d7..ddf0e18 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ package_dir = src/screwdrivercd package_name = screwdrivercd [tox] -envlist = py36,py37,py38,py39 +envlist = py37,py38,py39,py310 skip_missing_interpreters = true [testenv] From 3396321fa701d96c9053399bda74f5cce4ed0174 Mon Sep 17 00:00:00 2001 From: Dwight Hubbard Date: Mon, 27 Jun 2022 18:11:29 -0700 Subject: [PATCH 15/24] Updates to unloved pr#107 - Handle both ssh and https git urls - Update the project_urls configuration argument that setuptools expects - Add more through tests to bring coverage of the new code to 100% --- tests/test_validators.py | 1 - tests/test_versioners.py | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/test_validators.py b/tests/test_validators.py index a03ab27..6640b89 100644 --- a/tests/test_validators.py +++ b/tests/test_validators.py @@ -5,7 +5,6 @@ import sys from json import dumps -from unittest import skip from screwdrivercd.packaging.build_python import build_sdist_package, build_wheel_packages from screwdrivercd.utility.environment import standard_directories diff --git a/tests/test_versioners.py b/tests/test_versioners.py index d744438..65e054d 100644 --- a/tests/test_versioners.py +++ b/tests/test_versioners.py @@ -18,10 +18,10 @@ author_email = python@verizonmedia.com name=mypyvalidator project_urls = - Documentation = https://yahoo.github.io/mypyvalidator/ - Change Log = https://yahoo.github.io/python-screwdrivercd/changelog/ - CI Pipeline = https://cd.screwdriver.cd/pipelines/1 - Source = https://github.com/yahoo/mypyvalidator/tree/a5c3785ed8d6a35868bc169f07e40e889087fd2e + Documentation = https://yahoo.github.io/mypyvalidator/ + Change Log = https://yahoo.github.io/python-screwdrivercd/changelog/ + CI Pipeline = https://cd.screwdriver.cd/pipelines/1 + Source = https://github.com/yahoo/mypyvalidator/tree/a5c3785ed8d6a35868bc169f07e40e889087fd2e version=0.0.0 [options] From 841448f9f9e844c4e9deaf8b840e6c1ab51401d0 Mon Sep 17 00:00:00 2001 From: Dwight Hubbard Date: Mon, 27 Jun 2022 18:12:58 -0700 Subject: [PATCH 16/24] Updates to unloved pr#107 - Handle both ssh and https git urls - Update the project_urls configuration argument that setuptools expects - Add more through tests to bring coverage of the new code to 100% --- setup.cfg | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/setup.cfg b/setup.cfg index a95ebc6..665343e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,16 +17,16 @@ long_description_content_type = text/markdown name = screwdrivercd project_urls = Documentation = https://yahoo.github.io/python-screwdrivercd/ + Source = https://github.com/yahoo/python-screwdrivercd Change Log = https://yahoo.github.io/python-screwdrivercd/changelog/ CI Pipeline = https://cd.screwdriver.cd/pipelines/3063 - Source = https://github.com/org/project/tree/a5c3785ed8d6a35868bc169f07e40e889087fd2e url = https://github.com/yahoo/python-screwdrivercd version = 0.3.0 [options] namespace_packages = screwdrivercd -packages = +packages = screwdrivercd.changelog screwdrivercd.documentation screwdrivercd.documentation.mkdocs @@ -63,7 +63,7 @@ python_requires = >="3.6" zip_safe = True [options.entry_points] -console_scripts = +console_scripts = screwdrivercd_changelog=screwdrivercd.changelog.generate:main screwdrivercd_documentation=screwdrivercd.documentation.cli:main screwdrivercd_install_deps=screwdrivercd.installdeps.cli:main @@ -78,7 +78,8 @@ console_scripts = screwdrivercd_validate_style=screwdrivercd.validation.validate_style:main screwdrivercd_validate_type=screwdrivercd.validation.validate_type:main screwdrivercd_validate_unittest=screwdrivercd.validation.validate_unittest:main -screwdrivercd.documentation.plugin = + +screwdrivercd.documentation.plugin = base = screwdrivercd.documentation.plugin:DocumentationPlugin mkdocs = screwdrivercd.documentation.mkdocs.plugin:MkDocsDocumentationPlugin mkdocs_venv = screwdrivercd.documentation.mkdocs.plugin:MkDocsDocumentationVenvPlugin @@ -86,6 +87,9 @@ screwdrivercd.documentation.plugin = [options.extras_require] documentation = + # dhubbard-sphinx-markdown-tables + # markdown<3.2 # This is only needed for the mkdocs-material package to install + # pymdown-extensions<6.3 # This is needed to allow markdown < 3.2 to install markdown pymdown-extensions markdown-include @@ -94,7 +98,10 @@ documentation = mkdocs-material pygments recommonmark -doc_build = +doc_build = + # dhubbard-sphinx-markdown-tables + # markdown<3.2 # This is only needed for the mkdocs-material package to install + # pymdown-extensions<6.3 # This is needed to allow markdown < 3.2 to install markdown pymdown-extensions markdown-include @@ -102,7 +109,7 @@ doc_build = mkdocs-material pygments recommonmark -test = +test = pytest pytest-cov pypirun @@ -110,5 +117,4 @@ test = [screwdrivercd.version] version_type = sdv4_SD_BUILD -link_to_project = True From 1cb68d24b76de61b90c3a15682257aa449e86f50 Mon Sep 17 00:00:00 2001 From: Dwight Hubbard Date: Mon, 27 Jun 2022 18:25:48 -0700 Subject: [PATCH 17/24] Updates to unloved pr#107 - Handle both ssh and https git urls - Update the project_urls configuration argument that setuptools expects - Add more through tests to bring coverage of the new code to 100% --- changelog.d/107.feature.md | 1 + docs/Versioning.md | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 changelog.d/107.feature.md diff --git a/changelog.d/107.feature.md b/changelog.d/107.feature.md new file mode 100644 index 0000000..54b1b7e --- /dev/null +++ b/changelog.d/107.feature.md @@ -0,0 +1 @@ +Add a `link_to_project` flag that will update the package project_urls in the setup.cfg with a link to the source code for the package. \ No newline at end of file diff --git a/docs/Versioning.md b/docs/Versioning.md index 3651b8f..ba4f53e 100644 --- a/docs/Versioning.md +++ b/docs/Versioning.md @@ -46,13 +46,14 @@ The following settings are supported: The setup.cfg go under the `screwdrivercd.verison` setting. -| Setting | Default Value | Description | -| ------------- | ------------------ | ----------------------------------------------------------------------- | -| version_type | git_revision_count | The versioning format to generate, choices: | -| | | git_revision_count - Update the last digit the number of git revisions | -| | | sdv4_sd_build - Update the last digit with the value of the SD_BUILD environment variable | -| | | utc_date - Generate a version based on the date, format: year.monthday.hourminutesecond | -| | | sdv4_date - Generate a version based on the date and SD_BUILD environment variable, format: year.month.SD_BUILD | +| Setting | Default Value | Description | +|-----------------|--------------------|-----------------------------------------------------------------------------------------------------------------| +| version_type | git_revision_count | The versioning format to generate, choices: | +| | | git_revision_count - Update the last digit the number of git revisions | +| | | sdv4_sd_build - Update the last digit with the value of the SD_BUILD environment variable | +| | | utc_date - Generate a version based on the date, format: year.monthday.hourminutesecond | +| | | sdv4_date - Generate a version based on the date and SD_BUILD environment variable, format: year.month.SD_BUILD | + | link_to_project | False | If set to True, a link to the source repo will be added to [metadata]project_urls in setup.cfg | ### Example From 3a092b6341f9ff98c38897720b832f79314f4fe7 Mon Sep 17 00:00:00 2001 From: Dwight Hubbard Date: Mon, 27 Jun 2022 18:34:43 -0700 Subject: [PATCH 18/24] Updates to unloved pr#107 - Handle both ssh and https git urls - Update the project_urls configuration argument that setuptools expects - Add more through tests to bring coverage of the new code to 100% --- screwdriver.yaml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/screwdriver.yaml b/screwdriver.yaml index 46921b3..3cfd670 100644 --- a/screwdriver.yaml +++ b/screwdriver.yaml @@ -14,27 +14,23 @@ shared: jobs: validate_codestyle: - template: python/validate_codestyle + template: python-2014/validate_style environment: CODESTYLE_ARGS: -v steps: - postinstall_dependencies: $BASE_PYTHON -m pip install -U . requires: [~commit, ~pr] - validate_dependencies: - template: python/validate_dependencies - requires: [~commit, ~pr] - validate_lint: - template: python/validate_lint + template: python-2104/validate_lint requires: [~commit, ~pr] validate_security: - template: python/validate_security + template: python-2014/validate_security requires: [~commit, ~pr] validate_test: - template: python/validate_unittest + template: python-2104/validate_unittest steps: - postupdate_version: | PACKAGE_VERSION="`meta get package.version`" @@ -49,9 +45,9 @@ jobs: # requires: [~commit, ~pr] version: - template: python/generate_version + template: python-2104/version requires: [ - validate_test, validate_lint, validate_codestyle, validate_dependencies, validate_security, + validate_test, validate_lint, validate_codestyle, validate_security, # validate_type ] From 7f1a33f796748a8a77d47e25000f49c1fc687cc1 Mon Sep 17 00:00:00 2001 From: Dwight Hubbard Date: Mon, 27 Jun 2022 23:45:57 -0700 Subject: [PATCH 19/24] Updates to unloved pr#107 - Handle both ssh and https git urls - Update the project_urls configuration argument that setuptools expects - Add more through tests to bring coverage of the new code to 100% --- screwdriver.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/screwdriver.yaml b/screwdriver.yaml index 3cfd670..1595647 100644 --- a/screwdriver.yaml +++ b/screwdriver.yaml @@ -14,7 +14,7 @@ shared: jobs: validate_codestyle: - template: python-2014/validate_style + template: python-2104/validate_style environment: CODESTYLE_ARGS: -v steps: From 7be14942d4af961f904356b8943b84053b332cb6 Mon Sep 17 00:00:00 2001 From: Dwight Hubbard Date: Mon, 27 Jun 2022 23:47:36 -0700 Subject: [PATCH 20/24] Updates to unloved pr#107 - Handle both ssh and https git urls - Update the project_urls configuration argument that setuptools expects - Add more through tests to bring coverage of the new code to 100% --- screwdriver.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/screwdriver.yaml b/screwdriver.yaml index 1595647..92c9073 100644 --- a/screwdriver.yaml +++ b/screwdriver.yaml @@ -26,7 +26,7 @@ jobs: requires: [~commit, ~pr] validate_security: - template: python-2014/validate_security + template: python/validate_security requires: [~commit, ~pr] validate_test: From 4aa61a57813a8fefe74f6493bc13027cec33364f Mon Sep 17 00:00:00 2001 From: Dwight Hubbard Date: Mon, 27 Jun 2022 23:49:49 -0700 Subject: [PATCH 21/24] Updates to unloved pr#107 - Handle both ssh and https git urls - Update the project_urls configuration argument that setuptools expects - Add more through tests to bring coverage of the new code to 100% --- screwdriver.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/screwdriver.yaml b/screwdriver.yaml index 92c9073..983bb6b 100644 --- a/screwdriver.yaml +++ b/screwdriver.yaml @@ -14,7 +14,7 @@ shared: jobs: validate_codestyle: - template: python-2104/validate_style + template: python/validate_style environment: CODESTYLE_ARGS: -v steps: @@ -22,7 +22,7 @@ jobs: requires: [~commit, ~pr] validate_lint: - template: python-2104/validate_lint + template: python/validate_lint requires: [~commit, ~pr] validate_security: @@ -30,7 +30,7 @@ jobs: requires: [~commit, ~pr] validate_test: - template: python-2104/validate_unittest + template: python/validate_unittest steps: - postupdate_version: | PACKAGE_VERSION="`meta get package.version`" @@ -45,7 +45,7 @@ jobs: # requires: [~commit, ~pr] version: - template: python-2104/version + template: python/version requires: [ validate_test, validate_lint, validate_codestyle, validate_security, # validate_type From 9cf9ae18ca8a2f2a27f5bfba1b503b22c8bb5aae Mon Sep 17 00:00:00 2001 From: Dwight Hubbard Date: Mon, 27 Jun 2022 23:51:47 -0700 Subject: [PATCH 22/24] Updates to unloved pr#107 - Handle both ssh and https git urls - Update the project_urls configuration argument that setuptools expects - Add more through tests to bring coverage of the new code to 100% --- screwdriver.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/screwdriver.yaml b/screwdriver.yaml index 983bb6b..e1b54d9 100644 --- a/screwdriver.yaml +++ b/screwdriver.yaml @@ -14,7 +14,7 @@ shared: jobs: validate_codestyle: - template: python/validate_style + template: python/validate_codestyle environment: CODESTYLE_ARGS: -v steps: From ef4d5a6388dabb23a77037709d39f9039c5d6e65 Mon Sep 17 00:00:00 2001 From: Dwight Hubbard Date: Mon, 27 Jun 2022 23:53:38 -0700 Subject: [PATCH 23/24] Updates to unloved pr#107 - Handle both ssh and https git urls - Update the project_urls configuration argument that setuptools expects - Add more through tests to bring coverage of the new code to 100% --- screwdriver.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/screwdriver.yaml b/screwdriver.yaml index e1b54d9..af27005 100644 --- a/screwdriver.yaml +++ b/screwdriver.yaml @@ -45,7 +45,7 @@ jobs: # requires: [~commit, ~pr] version: - template: python/version + template: python/generate_version requires: [ validate_test, validate_lint, validate_codestyle, validate_security, # validate_type From 3e563009a03a7a7a0419b1ee9a82b8bc174ae79d Mon Sep 17 00:00:00 2001 From: Dwight Hubbard Date: Tue, 28 Jun 2022 14:05:06 -0700 Subject: [PATCH 24/24] Remove trailing comma --- screwdriver.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/screwdriver.yaml b/screwdriver.yaml index af27005..6caa005 100644 --- a/screwdriver.yaml +++ b/screwdriver.yaml @@ -47,8 +47,7 @@ jobs: version: template: python/generate_version requires: [ - validate_test, validate_lint, validate_codestyle, validate_security, - # validate_type + validate_test, validate_lint, validate_codestyle, validate_security ] publish_test_pypi: