Skip to content

Commit fb88bfc

Browse files
Restore minimal CONTRIBUTING.md that treats website as source of truth (move-coop#1106)
1 parent 72b2ee4 commit fb88bfc

File tree

1 file changed

+4
-200
lines changed

1 file changed

+4
-200
lines changed

CONTRIBUTING.md

+4-200
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1+
# Contributing to Parsons
2+
13
We're thrilled that you're thinking about contributing to Parsons! Welcome to our contributor community.
24

35
You can find a detailed version of this guide [on our website](https://www.parsonsproject.org/pub/contributing-guide/).
46

5-
The best way to get involved is by joining our Slack. To join, email [email protected]. In addition to
6-
all the great discussions that happen on our Slack, we also have virtual events including trainings, pairing sessions,
7-
social hangouts, discussions, and more. Every other Thursday afternoon we host 🎉 Parsons Parties 🎉 on Zoom where we work
8-
on contributions together.
7+
The best way to get involved is by joining our Slack. To join, email <[email protected]>. In addition to all the great discussions that happen on our Slack, we also have virtual events including trainings, pairing sessions, social hangouts, discussions, and more. Every other Thursday afternoon we host 🎉 Parsons Parties 🎉 on Zoom where we work on contributions together.
98

109
You can contribute by:
1110

@@ -15,199 +14,4 @@ You can contribute by:
1514
* [teaching and mentoring](https://www.parsonsproject.org/pub/contributing-guide#teaching-and-mentoring)
1615
* [helping "triage" issues and review pull requests](https://www.parsonsproject.org/pub/contributing-guide#maintainer-tasks)
1716

18-
We encourage folks to review existing issues before starting a new issue.
19-
20-
* If the issue you want exists, feel free to use the *thumbs up* emoji to up vote the issue.
21-
* If you have additional documentation or context that would be helpful, please add using comments.
22-
* If you have code snippets, but don’t have time to do the full write, please add to the issue!
23-
24-
We use labels to help us classify issues. They include:
25-
26-
* **bug** - something in Parsons isn’t working the way it should
27-
* **enhancement** - new feature or request (e.g. a new API connector)
28-
* **good first issue** - an issue that would be good for someone who is new to Parsons
29-
30-
## Contributing Code to Parsons
31-
32-
Generally, code contributions to Parsons will be either enhancements or bug requests (or contributions
33-
of [sample code](#sample-code), discussed below). All changes to the repository are
34-
made [via pull requests](#submitting-a-pull-request).
35-
36-
If you would like to contribute code to Parsons, please review the issues in the repository and find one you would like
37-
to work on. If you are new to Parsons or to open source projects, look for issues with the [**good first issue
38-
**](https://github.com/move-coop/parsons/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) label. Once you
39-
have found your issue, please add a comment to the issue that lets others know that you are interested in working on it.
40-
If you're having trouble finding something to work on, please ask us for help on Slack.
41-
42-
The bulk of Parsons is made up of Connector classes, which are Python classes that help move data in and out of third
43-
party services. When you feel ready, you may want to contribute
44-
by [adding a new Connector class](https://move-coop.github.io/parsons/html/build_a_connector.html).
45-
46-
### Making Changes to Parsons
47-
48-
To make code changes to Parsons, you'll need to set up your development environment, make your changes, and then submit
49-
a pull request.
50-
51-
To set up your development environment:
52-
53-
* Fork the Parsons project using [the “Fork” button in GitHub](https://guides.github.com/activities/forking/)
54-
* Clone your fork to your local computer
55-
* Set up a [virtual environment](#virtual-environments)
56-
* Install the [dependencies](#installing-dependencies)
57-
* Check that everything's working by [running the unit tests](#unit-tests) and the [linter](#linting)
58-
59-
Now it's time to make your changes. We suggest taking a quick look at our [coding conventions](#coding-conventions) -
60-
it'll make the review process easier down the line. In addition to any code changes, make sure to update the
61-
documentation and the unit tests if necessary. Not sure if your changes require test or documentation updates? Just ask
62-
in Slack or through a comment on the relevant issue. When you're done, make sure to run the [unit tests](#unit-tests)
63-
and the [linter](#linting) again.
64-
65-
Finally, you'll want to [submit a pull request](#submitting-a-pull-request). And that's it!
66-
67-
#### Virtual Environments
68-
69-
If required dependencies conflict with packages or modules you need for other projects, you can create and use
70-
a [virtual environment](https://docs.python.org/3/library/venv.html).
71-
72-
```
73-
> python3 -m venv .venv # Creates a virtual environment in the .venv folder
74-
> source .venv/bin/activate # Activate in Unix or MacOS
75-
> .venv/Scripts/activate.bat # Activate in Windows
76-
```
77-
78-
#### Installing Dependencies
79-
80-
Before running or testing your code changes, be sure to install all of the required Python libraries that Parsons
81-
depends on.
82-
83-
From the root of the parsons repository, use the run the following command:
84-
85-
```bash
86-
> pip install -r requirements.txt
87-
> pip install -r requirements-dev.txt
88-
```
89-
90-
#### Unit Tests
91-
92-
When contributing code, we ask you to add to tests that can be used to verify that the code is working as expected. All
93-
of our unit tests are located in the `test/` folder at the root of the repository.
94-
95-
We use the pytest tool to run our suite of automated unit tests. The pytest command line tool is installed as part of
96-
the Parsons dependencies.
97-
98-
To run all the entire suite of unit tests, execute the following command:
99-
100-
```bash
101-
> pytest
102-
```
103-
104-
Once the pytest tool has finished running all of the tests, it will output details around any errors or test failures it
105-
encountered. If no failures are identified, then you are good to go!
106-
107-
**Note:*** Some tests are written to call out to external API’s, and will be skipped as part of standard unit testing.
108-
This is expected.
109-
110-
See the [pytest documentation](https://docs.pytest.org/en/latest/contents.html) for more info and many more options.
111-
112-
#### Linting
113-
114-
We use the [black](https://github.com/psf/black) and [flake8](http://flake8.pycqa.org/en/latest/) tools
115-
to [lint](https://en.wikipedia.org/wiki/Lint_(software)) the code in the repository to make sure it matches our
116-
preferred style. Both tools are installed as part of the Parsons dependencies.
117-
118-
Run the following commands from the root of the Parsons repository to lint your code changes:
119-
120-
```bash
121-
> flake8 parsons/ test/ useful_resources/
122-
> black parsons/ test/ useful_resources/
123-
```
124-
125-
Pre-commit hooks are available to enforce black and isort formatting on
126-
commit. You can also set up your IDE to reformat using black and/or isort on
127-
save.
128-
129-
To set up the pre-commit hooks, install pre-commit with `pip install
130-
pre-commit`, and then run `pre-commit install`.
131-
132-
#### Coding Conventions
133-
134-
The following is a list of best practices to consider when writing code for the Parsons project:
135-
136-
* Each tool connector should be its own unique class (e.g. ActionKit, VAN) in its own Python package. Use existing
137-
connectors as examples when deciding how to layout your code.
138-
139-
* Methods should be named using a verb_noun structure, such as `get_activist()` or `update_event()`.
140-
141-
* Methods should reflect the vocabulary utilized by the original tool where possible to mantain transparency. For
142-
example, Google Cloud Storage refers to file like objects as blobs. The methods are called `get_blob()` rather
143-
than `get_file()`.
144-
145-
* Methods that can work with arbitrarily large data (e.g. database or API queries) should use of Parson Tables to hold
146-
the data instead of standard Python collections (e.g. lists, dicts).
147-
148-
* You should avoid abbreviations for method names and variable names where possible.
149-
150-
* Inline comments explaining complex codes and methods are appreciated.
151-
152-
* Capitalize the word Parsons for consistency where possible, especially in documentation.
153-
154-
If you are building a new connector or extending an existing connector, there are more best practices in
155-
the [How to Build a Connector](https://move-coop.github.io/parsons/html/build_a_connector.html) documentation.
156-
157-
## Documentation
158-
159-
Parsons documentation is built using the Python Sphinx tool. Sphinx uses the `docs/*.rst` files in the repository to
160-
create the documentation.
161-
162-
We have
163-
a [documentation label](https://github.com/move-coop/parsons/issues?q=is%3Aissue+is%3Aopen+label%3Adocumentation) that
164-
may help you find good docs issues to work on. If you are adding a new connector, you will need to add a reference to
165-
the connector to one of the .rst files. Please use the existing documentation as an example.
166-
167-
When editing documentation, make sure you are editing the source files (with .md or .rst extension) and not the build
168-
files (.html extension).
169-
170-
The workflow for documentation changes is a bit simpler than for code changes:
171-
172-
* Fork the Parsons project using [the “Fork” button in GitHub](https://guides.github.com/activities/forking/)
173-
* Clone your fork to your local computer
174-
* Change into the `docs` folder and install the requirements with `pip install -r requirements.txt` (you may want to set
175-
up a [virtual environment](#virtual-environments) first)
176-
* Make your changes and re-build the docs by running `make html`. (Note: this builds only a single version of the docs,
177-
from the current files. To create docs with multiple versions like our publicly hosted docs, run `make deploy_docs`.)
178-
* Open these files in your web browser to check that they look as you expect.
179-
* [Submit a pull request](#submitting-a-pull-request)
180-
181-
When you make documentation changes, you only need to track the source files with git. The docs built by the html folder
182-
should not be included.
183-
184-
You should not need to worry about the unit tests or the linter if you are making documentation changes only.
185-
186-
## Contributing Sample Code
187-
188-
One important way to contribute to the Parsons project is to submit sample code that provides recipes and patterns for
189-
how to use the Parsons library.
190-
191-
We have a folder called `useful_resources/` in the root of the repository. If you have scripts that incorporate Parsons,
192-
we encourage you to add them there!
193-
194-
The workflow for adding sample code is:
195-
196-
* Fork the Parsons project using [the “Fork” button in GitHub](https://guides.github.com/activities/forking/)
197-
* Clone your fork to your local computer
198-
* Add your sample code into the `useful_resources/` folder
199-
* [Submit a pull request](#submitting-a-pull-request)
200-
201-
You should not need to worry about the unit tests or the linter if you are only adding sample code.
202-
203-
## Submitting a Pull Request
204-
205-
To submit a pull request,
206-
follow [these instructions to create a Pull Request from your fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork)
207-
back to the original Parsons repository.
208-
209-
The Parsons team will review your pull request and provide feedback. Please feel free to ping us if no one's responded
210-
to your Pull Request after a few days. We may not be able to review it right away, but we should be able to tell you
211-
when we'll get to it.
212-
213-
Once your pull request has been approved, the Parsons team will merge your changes into the Parsons repository
17+
If you're not sure how to get started, please ask for help! We're happy to chat and help you find the best way to get involved.

0 commit comments

Comments
 (0)