From 7b094983b7b8c15fba4a59502357af91a0b3226a Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Fri, 3 Feb 2023 16:40:02 -0800 Subject: [PATCH] Initial package --- README.rst | 14 +++++--------- .../__init__.py | 0 setup.cfg | 18 +++++++++--------- stdeb.cfg | 2 +- test/spell_check.words | 1 + test/test_flake8.py | 2 +- test/test_spell_check.py | 2 +- 7 files changed, 18 insertions(+), 21 deletions(-) rename {template_package => colcon_top_level_workspace}/__init__.py (100%) diff --git a/README.rst b/README.rst index 645c33a..d8dc756 100644 --- a/README.rst +++ b/README.rst @@ -1,11 +1,7 @@ -template-package -================ +colcon-top-level-workspace +========================== -An extension for `colcon-core `_ to act as a template for new extensions. +An extension for `colcon-core `_ to locate and use a top-level workspace when in subdirectories thereof. -When using this template, be sure to replace all instances of the word "template" in the repository:: - - $ find * -type f | xargs sed -i 's/template-package/colcon-package-name/g' - $ find * -type f | xargs sed -i 's/template_package/colcon_package_name/g' - $ mv template_package colcon_package_name - $ grep -iR template * +This package looks for marker files created by colcon which infer the root of a workspace. +Depending on the your workspace configuration, additional heuristics may be necessary to handle corner cases. diff --git a/template_package/__init__.py b/colcon_top_level_workspace/__init__.py similarity index 100% rename from template_package/__init__.py rename to colcon_top_level_workspace/__init__.py diff --git a/setup.cfg b/setup.cfg index 1628050..fb7fdc7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,12 +1,12 @@ [metadata] -name = template-package -version = attr: template_package.__version__ +name = colcon-top-level-workspace +version = attr: colcon_top_level_workspace.__version__ url = https://colcon.readthedocs.io project_urls = - Changelog = https://github.com/colcon/template-package/milestones?direction=desc&sort=due_date&state=closed - GitHub = https://github.com/colcon/template-package/ -author = Template Author -author_email = templateauthor@example.com + Changelog = https://github.com/colcon/colcon-top-level-workspace/milestones?direction=desc&sort=due_date&state=closed + GitHub = https://github.com/colcon/colcon-top-level-workspace/ +author = Scott K Logan +author_email = logans@cottsay.net classifiers = Development Status :: 3 - Alpha Environment :: Plugins @@ -17,7 +17,7 @@ classifiers = Programming Language :: Python Topic :: Software Development :: Build Tools license = Apache License, Version 2.0 -description = Extension for colcon to serve as a template for new extensions. +description = Extension for colcon to locate and use a top-level workspace. long_description = file: README.rst keywords = colcon @@ -46,7 +46,7 @@ test = scspell3k>=2.2 [tool:pytest] -junit_suite_name = template-package +junit_suite_name = colcon-top-level-workspace [options.entry_points] @@ -54,4 +54,4 @@ junit_suite_name = template-package import-order-style = google [coverage:run] -source = template_package +source = colcon_top_level_workspace diff --git a/stdeb.cfg b/stdeb.cfg index 9cfbd15..92099d9 100644 --- a/stdeb.cfg +++ b/stdeb.cfg @@ -1,4 +1,4 @@ -[template-package] +[colcon-top-level-workspace] No-Python2: Depends3: python3-colcon-core Suite: bionic focal jammy stretch buster bullseye diff --git a/test/spell_check.words b/test/spell_check.words index 52c70fc..91e2768 100644 --- a/test/spell_check.words +++ b/test/spell_check.words @@ -1,4 +1,5 @@ apache +colcon iterdir pathlib pytest diff --git a/test/test_flake8.py b/test/test_flake8.py index 3792f47..a4d5c7c 100644 --- a/test/test_flake8.py +++ b/test/test_flake8.py @@ -27,7 +27,7 @@ def test_flake8(): sys.stdout = sys.stderr # implicitly calls report_errors() report = style_guide.check_files([ - str(Path(__file__).parents[1] / 'template_package'), + str(Path(__file__).parents[1] / 'colcon_top_level_workspace'), ]) report_tests = style_guide_tests.check_files([ str(Path(__file__).parents[1] / 'test'), diff --git a/test/test_spell_check.py b/test/test_spell_check.py index f016c1b..63d679d 100644 --- a/test/test_spell_check.py +++ b/test/test_spell_check.py @@ -21,7 +21,7 @@ def known_words(): def test_spell_check(known_words): source_filenames = [Path(__file__).parents[1] / 'setup.py'] + \ list( - (Path(__file__).parents[1] / 'template_package') + (Path(__file__).parents[1] / 'colcon_top_level_workspace') .glob('**/*.py')) + \ list((Path(__file__).parents[1] / 'test').glob('**/*.py'))