First off, thank you for considering contributing to redis-py. We value community contributions!
You may already know what you want to contribute -- a fix for a bug you encountered, or a new feature your team wants to use.
If you don't know what to contribute, keep an open mind! Improving documentation, bug triaging, and writing tutorials are all examples of helpful contributions that mean less work for you.
Unsure where to begin contributing? You can start by looking through help-wanted issues.
Never contributed to open source before? Here are a couple of friendly tutorials:
Here's how to get started with your code contribution:
make dev
make test
Running make dev will create a Docker-based development environment that starts the following containers:
The slave is a replica of the master node, using the leader-follower replication feature.
The sentinels monitor the master node in a sentinel high-availability configuration.
Meanwhile, the test container hosts the code from your checkout of redis-py and allows running tests against many Python versions.
Following are a few tips that can help you work with the Docker-based development environment.
To get a bash shell inside of a container:
$ docker-compose run <service> /bin/bash
Note: The term "service" refers to the "services" defined in the docker-compose.yml file: "master", "slave", "sentinel_1", "sentinel_2", "sentinel_3", "test".
Containers run a minimal Debian image that probably lacks tools you want to use. To install packages, first get a bash session (see previous tip) and then run:
$ apt update && apt install <package>
You can see the combined logging output of all containers like this:
$ docker-compose logs
The command make test runs all tests in all tested Python environments. To run the tests in a single environment, like Python 3.6, use a command like this:
$ docker-compose run test tox -e py36 -- --redis-url=redis://master:6379/9
Here, the flag -e py36 runs tests against the Python 3.6 tox environment. And note from the example that whenever you run tests like this, instead of using make test, you need to pass -- --redis-url=redis://master:6379/9. This points the tests at the "master" container.
Our test suite uses pytest. You can run a specific test suite against a specific Python version like this:
$ docker-compose run test tox -e py36 -- --redis-url=redis://master:6379/9 tests/test_commands.py
If you get any errors when running make dev or make test, make sure that you
are using supported versions of Docker and docker-compose.
The included Dockerfiles and docker-compose.yml file work with the following versions of Docker and docker-compose:
NOTE: If you find a security vulnerability, do NOT open an issue. Email Andy McCurdy (sedrik@gmail.com) instead.
In order to determine whether you are dealing with a security issue, ask yourself these two questions:
If the answer to either of those two questions are "yes", then you're probably dealing with a security issue. Note that even if you answer "no" to both questions, you may still be dealing with a security issue, so if you're unsure, just email Andy at sedrik@gmail.com.
When filing an issue, make sure to answer these five questions:
If you'd like to contribute a new feature, make sure you check our issue list to see if someone has already proposed it. Work may already be under way on the feature you want -- or we may have rejected a feature like it already.
If you don't see anything, open a new issue that describes the feature you would like and how it should work.
The core team looks at Pull Requests on a regular basis. We will give feedback as as soon as possible. After feedback, we expect a response within two weeks. After that time, we may close your PR if it isn't showing any activity.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。