@@ -52,40 +52,35 @@ so please read the in-line documentation in the Dockerfile carefully.
52
52
Firstly, begin by forking the [ ` pyjanitor ` repo] [ repo ] on GitHub.
53
53
Then, clone your fork locally:
54
54
55
- [ repo ] : https://github.com/ericmjl /pyjanitor
55
+ [ repo ] : https://github.com/pyjanitor-devs /pyjanitor
56
56
57
57
``` bash
58
- git clone
[email protected] :
your_name_here /pyjanitor.git
58
+ git clone
[email protected] :
< your_github_username > /pyjanitor.git
59
59
```
60
60
61
61
### Setup the conda environment
62
62
63
- Now, install your local copy into a conda environment.
63
+ Now, install your cloned repo into a conda environment.
64
64
Assuming you have conda installed,
65
65
this is how you set up your fork for local development
66
66
67
67
``` bash
68
68
cd pyjanitor/
69
- make install
70
- ```
71
-
72
- This also installs your new conda environment as a Jupyter-accessible kernel.
73
- If you plan to write any notebooks,
74
- to run correctly inside the environment,
75
- make sure you select the correct kernel from the top right corner of JupyterLab!
69
+ # Activate the pyjanitor conda environment
70
+ source activate pyjanitor-dev
76
71
77
- !!! note "Windows Users"
72
+ # Create your conda environment
73
+ conda env create -f environment-dev.yml
78
74
79
- If you are on Windows,
80
- you may need to install `make` before you can run the install.
81
- You can get it from `conda-forge`::
75
+ # Install PyJanitor in development mode
76
+ python setup.py develop
82
77
83
- ``bash
84
- conda install -c defaults -c conda-forge make
85
- ``
86
-
87
- You should be able to run `make` now.
88
- The command above installs `make` to the `~/Anaconda3/Library/bin` directory.
78
+ # Register current virtual environment as a Jupyter Python kernel
79
+ python -m ipykernel install --user --name pyjanitor-dev --display-name " PyJanitor development "
80
+ ` ``
81
+ If you plan to write any notebooks,
82
+ make sure they run correctly inside the environment by
83
+ selecting the correct kernel from the top right corner of JupyterLab!
89
84
90
85
!!! note "PyCharm Users"
91
86
@@ -108,38 +103,26 @@ pre-commit install
108
103
109
104
### Build docs locally
110
105
111
- You should also be able to build the docs locally.
106
+ You should also be able to preview the docs locally.
112
107
To do this, from the main ` pyjanitor ` directory:
113
108
114
109
``` bash
115
- make docs
110
+ python -m mkdocs serve
116
111
```
117
-
118
112
The command above allows you to view the documentation locally in your browser.
119
- ` Sphinx (a python documentation generator) <http://www.sphinx-doc.org/en/stable/usage/quickstart.html> ` _ builds and renders the html for you,
120
- and you can find the html files by navigating to ` pyjanitor/docs/_build ` ,
121
- and then you can find the correct html file.
122
- To see the main pyjanitor page,
123
- open the ` index.html ` file.
124
-
125
- !!! note "Errors with documentation builds"
126
-
127
- If you get any errors about importing modules when running `make docs`,
128
- first activate the development environment:
129
113
130
- ``bash
131
- source activate pyjanitor-dev || conda activate pyjanitor-dev
132
- ``
114
+ If you get any errors about importing modules when running ` mkdocs serve ` ,
115
+ first activate the development environment:
133
116
134
- Sphinx uses ` rst files (restructured text) <http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html> ` _ as its markdown language.
135
- To edit documentation,
136
- go to the rst file that corresponds to the html file you would like to edit.
137
- Make the changes directly in the rst file with the correct markup.
138
- Save the file and rebuild the html pages using the same commands as above to see what your changes look like in html.
117
+ ``` bash
118
+ source activate pyjanitor-dev || conda activate pyjanitor-dev
119
+ ```
139
120
140
121
### Plan out the change you'd like to contribute
141
122
142
- The old adage rings true: failing to plan means planning to fail.
123
+ The old adage rings true:
124
+ > failing to plan means planning to fail.
125
+
143
126
We'd encourage you to flesh out the idea you'd like to contribute
144
127
on the GitHub issue tracker before embarking on a contribution.
145
128
Submitting new code, in particular,
@@ -152,7 +135,7 @@ submit an issue to the [`pyjanitor` GitHub issue tracker][issuetracker]
152
135
describing your planned changes.
153
136
The issue tracker also helps us keep track of who is working on what.
154
137
155
- [ issuetracker ] : https://github.com/ericmjl/ pyjanitor/issues
138
+ [ issuetracker ] : https://github.com/pyjanitor-devs/pyjanitor
156
139
157
140
### Create a branch for local development
158
141
@@ -163,38 +146,52 @@ based off the latest version of the `dev` branch.
163
146
To create a new branch:
164
147
165
148
``` bash
166
- git checkout -b name-of-your-bugfix-or-feature dev
149
+ git checkout -b < name-of-your-bugfix-or-feature> dev
167
150
```
168
151
169
152
Now you can make your changes locally.
170
153
171
- ### Check your code
154
+ ### Check your environment
172
155
173
- When you're done making changes,
174
- check that your changes are properly formatted and that all tests still pass::
156
+ To ensure that your environemnt is properly set up, run the following command:
175
157
176
158
``` bash
177
- make check
159
+ python -m pytest -m " not turtle "
178
160
```
179
161
180
- If any of the checks fail, you can apply the checks individually (to save time):
162
+ If all tests pass then your environment is setup for
163
+ development and you are ready to contribute 🥳.
164
+
165
+ ### Check your code
166
+
167
+ When you're done making changes, commit your staged files with a meaningful message.
168
+ While we have automated checks that run before code is commited via pre-commit and GitHub Actions
169
+ to run tests before code can be merged,
170
+ you can still manually run the following commands to check that your changes are properly
171
+ formatted and that all tests still pass.
172
+
173
+ To do so:
181
174
182
- * Automated code formatting: ` make style `
183
- * Code styling problems check: ` make lint `
184
- * Code unit testing: ` make test `
175
+ * Run ` python -m flake8 --exclude nbconvert_config.py janitor ` to check code styling problems
176
+ * Run ` python -m black -c pyproject.toml ` to format your code.
177
+ * Run ` python -m interrogate -c pyproject.toml ` to check your code for missing docstring.
178
+ * Run ` darglint -v 2 ` to check quality of your docstrings.
179
+ * Run ` python -m pytest ` to run all unit tests.
185
180
186
- Styling problems must be resolved before the pull request can be accepted.
181
+ !!! tip
182
+ You can run ` python -m pytest -m "not turtle" ` to run the fast tests.
187
183
188
- ` make test ` runs all ` pyjanitor ` 's unit tests
189
- to probe whether changes to the source code have potentially introduced bugs.
190
- These tests must also pass before the pull request is accepted,
191
- and the continuous integration system up on GitHub Actions
192
- will help run all of the tests before they are committed to the repository .
184
+ !!! note "Running test locally"
185
+ When you run tests locally,
186
+ the tests in ` chemistry.py ` , ` biology.py ` , ` spark.py `
187
+ are automatically skipped if you don't have
188
+ the optional dependencies (e.g. ` rdkit ` ) installed .
193
189
194
- When you run the test locally,
195
- the tests in ` chemistry.py ` , ` biology.py ` , ` spark.py `
196
- are automatically skipped if you don't have
197
- the optional dependencies (e.g. ` rdkit ` ) installed.
190
+ !!! info
191
+ * pre-commit ** does not run** your tests locally rather all tests are run in continous integration (CI).
192
+ * All tests must pass in CI before the pull request is accepted,
193
+ and the continuous integration system up on GitHub Actions
194
+ will help run all of the tests before they are committed to the repository.
198
195
199
196
### Commit your changes
200
197
@@ -203,12 +200,12 @@ Now you can commit your changes and push your branch to GitHub:
203
200
``` bash
204
201
git add .
205
202
git commit -m " Your detailed description of your changes."
206
- git push origin name-of-your-bugfix-or-feature
203
+ git push origin < name-of-your-bugfix-or-feature>
207
204
```
208
205
209
206
### Submit a pull request through the GitHub website
210
207
211
- Congratulations, you've made it to the penultimate step;
208
+ Congratulations 🎉🎉🎉 , you've made it to the penultimate step;
212
209
your code is ready to be checked and reviewed by the maintainers!
213
210
Head over to the GitHub website and create a pull request.
214
211
When you are picking out which branch to merge into,
0 commit comments