Find a file
PIG208 5b32b32914 botserver: Return a valid JSON that is acceptable to outgoing webhooks.
In zulip/zulip@b998138d3a, we introduce
a check for responses from outgoing webhooks that require them to be
a dictionary. This commit fixes the return value of the botserver view
function to accommodate with the change from the serverside.
2021-05-11 09:08:04 -07:00
.github docs: Create FUNDING.yml. 2021-04-08 06:29:09 -07:00
stubs mypy: Add stubs for zephyr. 2021-03-10 23:59:15 -08:00
tools tools: Add test-main equivalent for Powershell on Windows. 2021-03-11 10:04:31 -08:00
zulip zulip: Replace GET realm/filters with realm/linkifiers. 2021-04-27 11:06:17 -07:00
zulip_bots zulip-bots: Fix incrementor to handle edit time limit error. 2021-04-06 17:36:22 -07:00
zulip_botserver botserver: Return a valid JSON that is acceptable to outgoing webhooks. 2021-05-11 09:08:04 -07:00
.codecov.yml codecov: Adjust failure threshold. 2017-09-14 04:26:12 -07:00
.editorconfig editorconfig: Adjust to 2-space indents for yaml. 2021-02-23 13:51:14 -08:00
.flake8 lint: Replace pycodestyle with Flake8. 2020-04-18 20:31:14 -07:00
.gitignore gitignore: Add swp files (for vim). 2018-10-11 10:36:00 -04:00
.gitlint lint: Setup gitlint. 2021-03-04 11:36:47 -08:00
.mailmap mailmap: Add Git .mailmap for zulipchat.com → zulip.com. 2020-05-13 09:56:35 -07:00
LICENSE docs: Add more proper LICENSE and THIRDPARTY files. 2020-03-22 16:52:19 -07:00
mypy.ini mypy: Add stubs for zephyr. 2021-03-10 23:59:15 -08:00
NOTICE docs: Add more proper LICENSE and THIRDPARTY files. 2020-03-22 16:52:19 -07:00
README.md docs: Add set and fetch upstream. 2021-03-04 11:36:28 -08:00
requirements.txt requirements: Upgrade mypy from 0.790 to 0.812. 2021-03-04 14:16:37 -08:00
THIRDPARTY docs: Add more proper LICENSE and THIRDPARTY files. 2020-03-22 16:52:19 -07:00

Zulip API

Build status Coverage status

This repository contains the source code for Zulip's PyPI packages:

The source code is written in Python 3.

Development

This is part of the Zulip open source project; see the contributing guide and commit guidelines.

  1. Fork and clone the Git repo, and set upstream to zulip/python-zulip-api:

    git clone https://github.com/<your_username>/python-zulip-api.git
    cd python-zulip-api
    git remote add upstream https://github.com/zulip/python-zulip-api.git
    git fetch upstream
    
  2. Make sure you have pip.

  3. Run:

    python3 ./tools/provision
    

    This sets up a virtual Python environment in zulip-api-py<your_python_version>-venv, where <your_python_version> is your default version of Python. If you would like to specify a different Python version, run

    python3 ./tools/provision -p <path_to_your_python_version>
    
  4. If that succeeds, it will end with printing the following command:

    source /.../python-zulip-api/.../activate
    

    You can run this command to enter the virtual environment. You'll want to run this in each new shell before running commands from python-zulip-api.

  5. Once you've entered the virtualenv, you should see something like this on the terminal:

    (zulip-api-py3-venv) user@pc ~/python-zulip-api $
    

    You should now be able to run any commands/tests/etc. in this virtual environment.

Running tests

To run the tests for

  • zulip: run ./tools/test-zulip

  • zulip_bots: run ./tools/test-lib && ./tools/test-bots

  • zulip_botserver: run ./tools/test-botserver

To run the linter, type:

./tools/lint

To check the type annotations, run:

./tools/run-mypy