Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge changes from master branch into main branch #303

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
069d858
Fix parsing of <exports><build_type> with conditionals (#281)
shr-project Dec 10, 2020
dca5e40
yocto_recipe: use ROS_PYTHON_VERSION 2 only for melodic
shr-project Oct 11, 2020
0bad4ac
bitbake: sort rosdep_cache entries when dumping yaml file
shr-project Sep 22, 2020
9cc3cc1
yocto_recipe: add static method to get ROS_PYTHON_VERSION value
shr-project Nov 11, 2020
1ec19e1
bitbake: use own condition_context instead of whole os.environ
shr-project Nov 11, 2020
f0723c5
bitbake: show list of available packages when pkg from --only isn't f…
shr-project Dec 1, 2020
f26eae8
bitbake: fix regenerating individual recipes with --only parameter
shr-project Dec 1, 2020
ab0a072
yocto_recipe.py: Fix setting sensible default for <build_type> when n…
shr-project Dec 3, 2020
6fc64c6
yocto_recipe.py: Override the build_type from catkin_pkg in some case…
shr-project Dec 4, 2020
db90ea3
bitbake: rename distro to rosdistro
shr-project Dec 3, 2020
0e2d213
bitbake: make sure that the unresolved dependencies are valid OE reci…
shr-project Dec 5, 2020
aca1efb
bitbake: simplify unresolved dependencies handling
shr-project Dec 5, 2020
a7ee8cd
bitbake: fix removing all generated files before re-creating them
shr-project Dec 5, 2020
d970f6f
bitbake: change ROS_UNRESOLVED_PLATFORM_PKG_* to ROS_UNRESOLVED_DEP-*
shr-project Dec 6, 2020
06e1de6
utils.py: import license modifications from proposed catkin_pkg changes
shr-project Sep 16, 2020
a57a0e6
tests: update the get_license cases where superflore was guessing
shr-project Sep 18, 2020
6872d37
tests: update tests to match with new utils.get_license behavior
shr-project Sep 18, 2020
0ba59f3
bitbake: move translate_license function to superflore utils and prin…
shr-project Sep 18, 2020
4105ad8
tests: update tests to match with using translate_license function
shr-project Nov 10, 2020
e202119
Create GitHub Actions CI workflow based on travis job.
nuclearsandwich Oct 28, 2021
2eeaa3c
Fetch GPG key from GitHub via https.
nuclearsandwich Oct 29, 2021
1fa1d40
Use python3-rosdep to provide the rosdep utility.
nuclearsandwich Oct 29, 2021
cb6c424
Merge pull request #288 from ros-infrastructure/add-github-actions-ci
nuclearsandwich Oct 29, 2021
dd3a9e9
Release 0.3.3 (#286)
allenh1 Dec 1, 2021
99d3c8f
bitbake: generate new overrides syntax for RDEPENDS
shr-project Aug 16, 2021
d475c34
bitbake: generate new overrides syntax for ROS_SUPERFLORE_GENERATED_B…
shr-project Aug 16, 2021
afd9e09
ci.yaml: Add workflow_dispatch event trigger
robwoolley Mar 29, 2024
9e37398
ci.yaml: Update os and python matrix
robwoolley Mar 29, 2024
622851f
requirements.txt: Use pynose
robwoolley Mar 29, 2024
b02aec0
ci.yaml: Exclude some invalid tests
robwoolley Mar 29, 2024
69cde4d
ci.yaml: Update to latest GitHub Actions
robwoolley Mar 29, 2024
3a79369
ci.yaml: Update steps for ROS 2
robwoolley Nov 26, 2024
e9cd22e
ci.yaml: Disable ebuild unit tests
robwoolley Nov 26, 2024
f3dc27c
ci.yaml: Increase verbosity of test run
robwoolley Nov 27, 2024
9fad476
Noetic support
allenh1 Aug 6, 2021
a8d757b
Remove unused argument.
nuclearsandwich Nov 8, 2022
2f88ce7
Evaluate package conditions when generating ebuilds.
nuclearsandwich Nov 8, 2022
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
52 changes: 52 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: superflore-ci

on:
workflow_dispatch:
push:
branches: ['master']
pull_request:

jobs:
build:
strategy:
matrix:
os: ["ubuntu-20.04", "ubuntu-22.04"]
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
name: superflore tests
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{matrix.python}}
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python}}
- name: Install dependencies
run: |
echo "Set locale"
sudo apt update && sudo apt install locales
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8

