Skip to main content

A hack to get your editor to recognise rospy functions without installing ros on your system.

Project description

rospy-nonlocalstubs

A hack to get your editor to recognize rospy functions without installing ros or rospy on your system. This is for people like me, who run their ROS nodes inside a docker container and therefore don't have ROS installed on the environment they run their editor in.

This makes use of the fact that most editors/LSPs will also check for the PEP 561 -stubs package, even when the base package is not installed, and the fact that type stubs are still valid, even when all arguments are Any and Incomplete. To reiterate: this is an ugly hack that just happens to work awfully conveniently.

Please do not install this package in any environment that also has ros installed. That might break stuff.

To install, simply run pip install rospy-nonlocalstubs in the same environment as the one your editor lives in.

This package can be automatically updated to the latest version of rospy by anyone who has mypy (more specifically, its submodule stubgen) installed:

# Update the git submodule in which rospy lives
git submodule init && git submodule update

# Generate the stubs with stubgen
./build.sh

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rospy-nonlocalstubs-0.1.3.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

rospy_nonlocalstubs-0.1.3-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file rospy-nonlocalstubs-0.1.3.tar.gz.

File metadata

  • Download URL: rospy-nonlocalstubs-0.1.3.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for rospy-nonlocalstubs-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c9f05ba61ef1bd91ddfcbb0e6e0891da34e242ef3955e0c575a3e85c17345e72
MD5 98747dc5b9ed28ff3f2c107f9d893b3b
BLAKE2b-256 31efe5e54a60350a2e1ee47dfe236e53f08d21ffd62eb1ebfd9cced4fef3e1bf

See more details on using hashes here.

File details

Details for the file rospy_nonlocalstubs-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for rospy_nonlocalstubs-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0b82b3e45e65d8148dfa5cab7f8d2f7e6c2b8ba034939359de4d64aa07e3adaa
MD5 227efdbe845b94197a4bd67ae484efc2
BLAKE2b-256 5194b440f573f44427c4f3cb656f2551fd7a6823e2ac219e4b34ada2471c8728

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page