generated from allenai/python-package-template
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
44 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,22 +18,22 @@ code sample or an executable test case demonstrating the expected behavior. | |
|
||
We use GitHub issues to track feature requests. Before you create a feature request: | ||
|
||
* Make sure you have a clear idea of the enhancement you would like. If you have a vague idea, consider discussing | ||
it first on a GitHub issue. | ||
* Check the documentation to make sure your feature does not already exist. | ||
* Do [a quick search](https://github.com/allenai/tango/issues) to see whether your feature has already been suggested. | ||
- Make sure you have a clear idea of the enhancement you would like. If you have a vague idea, consider discussing | ||
it first on a GitHub issue. | ||
- Check the documentation to make sure your feature does not already exist. | ||
- Do [a quick search](https://github.com/allenai/tango/issues) to see whether your feature has already been suggested. | ||
|
||
When creating your request, please: | ||
|
||
* Provide a clear title and description. | ||
* Explain why the enhancement would be useful. It may be helpful to highlight the feature in other libraries. | ||
* Include code examples to demonstrate how the enhancement would be used. | ||
- Provide a clear title and description. | ||
- Explain why the enhancement would be useful. It may be helpful to highlight the feature in other libraries. | ||
- Include code examples to demonstrate how the enhancement would be used. | ||
|
||
## Making a pull request | ||
|
||
When you're ready to contribute code to address an open issue, please follow these guidelines to help us be able to review your pull request (PR) quickly. | ||
|
||
1. **Initial setup** (only do this once) | ||
1. **Initial setup** (only do this once) | ||
|
||
<details><summary>Expand details 👇</summary><br/> | ||
|
||
|
@@ -47,7 +47,7 @@ When you're ready to contribute code to address an open issue, please follow the | |
|
||
git clone [email protected]:USERNAME/tango.git | ||
|
||
At this point the local clone of your fork only knows that it came from *your* repo, github.com/USERNAME/tango.git, but doesn't know anything the *main* repo, [https://github.com/allenai/tango.git](https://github.com/allenai/tango). You can see this by running | ||
At this point the local clone of your fork only knows that it came from _your_ repo, github.com/USERNAME/tango.git, but doesn't know anything the _main_ repo, [https://github.com/allenai/tango.git](https://github.com/allenai/tango). You can see this by running | ||
|
||
git remote -v | ||
|
||
|
@@ -93,7 +93,7 @@ When you're ready to contribute code to address an open issue, please follow the | |
|
||
</details> | ||
|
||
2. **Ensure your fork is up-to-date** | ||
2. **Ensure your fork is up-to-date** | ||
|
||
<details><summary>Expand details 👇</summary><br/> | ||
|
||
|
@@ -105,7 +105,7 @@ When you're ready to contribute code to address an open issue, please follow the | |
|
||
</details> | ||
|
||
3. **Create a new branch to work on your fix or enhancement** | ||
3. **Create a new branch to work on your fix or enhancement** | ||
|
||
<details><summary>Expand details 👇</summary><br/> | ||
|
||
|
@@ -119,11 +119,11 @@ When you're ready to contribute code to address an open issue, please follow the | |
|
||
</details> | ||
|
||
4. **Test your changes** | ||
4. **Test your changes** | ||
|
||
<details><summary>Expand details 👇</summary><br/> | ||
|
||
Our continuous integration (CI) testing runs [a number of checks](https://github.com/allenai/tango/actions) for each pull request on [GitHub Actions](https://github.com/features/actions). You can run most of these tests locally, which is something you should do *before* opening a PR to help speed up the review process and make it easier for us. | ||
Our continuous integration (CI) testing runs [a number of checks](https://github.com/allenai/tango/actions) for each pull request on [GitHub Actions](https://github.com/features/actions). You can run most of these tests locally, which is something you should do _before_ opening a PR to help speed up the review process and make it easier for us. | ||
|
||
First, you should run [`isort`](https://github.com/PyCQA/isort) and [`black`](https://github.com/psf/black) to make sure you code is formatted consistently. | ||
Many IDEs support code formatters as plugins, so you may be able to setup isort and black to run automatically everytime you save. | ||
|
@@ -133,9 +133,9 @@ When you're ready to contribute code to address an open issue, please follow the | |
isort . | ||
black . | ||
|
||
Our CI also uses [`flake8`](https://github.com/allenai/tango/tree/main/tests) to lint the code base and [`mypy`](http://mypy-lang.org/) for type-checking. You should run both of these next with | ||
Our CI also uses [`ruff`](https://github.com/charliermarsh/ruff) to lint the code base and [`mypy`](http://mypy-lang.org/) for type-checking. You should run both of these next with | ||
|
||
flake8 . | ||
ruff check . | ||
|
||
and | ||
|
||
|
@@ -177,19 +177,20 @@ in addition to everything listed in [Making a pull request](#making-a-pull-reque | |
|
||
1. First start by creating a new submodule `tango.integrations.name_of_integration` and put all of the code for your integration in there. | ||
2. Then you must add a module docstring to the `__init__.py` file of the submodule which imports all of the public components of the integration, | ||
and defines the [`__all__`](https://docs.python.org/3/tutorial/modules.html#importing-from-a-package) special variable to include all of those components. | ||
This ensures all of the public components will show up in the documentation. | ||
and defines the [`__all__`](https://docs.python.org/3/tutorial/modules.html#importing-from-a-package) special variable to include all of those components. | ||
This ensures all of the public components will show up in the documentation. | ||
3. Next that you should add unit tests of your code to `tests/integrations/name_of_integration/`. | ||
4. Then add a new file `docs/source/api/integrations/name_of_integration.rst`, and include the directive: | ||
|
||
``` | ||
.. automodule:: tango.integrations.name_of_integration | ||
:members: | ||
``` | ||
``` | ||
.. automodule:: tango.integrations.name_of_integration | ||
:members: | ||
``` | ||
|
||
Take a look at any of the other files in that folder to see how it should look exactly. | ||
|
||
Take a look at any of the other files in that folder to see how it should look exactly. | ||
5. And then add `name_of_integration` to the `toctree` in `docs/source/api/integrations/index.rst`. | ||
6. After that, add any additional requirements that your integration depends on to `requirements.txt`. Be sure to put those under the "Extra dependencies for integrations" section, | ||
and add the special inline comment `# needed by: name_of_integration`. | ||
and add the special inline comment `# needed by: name_of_integration`. | ||
7. And finally, in the `checks` job definition in `.github/workflows/main.yml`, add a new object | ||
to the matrix for your integration following the other examples there. | ||
to the matrix for your integration following the other examples there. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters