Skip to content

Commit ca56ddf

Browse files
authored
docs: improve presentation of contributing guidelines (#550)
* Create Contributing page and add to top nav * Improve title presentation for Contributing on site * Improve title presentation for Contributing on site * Add link to MRE guide on Stack Overflow * Move CONTRIBUTING.md to top level * Link to the CONTRIBUTING.md file in README.md * Add information about setting up dev environment * Add info about the [all] optional install * Add note on running `pre-commit` at terminal * Add statement on req for new tests * Update CONTRIBUTING.md * Move Contributing page to bottom of Get Started * Shorten title of Contributing Guidelines page * Make minor text fixes; ensure two copies of guide
1 parent 4c24bed commit ca56ddf

File tree

5 files changed

+112
-25
lines changed

5 files changed

+112
-25
lines changed

.github/CONTRIBUTING.md

-25
This file was deleted.

CONTRIBUTING.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Contributing Guidelines
2+
3+
There are many ways to contribute to the ongoing development of the Great Tables package. Some contributions can be rather easy to do (e.g., fixing typos, improving documentation, filing issues for feature requests or problems, etc.) whereas other contributions can require more time and patience (like answering questions and submitting pull requests with code changes). Just know that that help provided in any capacity is very much appreciated. :)
4+
5+
## Filing Issues
6+
7+
If you believe you found a bug, minimal reproducible example (MRE) for your posting to the [Great Tables issue tracker](https://github.com/posit-dev/great-tables/issues). Try not to include anything unnecessary, just the minimal amount of code that constitutes the reproducible bug. For useful guidelines on how to create an MRE, take a look at [this guide on Stack Overflow](https://stackoverflow.com/help/minimal-reproducible-example). We will try to verify the bug by running the code in the provided MRE. The quality of the MRE will reduce the amount of back-and-forth communication in trying to understand how to execute the code on our systems.
8+
9+
## Answering questions
10+
11+
One way to help is by simply answering questions. It's amazing how a little conversation could lead to better insights on a problem. Don't quite know the answer? That's okay too. We're all in this together.
12+
13+
Where might you answer user questions? Some of the forums for Q&A on Great Tables include the _Issues_ and _Discussion_ pages in the repo. Good etiquette is key during these interactions: be a good person to all who ask questions.
14+
15+
### Making Pull Requests
16+
17+
Should you consider making a pull request (PR), please file an issue first and explain the problem in some detail. If the PR is an enhancement, detail how the change would make things better for package users. Bugfix PRs also require some explanation about the bug and how the proposed fix will remove that bug. A great way to illustrate the bug is to include an MRE. While all this upfront work prior to preparing a PR can be time-consuming it opens a line of communication with the package authors and the community, perhaps leading to a better enhancement or more effective fixes!
18+
19+
Once there is consensus that a PR based on the issue would be helpful, adhering to the following process will make things proceed more quickly:
20+
21+
- Create a separate Git branch for each PR
22+
- Look at the build status badges before and after making changes; these badges are available in the package [README](https://github.com/posit-dev/great-tables)
23+
- The Great Tables package follows the [Style Guide for Python Code](https://peps.python.org/pep-0008/) so please adopt those guidelines in your submitted code as best as possible
24+
- Comment your code, particularly in those hard-to-understand areas
25+
- Add test cases that cover the changes made in the PR; having tests for any new codepaths will help guard against regressions
26+
27+
### Setting Up Your Development Environment
28+
29+
To set up your development environment, you can follow these steps:
30+
31+
- Clone the posit-dev/great-tables repository
32+
- Create a virtual environment for the folder
33+
- Install the package in editable mode with `pip install -e .` from the root of the project folder
34+
- Install the development dependencies with `pip install .[dev]` (have a look at the `pyproject.toml` file for the list of development dependencies)
35+
36+
Our documentation use `quartodoc` which in turn requires a local install of the Quarto CLI. To install Quarto, go to <https://quarto.org/docs/get-started/> to get the latest build for your platform.
37+
38+
We also use `ruff` for linting and formatting (this is part of our development dependencies). If using VS Code as your editor, it may be useful to install the `Ruff` extension. This will make it so any commits will pass the `pre-commit` checks. You can verify that any changes pass all pre-commit checks by running `pre-commit run --all-files`.
39+
40+
If you are planning to investigate or submit a PR concerning the generation of table images, you need to install additional dependencies (`selenium`and`Pillow`) and this can be done by using `pip install .[all]`.
41+
42+
### Building the Documentation Locally
43+
44+
Building the documentation can be done with `make docs-build` from the root of the project folder. Locally building the documentation site is useful when you want to see how your changes will look during iteration. The site will be built in the `docs/_site` folder.
45+
46+
### Running Tests Locally
47+
48+
The tests are located in the `tests` folder and we use `pytest` for running them. To run all of the tests, use `make test`. If you want to run a specific test file, you can use `pytest tests/test_file.py`.
49+
50+
If you create new tests involving snapshots, please ensure that the resulting snapshots are relatively small. After adding snapshots, use `make test-update` (this runs `pytest --snapshot-update`). A subsequent use of `make test` should pass without any issues.

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ If you encounter a bug, have usage questions, or want to share ideas to make thi
106106

107107
Please note that the **Great Tables** project is released with a [contributor code of conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).<br>By participating in this project you agree to abide by its terms.
108108

109+
## Contributing to **Great Tables**
110+
111+
There are many ways to contribute to the ongoing development of the **Great Tables** package. Some contributions can be simple (like fixing typos, improving documentation, filing issues for feature requests or problems, etc.) and others might take more time and care (like answering questions and submitting PRs with code changes). Just know that anything you can do to help would be very much appreciated!
112+
113+
Please read over the [contributing guidelines](https://github.com/posit-dev/great-tables/blob/main/CONTRIBUTING.md) for information on how to get started.
114+
109115
## 📄 License
110116

111117
**Great Tables** is licensed under the MIT license.

docs/_quarto.yml

+3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ website:
5252
- get-started/column-selection.qmd
5353
- get-started/row-selection.qmd
5454
- get-started/loc-selection.qmd
55+
- section: Extra
56+
contents:
57+
- get-started/contributing.qmd
5558

5659
format:
5760
html:

docs/get-started/contributing.qmd

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
title: Contributing Guidelines
3+
format: html
4+
---
5+
6+
There are many ways to contribute to the ongoing development of the Great Tables package. Some contributions can be rather easy to do (e.g., fixing typos, improving documentation, filing issues for feature requests or problems, etc.) whereas other contributions can require more time and patience (like answering questions and submitting pull requests with code changes). Just know that that help provided in any capacity is very much appreciated. :)
7+
8+
## Filing Issues
9+
10+
If you believe you found a bug, minimal reproducible example (MRE) for your posting to the [Great Tables issue tracker](https://github.com/posit-dev/great-tables/issues). Try not to include anything unnecessary, just the minimal amount of code that constitutes the reproducible bug. For useful guidelines on how to create an MRE, take a look at [this guide on Stack Overflow](https://stackoverflow.com/help/minimal-reproducible-example). We will try to verify the bug by running the code in the provided MRE. The quality of the MRE will reduce the amount of back-and-forth communication in trying to understand how to execute the code on our systems.
11+
12+
## Answering questions
13+
14+
One way to help is by simply answering questions. It's amazing how a little conversation could lead to better insights on a problem. Don't quite know the answer? That's okay too. We're all in this together.
15+
16+
Where might you answer user questions? Some of the forums for Q&A on Great Tables include the _Issues_ and _Discussion_ pages in the repo. Good etiquette is key during these interactions: be a good person to all who ask questions.
17+
18+
### Making Pull Requests
19+
20+
Should you consider making a pull request (PR), please file an issue first and explain the problem in some detail. If the PR is an enhancement, detail how the change would make things better for package users. Bugfix PRs also require some explanation about the bug and how the proposed fix will remove that bug. A great way to illustrate the bug is to include an MRE. While all this upfront work prior to preparing a PR can be time-consuming it opens a line of communication with the package authors and the community, perhaps leading to a better enhancement or more effective fixes!
21+
22+
Once there is consensus that a PR based on the issue would be helpful, adhering to the following process will make things proceed more quickly:
23+
24+
- Create a separate Git branch for each PR
25+
- Look at the build status badges before and after making changes; these badges are available in the package [README](https://github.com/posit-dev/great-tables)
26+
- The Great Tables package follows the [Style Guide for Python Code](https://peps.python.org/pep-0008/) so please adopt those guidelines in your submitted code as best as possible
27+
- Comment your code, particularly in those hard-to-understand areas
28+
- Add test cases that cover the changes made in the PR; having tests for any new codepaths will help guard against regressions
29+
30+
### Setting Up Your Development Environment
31+
32+
To set up your development environment, you can follow these steps:
33+
34+
- Clone the posit-dev/great-tables repository
35+
- Create a virtual environment for the folder
36+
- Install the package in editable mode with `pip install -e .` from the root of the project folder
37+
- Install the development dependencies with `pip install .[dev]` (have a look at the `pyproject.toml` file for the list of development dependencies)
38+
39+
Our documentation use `quartodoc` which in turn requires a local install of the Quarto CLI. To install Quarto, go to <https://quarto.org/docs/get-started/> to get the latest build for your platform.
40+
41+
We also use `ruff` for linting and formatting (this is part of our development dependencies). If using VS Code as your editor, it may be useful to install the `Ruff` extension. This will make it so any commits will pass the `pre-commit` checks. You can verify that any changes pass all pre-commit checks by running `pre-commit run --all-files`.
42+
43+
If you are planning to investigate or submit a PR concerning the generation of table images, you need to install additional dependencies (`selenium`and`Pillow`) and this can be done by using `pip install .[all]`.
44+
45+
### Building the Documentation Locally
46+
47+
Building the documentation can be done with `make docs-build` from the root of the project folder. Locally building the documentation site is useful when you want to see how your changes will look during iteration. The site will be built in the `docs/_site` folder.
48+
49+
### Running Tests Locally
50+
51+
The tests are located in the `tests` folder and we use `pytest` for running them. To run all of the tests, use `make test`. If you want to run a specific test file, you can use `pytest tests/test_file.py`.
52+
53+
If you create new tests involving snapshots, please ensure that the resulting snapshots are relatively small. After adding snapshots, use `make test-update` (this runs `pytest --snapshot-update`). A subsequent use of `make test` should pass without any issues.

0 commit comments

Comments
 (0)