Skip to content

Conversation

@peci1
Copy link
Contributor

@peci1 peci1 commented Jan 12, 2023

Continuation of #901.

This would come handy e.g. with package m2r added in ros/rosdistro#35827 , where the newest released version on pip is python3-only, but it is also offered on python2 pip on bionic.

Such packages will exist e.g. if you've sourced a colcon workspace that
has built ament_python packages with --symlink-install. Of course they
could exist for other valid reasons as well.

For such packages, 'pip freeze' would output something like

 ```
 # Editable install with no version control (examples-rclpy-executors==0.20.4)
 -e /home/daniel/ws/build/examples_rclpy_executors
 ```

Making the output unparsable. 'pip list --format freeze' otoh gives

 ```
 examples-rclpy-executors==0.20.4
 ```

Which is fine.
…pip-module-versions

Resolving some merge conflicts in the process (which should be reviewed)
@danielcranston
Copy link

I came across ros/rosdistro#46946 (comment) which made me remember this issue. The linked comment talks about a con with adding custom rosdep entries:

Cons: still effectively limits you to "one version" as the rosdep pip keys don't (truly) support versioning. (but if you put the like ==1.2.3 in the package name for pip it will install that version... it just breaks rosdeps ability to tell that it's already installed and skip reinstallation when you run)

My understanding is that this PR addresses this exact thing, and gives rosdep the ability to "(truly) support versioning" of pip packages.

I made some commits on top of this branch a while back, mainly to resolve merge conflicts. I've been using it with custom rosdep keys targeting explicit pip package versions, and it's working well. https://github.com/danielcranston/rosdep/tree/handle-pip-module-versions. @peci1 mind having a look at the commits? If they seem good to you feel free to adopt them here.

@emersonknapp do you have any thoughts on this?

@peci1
Copy link
Contributor Author

peci1 commented Sep 23, 2025

Thanks, I'll have a look. Not sure about the timeframe, though.

Comparing to inequality with .* versions is not supported by pip: pypa/packaging#645 .
@codecov
Copy link

codecov bot commented Sep 24, 2025

Codecov Report

❌ Patch coverage is 87.87879% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.09%. Comparing base (4cb03bb) to head (c8fc9e7).
⚠️ Report is 41 commits behind head on master.

Files with missing lines Patch % Lines
src/rosdep2/platforms/pip.py 87.87% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #909      +/-   ##
==========================================
- Coverage   74.22%   72.09%   -2.14%     
==========================================
  Files          44       44              
  Lines        3376     3519     +143     
  Branches        0      696     +696     
==========================================
+ Hits         2506     2537      +31     
+ Misses        870      802      -68     
- Partials        0      180     +180     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@peci1
Copy link
Contributor Author

peci1 commented Sep 24, 2025

Thanks @danielcranston , I've integrated your changes.

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.

3 participants