Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on: [push]
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
strategy:
matrix:
python-version:
Expand All @@ -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
15 changes: 15 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
36 changes: 18 additions & 18 deletions README.rst
Original file line number Diff line number Diff line change
@@ -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``.)

Expand All @@ -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
-----
Expand All @@ -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 <https://github.com/tue-robotics/tue-env>`__
---------------------------------------------------------------------
Expand All @@ -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
4 changes: 2 additions & 2 deletions setup.bash
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.5.0
current_version = 0.6.0
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?
Expand All @@ -16,6 +16,6 @@ values =

[bumpversion:part:build]

[bumpversion:file:src/ros_get/__init__.py]
[bumpversion:file:src/ros_ws/__init__.py]

[bdist_wheel]
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@


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)


with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as r_file:
readme = r_file.read()

setup(
name='ros_get',
name='ros_ws',
license='MIT',
version=get_ini_variable('__version__'),
url=get_ini_variable('__url__'),
Expand All @@ -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']}, )
2 changes: 1 addition & 1 deletion src/ros_get/__init__.py → src/ros_ws/__init__.py
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
14 changes: 7 additions & 7 deletions src/ros_get/__main__.py → src/ros_ws/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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)
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions src/ros_get/workspace.py → src/ros_ws/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions test/test_argument_parsing.py
Original file line number Diff line number Diff line change
@@ -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):
Expand All @@ -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
10 changes: 5 additions & 5 deletions test/test_list_installed.py
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -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):
Expand All @@ -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)
Expand Down
Loading