Skip to content

Commit

Permalink
quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
InvincibleRMC committed Jul 24, 2024
1 parent 6594bd1 commit 8b8f033
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 57 deletions.
58 changes: 26 additions & 32 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,72 +1,66 @@
"""setup.py for the ros2_video_streamer module."""

import os
from glob import glob

from setuptools import find_packages, setup

PACKAGE_NAME = "ros2_video_streamer"
PACKAGE_NAME = 'ros2_video_streamer'

setup(
name=PACKAGE_NAME,
version="1.1.0",
version='1.1.0',
packages=find_packages(),
data_files=[
(
"share/ament_index/resource_index/packages",
["resource/" + PACKAGE_NAME],
'share/ament_index/resource_index/packages',
['resource/' + PACKAGE_NAME],
),
(
"share/" + PACKAGE_NAME,
["package.xml"],
'share/' + PACKAGE_NAME,
['package.xml'],
),
(
os.path.join(
"share",
'share',
PACKAGE_NAME,
"launch",
'launch',
),
glob("launch/*.launch.xml"),
glob('launch/*.launch.xml'),
),
(
os.path.join(
"share",
'share',
PACKAGE_NAME,
"launch",
'launch',
),
glob("launch/*launch.[pxy][yma]*"),
glob('launch/*launch.[pxy][yma]*'),
),
(
os.path.join(
"share",
'share',
PACKAGE_NAME,
"config",
'config',
),
glob("config/*.yaml"),
glob('config/*.yaml'),
),
(
os.path.join("share", PACKAGE_NAME),
glob("*.mp4"),
os.path.join('share', PACKAGE_NAME),
glob('*.mp4'),
),
],
py_modules=[],
zip_safe=True,
install_requires=[
"setuptools",
"opencv-python-headless",
"flake8==4.0.1",
"mypy >= 1.7",
],
author="Benjamin Poulin",
maintainer="Benjamin Poulin",
keywords=["ROS2"],
description="Camera simulator - run a recorded video file streamed on a"
+ "ros topic as if a live webcamera.",
license="Apache License, Version 2.0",
tests_require=["pytest", "mypy"],
author='Benjamin Poulin',
maintainer='Benjamin Poulin',
keywords=['ROS2'],
description='Camera simulator - run a recorded video file streamed on a'
+ 'ros topic as if a live webcamera.',
license='Apache License, Version 2.0',
tests_require=['pytest'],
entry_points={
"console_scripts": [
"ros2_video_streamer_node = ros2_video_streamer.ros2_video_streamer_node:main",
'console_scripts': [
'ros2_video_streamer_node = ros2_video_streamer.ros2_video_streamer_node:main',
],
},
)
9 changes: 3 additions & 6 deletions test/test_flake8.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
"""Test flake8 on this module."""

# Copyright 2017 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# distributed under the License is distributed on an 'AS IS' BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Expand All @@ -21,11 +19,10 @@
@pytest.mark.flake8
@pytest.mark.linter
def test_flake8() -> None:
"""Tests flake8 on this module."""
(
error_code,
errors,
) = main_with_errors(argv=[])
assert error_code == 0, f"Found {len(errors)} code style errors / warnings:\n" + "\n".join(
assert error_code == 0, f'Found {len(errors)} code style errors / warnings:\n' + '\n'.join(
errors
)
21 changes: 9 additions & 12 deletions test/test_mypy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"""Test mypy on this module."""

import os

import pytest
Expand All @@ -9,17 +7,16 @@
@pytest.mark.mypy
@pytest.mark.linter
def test_mypy() -> None:
"""Tests mypy on this module."""
file_path = __file__.replace(f"{__name__}.py", "")
file_path = __file__.replace(f'{__name__}.py', '')
config_file = os.path.join(
file_path,
"..",
"..",
"..",
"..",
"pyproject.toml",
'..',
'..',
'..',
'..',
'pyproject.toml',
)
if not os.path.exists(config_file):
config_file = os.path.join(file_path, "..", ".mypy.ini")
error_code = main(argv=["--config", config_file])
assert error_code == 0, "Found code style errors / warnings"
config_file = os.path.join(file_path, '..', '.mypy.ini')
error_code = main(argv=['--config', config_file])
assert error_code == 0, 'Found code style errors / warnings'
11 changes: 4 additions & 7 deletions test/test_pep257.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
"""Test pep257 on this module."""

# Copyright 2015 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# distributed under the License is distributed on an 'AS IS' BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Expand All @@ -21,6 +19,5 @@
@pytest.mark.linter
@pytest.mark.pep257
def test_pep257() -> None:
"""Tests pep257 on this module."""
error_code = main(argv=[".", "test"])
assert error_code == 0, "Found code style errors / warnings"
error_code = main(argv=['.', 'test'])
assert error_code == 0, 'Found code style errors / warnings'

0 comments on commit 8b8f033

Please sign in to comment.