Contributing to Rope

Getting Involved!

Rope’s main goal is being a good refactoring tool for python. It also provides some IDE helpers. If you would like to contribute, you’re welcome to!

How to Help Rope?

Rope’s development happens in python-rope’s Github.

Use python-rope’s Github Issue Tracker to discuss development-related issues:

  • Send bug reports and request features

  • Submit patches for bugs or new features

Use python-rope’s Github Discussion for other discussions, such as:

  • Help using rope

  • Help integrating rope with text editors/tools

  • Discuss your ideas

  • Engage with the rope community

Wish List

You are welcome to make pull requests in python-rope’s Github Issue Tracker.

Here is a list of suggestions.

Issues

If this is your first time contributing in rope and you don’t know where to start, tickets labeled good first issue is a good place start.

The unresolved issues list in Github is the latest todo list.

There is also a rather outdated list in Rope Issues. There is a section called “unresolved issues”; it contains almost every kind of task. This file will need some cleanup, thoughts, and discussions.

Pickup whichever you are most interested in. If you have ideas or questions about them, don’t hesitate to create a Github ticket for it.

Write Text Editors or IDE plugins for Rope

See pylsp-rope, ropemacs, ropevim, eric4.

Rope Structure

Rope package structure:

  • rope.base: the base part of rope

  • rope.refactor: refactorings and tools used in them

  • rope.contrib: IDE helpers

Have a look at __init__.py of these packages or Using Rope As A Library for more information.

There’s also some really good tour of Rope’s codebase by Austin Bingham (author of Traad). The first 10 minutes of the video talked about Rope in general, the rest are more specific to Traad.

Source Repository

Rope uses GitHub. The repository exists at python-rope/rope.

Setting up for local development

  1. Clone repository: git clone https://github.com/python-rope/rope.git

  2. Create a virtualenv: python -m venv rope-venv

  3. Activate the virtualenv

  4. Install the project into the venv: pip install -e '.[doc,dev]'

Submitting pull requests

Pull requests are welcome.

Follow the instructions on GitHub on how to setup Git and fork the python-rope/rope repository. Once your changes are ready, send a pull request for review.

Programming Style

  • Follow black codestyle

  • Follow PEP 8.

  • Use four spaces for indentation.

  • Include good unit-tests when appropriate.

  • Rope test suite should pass after patching.

Testing

Rope uses pytest. To run the test:

pytest -v

Many of rope’s tests are still written using unittest.TestCase style, but running the test suite using vanilla unittest is no longer supported.

Make sure to have complete test suite passing and add new tests for the changes you are providing with each new submission.

All required packages for development could be installed with:

pip install -e ".[dev]"

Updating gha-cache-key.txt

gha-cache-key.txt file is used as cache-key for Github Action to cache pip packages. Refer to PR #650 to see how it works.

To re-generate the cache key, run this command:

$ pip-compile --extra dev --generate-hashes -o gha-cache-key.txt
$ git add gha-cache-key.txt
$ git commit