diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index d9230cb..e219c55 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -5,6 +5,8 @@ on: [push] jobs: build: runs-on: ubuntu-latest + permissions: + id-token: write strategy: matrix: python-version: @@ -21,8 +23,9 @@ jobs: run: "python -m pip install --upgrade pip\npip install tox tox-gh-actions\n" - name: 'Test with tox' run: tox - - uses: casperdcl/deploy-pypi@v2 + - name: 'Build' if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && matrix.python-version == '3.10' - with: - password: ${{ secrets.pypi_token }} - build: true + run: pip install build && python -m build + - name: 'Publish to PyPI' + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && matrix.python-version == '3.10' + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8467a3a..c81e2ed 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,21 @@ Changelog ========= +v0.6.0 (2026-06-24) +------------------- +- Migrate to pypa/gh-action-pypi-publish. [Ramon Wijnands] +- Update deploy-pypi. [Ramon Wijnands] +- Rename package to ros-ws. [Ramon Wijnands] +- Remove all catkin related code. [Ramon Wijnands] +- Remove all Dockerfiles. [Ramon Wijnands] +- Remove Python2 support & update Python versions. [Ramon Wijnands] +- Remove all unused rosdistro url handling code. [Ramon Wijnands] +- Remove all recursive package code. [Ramon Wijnands] +- Fix(): update after some breaking changes in dependencies, fixes #111. + [Rokus Ottervanger] +- Update GitHub actions. [Ramon Wijnands] + + v0.5.0 (2022-01-24) ------------------- - Fix tests. [Rein Appeldoorn] diff --git a/README.rst b/README.rst index 04ea4f1..cef3233 100644 --- a/README.rst +++ b/README.rst @@ -1,13 +1,13 @@ -ros-get |Build Status| -====================== +ros-ws |Build Status| +===================== -ros-env is a collection of simple tools for working with ROS source +ros-ws is a collection of simple tools for working with ROS source packages. Installation ------------ -The *ros-get* software uses ``pip`` to install itself. If you don't have +The *ros-ws* software uses ``pip`` to install itself. If you don't have it yet, it is available as ``python-pip`` at Debian and Ubuntu. (Install using ``sudo apt install python-pip``.) @@ -16,32 +16,32 @@ Installation from PyPI .. code:: sh - pip install ros-get + pip install ros-ws -For development it is recommended to install ``ros-get`` with ``pip install -e``. This installs a package in editable mode. +For development it is recommended to install ``ros-ws`` with ``pip install -e``. This installs a package in editable mode. Installation from source ~~~~~~~~~~~~~~~~~~~~~~~~ -If you like to both use and hack *ros-get*, you can 'install' the +If you like to both use and hack *ros-ws*, you can 'install' the software by pointing the installation to the development code. -1. Make *ros-get* available locally, eg by download or cloning the +1. Make *ros-ws* available locally, eg by download or cloning the repository, for example .. code:: sh - git clone https://github.com/Rayman/ros-get.git + git clone https://github.com/Rayman/ros-ws.git 2. Install using ``pip`` with the *editable* option ``-e DIR``. .. code:: sh - cd ros-get + cd ros-ws pip install --user -e . - The final ``.`` says that ``pip`` should redirect the ``ros-get`` - command relative to this directory (to ``./src/ros-get``). + The final ``.`` says that ``pip`` should redirect the ``ws`` + command relative to this directory (to ``./src/ros-ws``). Usage ----- @@ -50,9 +50,9 @@ TODO: create a workspace .. code:: sh - ros-get install tue_config - ros-get remove tue_config - ros-get update + ws create /opt/ros/humble + ws list + ws switch myworkspace Comparison with `tue-env `__ --------------------------------------------------------------------- @@ -70,7 +70,7 @@ Uninstall .. code:: sh - pip uninstall ros-get + pip uninstall ros-ws -.. |Build Status| image:: https://travis-ci.org/Rayman/ros-get.svg?branch=master - :target: https://travis-ci.org/Rayman/ros-get +.. |Build Status| image:: https://travis-ci.org/Rayman/ros-ws.svg?branch=master + :target: https://travis-ci.org/Rayman/ros-ws diff --git a/setup.bash b/setup.bash index b14b59c..7960c3d 100644 --- a/setup.bash +++ b/setup.bash @@ -1,7 +1,7 @@ #!/usr/bin/env bash -_WS_DIR=$(ros-get ws-locate 2> /dev/null) +_WS_DIR=$(ws locate 2> /dev/null) -# if ros-get doesn't exist, don't do anything +# if ws doesn't exist, don't do anything test "$?" -ne 0 && return 0 # prefer install space, fallback to devel space diff --git a/setup.cfg b/setup.cfg index cbe42ff..13475d9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.5.0 +current_version = 0.6.0 commit = True tag = True parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+)(?P\d+))? @@ -16,6 +16,6 @@ values = [bumpversion:part:build] -[bumpversion:file:src/ros_get/__init__.py] +[bumpversion:file:src/ros_ws/__init__.py] [bdist_wheel] diff --git a/setup.py b/setup.py index 2623ab5..0492b88 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ def get_ini_variable(name): - with open(os.path.join(os.path.dirname(__file__), 'src', 'ros_get', '__init__.py')) as f: + with open(os.path.join(os.path.dirname(__file__), 'src', 'ros_ws', '__init__.py')) as f: return re.compile(r".*%s = '(.*?)'" % name, re.S).match(f.read()).group(1) @@ -13,7 +13,7 @@ def get_ini_variable(name): readme = r_file.read() setup( - name='ros_get', + name='ros_ws', license='MIT', version=get_ini_variable('__version__'), url=get_ini_variable('__url__'), @@ -34,4 +34,4 @@ def get_ini_variable(name): 'xdg==1.0.7', ], python_requires='>=3.10', - entry_points={'console_scripts': ['ros-get=ros_get.__main__:main']}, ) + entry_points={'console_scripts': ['ws=ros_ws.__main__:main']}, ) diff --git a/src/ros_get/__init__.py b/src/ros_ws/__init__.py similarity index 92% rename from src/ros_get/__init__.py rename to src/ros_ws/__init__.py index d71597f..de3993e 100644 --- a/src/ros_get/__init__.py +++ b/src/ros_ws/__init__.py @@ -1,6 +1,6 @@ from .workspace import create, switch, save, list_workspaces, locate, name -__version__ = '0.5.0' +__version__ = '0.6.0' __url__ = 'https://github.com/Rayman/ros-get' __author__ = 'Ramon Wijnands' __email__ = 'rayman747@hotmail.com' diff --git a/src/ros_get/__main__.py b/src/ros_ws/__main__.py similarity index 88% rename from src/ros_get/__main__.py rename to src/ros_ws/__main__.py index 7a495cb..6867509 100644 --- a/src/ros_get/__main__.py +++ b/src/ros_ws/__main__.py @@ -40,9 +40,9 @@ def parse_args(argv): # workspace commands subparser = subparsers.add_parser( - 'ws-create', + 'create', help='create a new workspace', - description='Create a new colcon workspace where the packages are managed by ros-get') + description='Create a new colcon workspace where the packages are managed by ros-ws') subparser.set_defaults(func='create') subparser.add_argument( 'extend_path', @@ -56,23 +56,23 @@ def parse_args(argv): '--name', help='give a name to the workspace, if not given, the name will be inferred by the directory name') - subparser = subparsers.add_parser('ws-switch', help='switch to a workspace') + subparser = subparsers.add_parser('switch', help='switch to a workspace') subparser.set_defaults(func='switch') subparser.add_argument('name') - subparser = subparsers.add_parser('ws-save', help='Saves the current workspace') + subparser = subparsers.add_parser('save', help='Saves the current workspace') subparser.set_defaults(func='save') subparser.add_argument('dir') subparser.add_argument( '--name', help='give a name to the workspace, if not given, the name will be inferred by the directory name') - subparser = subparsers.add_parser('ws-list', help='list all saved workspaces') + subparser = subparsers.add_parser('list', help='list all saved workspaces') subparser.set_defaults(func='list_workspaces') - subparser = subparsers.add_parser('ws-locate', help='prints the path to the current workspace') + subparser = subparsers.add_parser('locate', help='prints the path to the current workspace') subparser.set_defaults(func='locate') - subparser = subparsers.add_parser('ws-name', help='prints the name of the current workspace') + subparser = subparsers.add_parser('name', help='prints the name of the current workspace') subparser.set_defaults(func='name') autocomplete(parser) diff --git a/src/ros_get/utils.py b/src/ros_ws/utils.py similarity index 100% rename from src/ros_get/utils.py rename to src/ros_ws/utils.py diff --git a/src/ros_get/workspace.py b/src/ros_ws/workspace.py similarity index 94% rename from src/ros_get/workspace.py rename to src/ros_ws/workspace.py index 89e920a..33032cc 100644 --- a/src/ros_get/workspace.py +++ b/src/ros_ws/workspace.py @@ -10,7 +10,7 @@ logger = logging.getLogger(__name__) -config_dir = os.path.join(xdg.XDG_CONFIG_HOME, 'ros-get') +config_dir = os.path.join(xdg.XDG_CONFIG_HOME, 'ros-ws') ws_file = os.path.join(config_dir, 'workspace') ws_dir = os.path.join(config_dir, 'workspaces') @@ -118,7 +118,7 @@ def locate(verbose): :param verbose: Unused. """ if not os.path.islink(ws_file): - print('no current workspace found, see "ros-get ws-create --help" how to create one') + print('no current workspace found, see "ws create --help" how to create one') return 1 else: @@ -131,7 +131,7 @@ def name(verbose): :param verbose: Unused. """ if not os.path.islink(ws_file): - print('no current workspace found, see "ros-get ws-create --help" how to create one') + print('no current workspace found, see "ws create --help" how to create one') return 1 else: diff --git a/test/test_argument_parsing.py b/test/test_argument_parsing.py index 3a6e16e..ba2fafa 100644 --- a/test/test_argument_parsing.py +++ b/test/test_argument_parsing.py @@ -1,5 +1,5 @@ import pytest -from ros_get.__main__ import parse_args +from ros_ws.__main__ import parse_args def test_parse_no_command(capsys): @@ -15,19 +15,19 @@ def test_parse_no_command(capsys): def test_parse_ws_list(): - func, args = parse_args(['ws-list']) + func, args = parse_args(['list']) assert func == 'list_workspaces' assert not args.verbose def test_parse_ws_list_verbose(): - func, args = parse_args(['--verbose', 'ws-list']) + func, args = parse_args(['--verbose', 'list']) assert func == 'list_workspaces' assert args.verbose def test_parse_ws_create(): - func, args = parse_args(['ws-create', '/opt/ros/kinetic']) + func, args = parse_args(['create', '/opt/ros/kinetic']) assert func == 'create' assert args.extend_path == '/opt/ros/kinetic' assert len(vars(args)) == 4 diff --git a/test/test_list_installed.py b/test/test_list_installed.py index 4658039..0919258 100644 --- a/test/test_list_installed.py +++ b/test/test_list_installed.py @@ -1,9 +1,9 @@ import importlib import pytest -import ros_get.workspace +import ros_ws.workspace import xdg -from ros_get import create, list_workspaces, locate, name, save, switch +from ros_ws import create, list_workspaces, locate, name, save, switch @pytest.fixture() @@ -13,12 +13,12 @@ def empty_config_home(tmpdir, monkeypatch): """ monkeypatch.setenv('XDG_CONFIG_HOME', str(tmpdir)) importlib.reload(xdg) - importlib.reload(ros_get.workspace) + importlib.reload(ros_ws.workspace) return tmpdir def test_fixture(empty_config_home): - assert ros_get.workspace.config_dir.startswith('/tmp') + assert ros_ws.workspace.config_dir.startswith('/tmp') def test_list(empty_config_home): @@ -44,7 +44,7 @@ def test_ws_list(empty_config_home): list_workspaces(verbose=True) - config = empty_config_home.join('ros-get') + config = empty_config_home.join('ros-ws') assert config.check(dir=1) assert config.join('workspace').check(exists=0) assert config.join('workspaces').check(dir=1)