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

Sync por_master branch to upstream. Add (again) license introspection syspkg #1

Closed
wants to merge 66 commits into from

Conversation

130s
Copy link

@130s 130s commented Dec 1, 2020

No description provided.

yotabits and others added 30 commits March 9, 2019 21:29
…packages with multiple licenses. (ros-infrastructure#164)

* [manifest] Use list of str instead of a single str, to handle better packages with multiple licenses.

Add a `licenses` field to Manifest class (in addition to `license`.

Although {manifest, package}.xml format allows to define separate xml elements, rospkg handles multiple licenses as a single string joined by a comma, which is inconvenient depending on the consumers' usecase.

Pointed out at https://github.com/ros-infrastructure/rospkg/pull/133/files#r253230420

If we want to maintain backward compatibility, `license` str field shouldn't change. So without making any change to it, this PR only adds a new field. This could cause a confusion.
I thought to add printing a warning for deprecation for license, but because it looks like `license` is (and other fields are) intended to be accessed directly (without getter method/structure), I'm not sure how to notify the users during runtime.

```
$ ipython
Python 2.7.12 (default, Nov 12 2018, 14:36:49)
Type "copyright", "credits" or "license" for more information.

IPython 2.4.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import rospkg
In [2]: rp = rospkg.RosPack()
In [4]: p = rp.get_manifest("rviz")
In [5]: p.license
Out[5]: 'BSD, Creative Commons'

In [6]: p.licenses
Out[6]: ['BSD', 'Creative Commons']
```

- [x] Requester provides reproducible commands and sample test result.
- [ ] CI should pass.
- [ ] Code review.

* avoid moving existing fields, keep init order the same as slot order

* Add a test case for Manifest.license/s fields.

* [test][catkin] Minor refactoring.

* [licenses] Test update (response to ros-infrastructure#164 (review))

* [license] test update (ros-infrastructure#164 (review))
* MXLinux Support

MX Linux support

* space around operator
* fix dependencies of latest Debian packages

* also remove it from the non-module in case of Debian

* remove catkin_pkg dependency from non-module Debian
Additional quotes removed for elementary os in LsbDetect file.
* Restored support for ElementaryOS

* Added Zorin support
* Fix openSUSE leap detection

File /etc/SuSE-release is absent in recent openSUSE releases (leap 15.0, tumbleweed), so ignore it on first try

* fixed openSuSE tumbleweed detection

The ID in `/etc/os-release` is now `opensuse-tumbleweed`
* add Python 3.7 and 3.8 to Travis matrix

* fix SyntaxWarnings in Python 3.8
* Replace deprecated platform functions with distro

See https://docs.python.org/3.7/library/platform.html#unix-platforms

* Use distro module in test

* Use platform module as a fallback (for Ubuntu Xenial)

Also only depend on python3-distro if python3 doesn't provide the
platform module (i.e. starting with version 3.8).

* Prefer old platform module to fix Xenial

* force absolute imports

* ModuleNotFoundError is only available as of Python 3.6
…ructure#186)

* only conditionally declare distro dependency in setup.py

* only list distro dependency in setup for non-Debian, for the Debian packages it comes from stdeb.cfg
Only the used functions of the platform module where deprecated, so test
for the Python version to get the right module.
* Case insensitive LSB name checking

`platform.linux_distribution(full_distribution_name=0)` returns `Ubuntu`
while `distro.linux_distribution(full_distrition_name=0)` returns
`ubuntu`. This causes rosdep to fail to detect the os version on ubuntu
when using python 3.8.

Signed-off-by: Shane Loretz<[email protected]>

* Restore None check

Signed-off-by: Shane Loretz <[email protected]>
* Use /bin/sh instead of python 2

Signed-off-by: Shane Loretz <[email protected]>

* Skip test_osx on non-POSIX platforms

Signed-off-by: Shane Loretz <[email protected]>
yanqd0 and others added 26 commits May 26, 2020 21:46
)

This option is required to make releases from Ubuntu Focal and other
distributions where the Python 2 package name is python2 rather than
python.
Add support for systems generated with Buildroot:
https://buildroot.org/

Buildroot systems follows the freedesktop.org /etc/os-release spec. See:
https://git.busybox.net/buildroot/commit/?id=451a887894faddef019e9a0628c21b5f2e9eee56

Signed-off-by: Julien Olivain <[email protected]>
tests: add armv8l arch to tripwire_uname test
…ldroot

os_detect: add support for Buildroot
[get_licenses] Delegate traversing all dependency to existing method (not exactly but hopefully closer to what's suggested in ros-infrastructure#133 (comment))

[get_licenses] Add system dependency to the output.

[get_licenses] Sort licenses and pkgs.

[get_licenses] Conform to variable name convention.
…packages with multiple licenses.

Add a `licenses` field to Manifest class (in addition to `license`.

Although {manifest, package}.xml format allows to define separate xml elements, rospkg handles multiple licenses as a single string joined by a comma, which is inconvenient depending on the consumers' usecase.

Pointed out at https://github.com/ros-infrastructure/rospkg/pull/133/files#r253230420

If we want to maintain backward compatibility, `license` str field shouldn't change. So without making any change to it, this PR only adds a new field. This could cause a confusion.
I thought to add printing a warning for deprecation for license, but because it looks like `license` is (and other fields are) intended to be accessed directly (without getter method/structure), I'm not sure how to notify the users during runtime.

```
$ ipython
Python 2.7.12 (default, Nov 12 2018, 14:36:49)
Type "copyright", "credits" or "license" for more information.

IPython 2.4.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import rospkg
In [2]: rp = rospkg.RosPack()
In [4]: p = rp.get_manifest("rviz")
In [5]: p.license
Out[5]: 'BSD, Creative Commons'

In [6]: p.licenses
Out[6]: ['BSD', 'Creative Commons']
```

- [x] Requester provides reproducible commands and sample test result.
- [ ] CI should pass.
- [ ] Code review.

[get_licenses] Use Manifest.licenses, not Manifest.license in order to handle pkgs with multiple licenses better.
…be usecase, and if there is, users can easily do by themselves.

[get_licenses] Call methods with kw arguments to better clarify args. Rename an arg for better clarity.

[get_licenses] Clean up.
[test][catkin] Removing a ROS package from a dependency list as it is unresolvable during the set of nosetests in this package.
Setting up apt-get for python-rosdep might be complicated. For CI pip seems to be an acceptable solution.

Enabling sudo in Travis level might be needed to run rosdep init.

Copying from bloom project how to run rosdep on Travis CI with pip.
…ne' causes TypeError ('<' not supported between instances of 'NoneType' and 'License) so defining non None.
@130s
Copy link
Author

130s commented Dec 1, 2020

Conflict happening between the license feature code, which has been updated after having some code reviews from the reviewers on the upstream repo (latest is hosted in ros-infrastructure#201), plus the feature to get the license for system pkg is cherry-picked manually. So the feat. branch in this PR is preferable.

Closing this PR, and re-create por_master branch locally based off of the feat. branch in this PR, then push to the remote.

@130s 130s closed this Dec 1, 2020
@130s 130s deleted the feature-license-introspection-syspkg branch December 1, 2020 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.