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

[Windows] Add console script entry point #656

Merged

Conversation

seanyen
Copy link
Contributor

@seanyen seanyen commented Jan 28, 2019

Add console script entry points for platforms (e.g. Windows) not supporting shebang to run the Scripts.

@seanyen seanyen force-pushed the fix_console_script branch from d81ff0f to 5cd0cd3 Compare January 28, 2019 23:57
@codecov-io
Copy link

codecov-io commented Jan 28, 2019

Codecov Report

Merging #656 into master will decrease coverage by 0.74%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #656      +/-   ##
==========================================
- Coverage   75.82%   75.07%   -0.75%     
==========================================
  Files          40       41       +1     
  Lines        3139     3162      +23     
==========================================
- Hits         2380     2374       -6     
- Misses        759      788      +29
Impacted Files Coverage Δ
src/rosdep2/install.py 0% <0%> (ø)
src/rosdep2/platforms/osx.py 48.61% <0%> (-3.32%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2977726...07294df. Read the comment docs.

@seanyen seanyen changed the title Add console script entry point [Windows] Add console script entry point Feb 8, 2019
@seanyen seanyen force-pushed the fix_console_script branch from 634abc9 to 2cf13e4 Compare February 8, 2019 19:53
src/rosdep2/main.py Outdated Show resolved Hide resolved
@seanyen
Copy link
Contributor Author

seanyen commented Mar 29, 2019

@nuclearsandwich @wjwwood Ping! it would be nice I can get some feedbacks on this change, and let me know anything needed to be changed.

And btw, I think this can address this issue: #645

@nuclearsandwich
Copy link
Contributor

I will have to check, as I don't know off the top of my head, how far back the entry_points API is supported by setuptools. There may be platforms that can't make use of them yet which rosdep is still released for.

@nuclearsandwich nuclearsandwich self-assigned this Mar 29, 2019
Copy link
Contributor

@wjwwood wjwwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me, but it should be "play tested" since it is how most people interact with rosdep, it would be bad to be broken in some subtle way. Note I didn't try this locally, and I probably don't have time to do so right now.

I think entry_points are quite old in setuptools. We definitely have other tools that use it so as long as we're not pushing this to even older systems than normal, it should be fine.

@seanyen
Copy link
Contributor Author

seanyen commented Mar 29, 2019

Run a quick check, console_scripts was there in setuptools even when it is still in a pre-release state (0.6a2, which was dated back to 2005.) Given how long it has been exercised by other projects\platforms, presumably it should be matured enough not to give people suprise. Hope that gives some more confident from other perspectives. 😃

https://setuptools.readthedocs.io/en/latest/history.html#a2

@seanyen
Copy link
Contributor Author

seanyen commented Apr 9, 2019

@nuclearsandwich Just checking back any feedbacks on this change?

Copy link
Member

@cottsay cottsay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be working for me on Win 10 1903 with Python 2.7 and 3.7.

@seanyen
Copy link
Contributor Author

seanyen commented Nov 13, 2019

@sloretz Was it something we could consider to merge?

@seanyen
Copy link
Contributor Author

seanyen commented Jan 14, 2020

@sloretz @dirk-thomas Happy new year. This is ready for review and merge. Hope we can move rosdep Windows support forward.

NOTE: The CI failure seems unrelated to the change and gets repro on master too.

@seanyen
Copy link
Contributor Author

seanyen commented Jan 28, 2020

@wjwwood Ping! This is ready to review and merge. Let me know any additional tests to run.

@wjwwood
Copy link
Contributor

wjwwood commented Feb 3, 2020

My latest comment said it needed to be tested on Linux to ensure it works as it does without the patch. Has that been done?

@wjwwood wjwwood removed their assignment Feb 3, 2020
@seanyen
Copy link
Contributor Author

seanyen commented Feb 8, 2020

My latest comment said it needed to be tested on Linux to ensure it works as it does without the patch. Has that been done?

@wjwwood Not sure how extensive the matrix I should validate, but I ran it on containers (python3\debian10, python2.7\debain10, and python2.7/alpine3.10) and Ubuntu bionic WSL. I can run rosdep init and rosdep update and see it is working with this patch.

Copy link
Member

@tfoote tfoote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs the logic to split the modules from the scripts/entry points for the packaging jobs so that we can support python2 and python3 side by side.

rosdep/setup.py

Lines 31 to 33 in 2977726

if 'SKIP_PYTHON_SCRIPTS' in os.environ:
kwargs['name'] += '_modules'
kwargs['scripts'] = {}

I think you can just conditionally blank the entry points in the same way that the scripts are removed.

ooeygui and others added 3 commits February 10, 2020 19:22
Add console script entry point for platforms (e.g. Windows) not supporting shebang.
@seanyen
Copy link
Contributor Author

seanyen commented Feb 11, 2020

@tfoote Thanks for catching this. I updated the check.

@rotu rotu mentioned this pull request Mar 18, 2020
@nuclearsandwich nuclearsandwich merged commit d9a6f66 into ros-infrastructure:master Apr 3, 2020
@nuclearsandwich
Copy link
Contributor

This change passed CI when rebased as #749.

gstavrinos pushed a commit to gstavrinos/rosdep that referenced this pull request Nov 12, 2020
* Add Suite3 option with Ubuntu Focal (ros-infrastructure#734)

Signed-off-by: Shane Loretz <sloretz@openrobotics.org>

* [update] Allow to process single ROS distro, fix 723 (ros-infrastructure#738)

* [update] skip other distro if --rosdistro passed

Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>

* ignore argument if specified distro doesnt exist

* address review comments

* update help message for rosdistro

Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>

* Fix CI and reduce CI time (ros-infrastructure#739)

* test newer python
* use yaml.safe_load
* pin PyYAML version for Python 3.4
* pass user flag to pip when needed
* move slow jobs to the top to reduce CI time

Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>

* Strip Alpine's patch version from OS codename (ros-infrastructure#716)

* Resolve Alpine os_version_type using OsDetect
* Reduced Alpine OS VERSION to Major.Minor

* improve support for null entries (ros-infrastructure#726)

* support null for entire OS and not only OS version

syntax like 'ubuntu: null' will now be raising ResolutionError with
relevant error message instead of InvalidData with obscure error message
will also cover syntax like:
"
ubuntu:
  '*': null
  bionic: [foobar]
"

Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>

Co-authored-by: Scott K Logan <logans@cottsay.net>

* Use DNF installer on RHEL 8 and newer (ros-infrastructure#713)

RHEL/CentOS 8 uses DNF by default.

* Updates to YUM and DNF (ros-infrastructure#640)

Output YUM, DNF and RPM versions with `--all-versions` and fix the format guide's default PM for Fedora.

* tests: don't assume euid != 0 (ros-infrastructure#703)

If tests rely on the environment being a certain way, they should ensure
it meets its expectations. Update the tests to ensure they're testing
multiple euid conditions, and setting it explicitly where required.

Fix ros-infrastructure#702

Signed-off-by: Kyle Fazzari <kyle@canonical.com>

* openSUSE package query  and install enhancements (ros-infrastructure#729)

* Enable PIP installer for openSUSE

* openSUSE package detection with RPM capabilities

Packages sometimes get renamed and their old name is kept as an rpm capability (like an alias), so the additional flag `--whatprovides` is passed to the `rpm` query.

* Fix conditional dependencies when one package uses manifest.xml (ros-infrastructure#737)

* Fix conditional dependencies when one package uses manifest.xml

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>

* Return rosdeps as a list to avoid breaking the interface.

Co-authored-by: Steven! Ragnarök <steven@nuclearsandwich.com>

* Guard next(inter) (ros-infrastructure#701)

* guard next(inter)

  Fix ros-infrastructure#691

Signed-off-by: artivis <jeremie.deray@canonical.com>

* Handle StopIteration with slightly less line noise.

Co-authored-by: Steven! Ragnarök <steven@nuclearsandwich.com>

* [Windows] Add console script entry point (ros-infrastructure#656)

* Add console script entry point

Add console script entry point for platforms (e.g. Windows) not supporting shebang.

* remove scripts entry since we are using console_scripts.

* fix bad merge.

* fix SKIP_PYTHON_SCRIPTS case.

Co-authored-by: Lou Amadio <ooeygui@users.noreply.github.com>

* Depend on modules packages only to allow co-installability. (ros-infrastructure#750)

When the rosdep modules package was split in [ros-infrastructure#731] the module
dependencies weren't updated to only depend on modules packages
themselves which prevents rosdep modules for python2 and python3 from
actually being co-installable.

I haven't yet audited to make sure there's no cli usage of these tools
in the modules but it's Friday afternoon and I wanted to get this inked
before I walked away.

When I return to it I'll check for that before proceeding for reviews.

* 0.19.0

* also install buildtool_export_depends (ros-infrastructure#753)

not adding 'exec_depends' or 'build_export_depends' are both are included inside 'run_depends'

Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>

* Drop shebang from a non-executable file (ros-infrastructure#755)

* add alias for Pop! OS (ros-infrastructure#757)

* add alias for Pop! OS

Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>

Co-authored-by: Shane Loretz <sloretz@openrobotics.org>
Co-authored-by: Mikael Arguedas <mikael.arguedas@gmail.com>
Co-authored-by: Mark Hedley Jones <MarkHedleyJones@gmail.com>
Co-authored-by: Scott K Logan <logans@cottsay.net>
Co-authored-by: Kyle Fazzari <kyle@canonical.com>
Co-authored-by: Bjar Ne <43565432+gleichdick@users.noreply.github.com>
Co-authored-by: Jeremie Deray <deray.jeremie@gmail.com>
Co-authored-by: Sean Yen <seanyen@microsoft.com>
Co-authored-by: Lou Amadio <ooeygui@users.noreply.github.com>
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.

7 participants