Skip to content

Update CONTRIBUTING.md to enhance development guidelines #824

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

Merged
merged 3 commits into from
Jul 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 68 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,76 @@
## How to contribute to LINE Bot SDK for Python project
# How to contribute to LINE Bot SDK for Python project

First of all, thank you so much for taking your time to contribute! LINE Bot SDK for Python is not very different from any other open
source projects you are aware of. It will be amazing if you could help us by doing any of the following:
First of all, thank you so much for taking your time to contribute!
LINE Bot SDK for Python is not very different from any other open source projects you are aware of.
It will be amazing if you could help us by doing any of the following:

- File an issue in [the issue tracker](https://github.com/line/line-bot-sdk-python/issues) to report bugs and propose new features and
improvements.
- Ask a question using [the issue tracker](https://github.com/line/line-bot-sdk-python/issues).
- File an issue in [the issue tracker](https://github.com/line/line-bot-sdk-python/issues) to report bugs and propose new features and improvements.
- Ask a question using [the issue tracker](https://github.com/line/line-bot-sdk-python/issues) (__Please ask only about this SDK__).
- Contribute your work by sending [a pull request](https://github.com/line/line-bot-sdk-python/pulls).

### Contributor license agreement
## Development

### Install dependencies

Run `pip install -r requirements-dev.txt` to install all dependencies for development and testing.

### Understand the project structure

The project structure is as follows:

- `linebot`: The main library code.
- `tests`: Test code.
- `examples`: Example projects that use the library.
- `generator`: Custom OpenAPI generator for Python code.
- `tools`: Development tools.
- `docs`: Documentation files for Sphinx.

### Edit OpenAPI templates

Most of the API client code is generated with OpenAPI Generator based on [line-openapi](https://github.com/line/line-openapi)'s YAML files.
You cannot edit almost all code under `linebot/v3/` directly.

If you need to change the generated code, you should modify the custom templates under:
- `generator/src/main/resources/python-nextgen-custom-client/`

After editing the templates, run `python generate-code.py` to regenerate the code, and then commit all affected files.
If not, CI status will fail.

When you update code, be sure to check consistencies between generated code and your changes.

### Add unit tests

We use [pytest](https://pytest.org/) for unit tests.
Please add tests to the appropriate test directories to verify your changes.

Especially for bug fixes, please follow this flow for testing and development:
1. Write a test before making changes to the library and confirm that the test fails.
2. Modify the code of the library.
3. Run the test again and confirm that it passes thanks to your changes.

### Run your code in your local environment

You can use the [example projects](examples/) to test your changes locally before submitting a pull request.

### Run CI tasks in your local environment

Test by using tox.
To run all tests and to run flake8 against all versions, use: `tox`

To run all tests against version 3.10, use: `tox -e py3.10`

To run a test against version 3.10 and against a specific file, use: `tox -e py3.10 -- tests/test_webhook.py`

### Documentation

If you edit README.rst, you should execute the following command to check the syntax of README.

```
python -m readme_renderer README.rst
```

## Contributor license agreement

When you are sending a pull request and it's a non-trivial change beyond fixing typos, please make sure to sign
[the ICLA (individual contributor license agreement)](https://cla-assistant.io/line/line-bot-sdk-python). Please
[contact us](mailto:dl_oss_dev@linecorp.com) if you need the CCLA (corporate contributor license agreement).

57 changes: 0 additions & 57 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -376,63 +376,6 @@ Contributing
------------
Please check `CONTRIBUTING <CONTRIBUTING.md>`__ before making a contribution.

For SDK developers
------------------

First install for development.

::

$ pip install -r requirements-dev.txt


You can generate new or fixed models and APIs by this command.

::

$ python generate-code.py


When you update line-bot-sdk-python version, please update `linebot/__about__.py <linebot/__about__.py>`__ and generate code again.


If you edit `README.rst <README.rst>`__, you should execute the following command to check the syntax of README.

::

$ python -m readme_renderer README.rst


Run tests
~~~~~~~~~

Test by using tox. We test against the following versions.

- 3.9
- 3.10
- 3.11
- 3.12
- 3.13

To run all tests and to run ``flake8`` against all versions, use:

::

tox

To run all tests against version 3.10, use:

::

$ tox -e py3.10

To run a test against version 3.10 and against a specific file, use:

::

$ tox -e py3.10 -- tests/test_webhook.py


Comment on lines -379 to -435
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will be excluded as it duplicates the content of CONTRIBUTING.md. Since there is already a link to CONTRIBUTING.md, it is unnecessary.

.. |PyPI version| image:: https://badge.fury.io/py/line-bot-sdk.svg
:target: https://badge.fury.io/py/line-bot-sdk

Expand Down