echo "Enable required repositories"
sudo apt install software-properties-common
sudo add-apt-repository universe

sudo apt update && sudo apt install curl -y
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null

sudo apt-get update -qq
sudo apt-get install dpkg -y
sudo apt-get install -y python3-rosdep
pip install -r requirements.txt
- name: Run tests
run: |
sudo rosdep init
rosdep update
python -m 'nose' --verbose --exclude test_pull --exclude test_run --exclude test_logger_output --exclude test_failed_to_create --exclude test_generate_installers --ignore-files test_ebuild.py --ignore-files test_docker.py
python -m 'flake8' superflore --import-order-style=google



25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# Changelog

## [v0.3.3](https://github.com/ros-infrastructure/superflore/tree/v0.3.3) (2021-11-20)

[Full Changelog](https://github.com/ros-infrastructure/superflore/compare/v0.3.2...v0.3.3)

**Implemented enhancements:**

- Release Version 0.3.2 [\#276](https://github.com/ros-infrastructure/superflore/issues/276)

**Closed issues:**

- License parsing doesn't parse e.g. LGPLv3 correctly [\#271](https://github.com/ros-infrastructure/superflore/issues/271)

**Merged pull requests:**

- Create GitHub Actions CI workflow based on travis job. [\#288](https://github.com/ros-infrastructure/superflore/pull/288) ([nuclearsandwich](https://github.com/nuclearsandwich))
- Fix parsing of \<exports\>\<build\_type\> with conditionals [\#281](https://github.com/ros-infrastructure/superflore/pull/281) ([shr-project](https://github.com/shr-project))
- Various improvements to support generating recipes for Noetic [\#280](https://github.com/ros-infrastructure/superflore/pull/280) ([shr-project](https://github.com/shr-project))
- Improve license parsing [\#279](https://github.com/ros-infrastructure/superflore/pull/279) ([shr-project](https://github.com/shr-project))

# Change Log

## [v0.3.2](https://github.com/ros-infrastructure/superflore/tree/v0.3.2) (2020-04-30)
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ $ superflore-gen-oe-recipes --ros-distro ROS_DISTRO
This command will clone the `ros/meta-ros` repo into a subfolder under
`/tmp/superflore`, generate the recipes and other files for the specified
distro, commit them, and issue a pull request for `ros/meta-ros`. The
`--ros-distro` flag must be supplied.
`--ros-distro` flag must be supplied. ROS 1 distros prior to "melodic" are
not supported.

Generating bitbake recipes without specifying `--dry-run` is not
supported. This is because it is almost inevitable that
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
nose
pynose
flake8
flake8-import-order
termcolor
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ def append_local_version_label(public_version):
'docker',
'pyyaml',
'pygithub',
'catkin_pkg >= 0.4.0',
'catkin_pkg >= 0.4.10',
'rospkg >= 1.1.8',
]

setup(
name='superflore',
version=append_local_version_label('0.3.2'),
version=append_local_version_label('0.3.3'),
packages=find_packages(exclude=['tests', 'tests.*']),
author='Hunter L. Allen',
author_email='[email protected]',
Expand Down
15 changes: 4 additions & 11 deletions superflore/PackageMetadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import re

from catkin_pkg.package import parse_package_string


class PackageMetadata:
def __init__(self, pkg_xml):
def __init__(self, pkg_xml, evaluate_condition_context=None):
self.upstream_email = None
self.upstream_name = None
self.homepage = 'https://wiki.ros.org'
pkg = parse_package_string(pkg_xml)
if evaluate_condition_context:
pkg.evaluate_conditions(evaluate_condition_context)
self.upstream_license = pkg.licenses
self.description = pkg.description
if 'website' in [url.type for url in pkg.urls]:
Expand All @@ -49,11 +49,4 @@ def __init__(self, pkg_xml):
self.member_of_groups = [
group.name for group in pkg.member_of_groups
]
tag_remover = re.compile('<.*?>')
build_type = [
re.sub(tag_remover, '', str(e))
for e in pkg.exports if 'build_type' in str(e)
]
self.build_type = 'catkin'
if build_type:
self.build_type = build_type[0]
self.build_type = pkg.get_build_type()
62 changes: 32 additions & 30 deletions superflore/generators/bitbake/gen_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os

from catkin_pkg.package import InvalidPackage
from rosdistro.dependency_walker import DependencyWalker
from rosdistro.manifest_provider import get_release_tag
Expand All @@ -33,26 +31,28 @@


def regenerate_pkg(
overlay, pkg, distro, preserve_existing, srcrev_cache,
overlay, pkg, rosdistro, preserve_existing, srcrev_cache,
skip_keys
):
pkg_names = get_package_names(distro)[0]
pkg_names = get_package_names(rosdistro)[0]
if pkg not in pkg_names:
yoctoRecipe.not_generated_recipes.add(pkg)
raise RuntimeError("Unknown package '%s'" % pkg)
raise RuntimeError("Unknown package '%s' available packages"
" in selected distro: %s" %
(pkg, get_package_names(rosdistro)))
try:
version = get_pkg_version(distro, pkg, is_oe=True)
version = get_pkg_version(rosdistro, pkg, is_oe=True)
except KeyError as ke:
yoctoRecipe.not_generated_recipes.add(pkg)
raise ke
repo_dir = overlay.repo.repo_dir
component_name = yoctoRecipe.convert_to_oe_name(
distro.release_packages[pkg].repository_name)
rosdistro.release_packages[pkg].repository_name)
recipe = yoctoRecipe.convert_to_oe_name(pkg)
# check for an existing recipe which was removed by clean_ros_recipe_dirs
prefix = 'meta-ros{0}-{1}/generated-recipes/*/{2}_*.bb'.format(
yoctoRecipe._get_ros_version(distro.name),
distro.name,
yoctoRecipe._get_ros_version(rosdistro.name),
rosdistro.name,
recipe
)
existing = overlay.repo.git.status('--porcelain', '--', prefix)
Expand All @@ -64,16 +64,16 @@ def regenerate_pkg(
warn('More than 1 recipe was output by "git status --porcelain '
'meta-ros{0}-{1}/generated-recipes/*/{2}_*.bb": "{3}"'
.format(
yoctoRecipe._get_ros_version(distro.name),
distro.name,
yoctoRecipe._get_ros_version(rosdistro.name),
rosdistro.name,
recipe,
existing))
if existing.split()[0] != 'D':
err('Unexpected output from "git status --porcelain '
'meta-ros{0}-{1}/generated-recipes/*/{2}_*.bb": "{3}"'
.format(
yoctoRecipe._get_ros_version(distro.name),
distro.name,
yoctoRecipe._get_ros_version(rosdistro.name),
rosdistro.name,
recipe,
existing))

Expand All @@ -89,8 +89,8 @@ def regenerate_pkg(
'--porcelain '
'meta-ros{0}-{1}/generated-recipes/*/{2}_*.bb": "{3}"'
.format(
yoctoRecipe._get_ros_version(distro.name),
distro.name,
yoctoRecipe._get_ros_version(rosdistro.name),
rosdistro.name,
recipe,
existing))
existing = existing[0]
Expand All @@ -106,7 +106,7 @@ def regenerate_pkg(
previous_version = existing[idx_version:].rstrip('.bb')
try:
current = oe_recipe(
distro, pkg, srcrev_cache, skip_keys
rosdistro, pkg, srcrev_cache, skip_keys
)
except InvalidPackage as e:
err('Invalid package: ' + str(e))
Expand All @@ -129,8 +129,8 @@ def regenerate_pkg(
make_dir(
"{0}/meta-ros{1}-{2}/generated-recipes/{3}".format(
repo_dir,
yoctoRecipe._get_ros_version(distro.name),
distro.name,
yoctoRecipe._get_ros_version(rosdistro.name),
rosdistro.name,
component_name
)
)
Expand All @@ -139,8 +139,8 @@ def regenerate_pkg(
recipe_file_name = '{0}/meta-ros{1}-{2}/generated-recipes/{3}/' \
'{4}_{5}.bb'.format(
repo_dir,
yoctoRecipe._get_ros_version(distro.name),
distro.name,
yoctoRecipe._get_ros_version(rosdistro.name),
rosdistro.name,
component_name,
recipe,
version
Expand All @@ -159,12 +159,14 @@ def regenerate_pkg(


def _gen_recipe_for_package(
distro, pkg_name, pkg, repo, ros_pkg,
rosdistro, pkg_name, pkg, repo, ros_pkg,
pkg_rosinstall, srcrev_cache, skip_keys
):
pkg_names = get_package_names(distro)
pkg_dep_walker = DependencyWalker(distro,
evaluate_condition_context=os.environ)
pkg_names = get_package_names(rosdistro)
pkg_dep_walker = DependencyWalker(
rosdistro,
evaluate_condition_context=yoctoRecipe._get_condition_context(
rosdistro.name))
pkg_buildtool_deps = pkg_dep_walker.get_depends(pkg_name, "buildtool")
pkg_build_deps = pkg_dep_walker.get_depends(pkg_name, "build")
pkg_build_export_deps = pkg_dep_walker.get_depends(
Expand All @@ -177,7 +179,7 @@ def _gen_recipe_for_package(

# parse through package xml
err_msg = 'Failed to fetch metadata for package {}'.format(pkg_name)
pkg_xml = retry_on_exception(ros_pkg.get_package_xml, distro.name,
pkg_xml = retry_on_exception(ros_pkg.get_package_xml, rosdistro.name,
retry_msg='Could not get package xml!',
error_msg=err_msg)

Expand All @@ -186,7 +188,7 @@ def _gen_recipe_for_package(
len(ros_pkg.repository.package_names),
pkg_name,
pkg_xml,
distro,
rosdistro,
src_uri,
srcrev_cache,
skip_keys,
Expand Down Expand Up @@ -220,18 +222,18 @@ def _gen_recipe_for_package(

class oe_recipe(object):
def __init__(
self, distro, pkg_name, srcrev_cache, skip_keys
self, rosdistro, pkg_name, srcrev_cache, skip_keys
):
pkg = distro.release_packages[pkg_name]
repo = distro.repositories[pkg.repository_name].release_repository
pkg = rosdistro.release_packages[pkg_name]
repo = rosdistro.repositories[pkg.repository_name].release_repository
ros_pkg = RosPackage(pkg_name, repo)

pkg_rosinstall = _generate_rosinstall(
pkg_name, repo.url, get_release_tag(repo, pkg_name), True
)

self.recipe = _gen_recipe_for_package(
distro, pkg_name, pkg, repo, ros_pkg, pkg_rosinstall,
rosdistro, pkg_name, pkg, repo, ros_pkg, pkg_rosinstall,
srcrev_cache, skip_keys
)

Expand Down
2 changes: 1 addition & 1 deletion superflore/generators/bitbake/ros_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def clean_ros_recipe_dirs(self, distro):
info(
'Cleaning up:\n{0}'
.format(files))
self.repo.git.rm('-rf', '--ignore-unmatch', files)
self.repo.git.rm('-rf', '--ignore-unmatch', files.split())

def commit_changes(self, distro, commit_msg):
info('Commit changes...')
Expand Down
10 changes: 7 additions & 3 deletions superflore/generators/bitbake/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import sys

from rosinstall_generator.distro import get_distro
from rosinstall_generator.distro import get_package_names
from superflore.CacheManager import CacheManager
from superflore.generate_installers import generate_installers
from superflore.generators.bitbake.gen_packages import regenerate_pkg
Expand All @@ -39,7 +40,6 @@


def main():
os.environ["ROS_OS_OVERRIDE"] = "openembedded"
overlay = None
parser = get_parser(
'Generate OpenEmbedded recipes for ROS packages',
Expand Down Expand Up @@ -129,12 +129,14 @@ def main():
overlay,
pkg,
distro,
preserve_existing,
False, # preserve_existing
srcrev_cache,
skip_keys=skip_keys,
)
except KeyError:
err("No package to satisfy key '%s'" % pkg)
err("No package to satisfy key '%s' available "
"packages in selected distro: %s" %
(pkg, get_package_names(distro)))
sys.exit(1)
# Commit changes and file pull request
title =\
Expand All @@ -146,6 +148,7 @@ def main():
regen_dict = dict()
regen_dict[args.ros_distro] = args.only
delta = "Regenerated: '%s'\n" % args.only
overlay.add_generated_files(args.ros_distro)
commit_msg = '\n'.join([get_pr_text(
title + '\n' + pr_comment.replace(
'**superflore**', 'superflore'), markup=''), delta])
Expand All @@ -162,6 +165,7 @@ def main():
for adistro in selected_targets:
yoctoRecipe.reset()
distro = get_distro(adistro)

distro_installers, _, distro_changes =\
generate_installers(
distro,
Expand Down
Loading
Loading