Skip to content

Commit 5dfc402

Browse files
nicksspiritericmjl
andauthored
[DOC] Updated developer guide docs (pyjanitor-devs#1094)
* Updated docs * Updated changelog * Updated authors with my contribution Co-authored-by: Eric Ma <[email protected]>
1 parent 3f8f264 commit 5dfc402

File tree

3 files changed

+64
-64
lines changed

3 files changed

+64
-64
lines changed

AUTHORS.md

+1
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,4 @@ Contributors
108108
- [@gahjelle](https://github.com/gahjelle) | [contributions](https://github.com/pyjanitor-devs/pyjanitor/issues?q=is%3Aclosed+mentions%3Agahjelle)
109109
- [@ethompsy](https://github.com/ethompsy) | [contributions](https://github.com/pyjanitor-devs/pyjanitor/issues?q=is%3Aclosed+mentions%3Aethompsy)
110110
- [@apatao](https://github.com/apatao) | [contributions](https://github.com/pyjanitor-devs/pyjanitor/issues?q=is%3Aclosed+mentions%3Aapatao)
111+
- [@OdinTech3](https://github.com/OdinTech3) | [contributions](https://github.com/pyjanitor-devs/pyjanitor/pull/1094)

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## [Unreleased]
44

5+
- [DOC] Updated developer guide docs.
6+
57
## [v0.23.1] - 2022-05-03
68

79
- [DOC] Updated `fill.py` and `update_where.py` documentation with working examples.

mkdocs/devguide.md

+61-64
Original file line numberDiff line numberDiff line change
@@ -52,40 +52,35 @@ so please read the in-line documentation in the Dockerfile carefully.
5252
Firstly, begin by forking the [`pyjanitor` repo][repo] on GitHub.
5353
Then, clone your fork locally:
5454

55-
[repo]: https://github.com/ericmjl/pyjanitor
55+
[repo]: https://github.com/pyjanitor-devs/pyjanitor
5656

5757
```bash
58-
git clone [email protected]:your_name_here/pyjanitor.git
58+
git clone [email protected]:<your_github_username>/pyjanitor.git
5959
```
6060

6161
### Setup the conda environment
6262

63-
Now, install your local copy into a conda environment.
63+
Now, install your cloned repo into a conda environment.
6464
Assuming you have conda installed,
6565
this is how you set up your fork for local development
6666

6767
```bash
6868
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
7671

77-
!!! note "Windows Users"
72+
# Create your conda environment
73+
conda env create -f environment-dev.yml
7874

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
8277

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!
8984

9085
!!! note "PyCharm Users"
9186

@@ -108,38 +103,26 @@ pre-commit install
108103

109104
### Build docs locally
110105

111-
You should also be able to build the docs locally.
106+
You should also be able to preview the docs locally.
112107
To do this, from the main `pyjanitor` directory:
113108

114109
```bash
115-
make docs
110+
python -m mkdocs serve
116111
```
117-
118112
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:
129113

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:
133116

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+
```
139120

140121
### Plan out the change you'd like to contribute
141122

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+
143126
We'd encourage you to flesh out the idea you'd like to contribute
144127
on the GitHub issue tracker before embarking on a contribution.
145128
Submitting new code, in particular,
@@ -152,7 +135,7 @@ submit an issue to the [`pyjanitor` GitHub issue tracker][issuetracker]
152135
describing your planned changes.
153136
The issue tracker also helps us keep track of who is working on what.
154137

155-
[issuetracker]: https://github.com/ericmjl/pyjanitor/issues
138+
[issuetracker]: https://github.com/pyjanitor-devs/pyjanitor
156139

157140
### Create a branch for local development
158141

@@ -163,38 +146,52 @@ based off the latest version of the `dev` branch.
163146
To create a new branch:
164147

165148
```bash
166-
git checkout -b name-of-your-bugfix-or-feature dev
149+
git checkout -b <name-of-your-bugfix-or-feature> dev
167150
```
168151

169152
Now you can make your changes locally.
170153

171-
### Check your code
154+
### Check your environment
172155

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:
175157

176158
```bash
177-
make check
159+
python -m pytest -m "not turtle"
178160
```
179161

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:
181174

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.
185180

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.
187183

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.
193189

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.
198195

199196
### Commit your changes
200197

@@ -203,12 +200,12 @@ Now you can commit your changes and push your branch to GitHub:
203200
```bash
204201
git add .
205202
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>
207204
```
208205

209206
### Submit a pull request through the GitHub website
210207

211-
Congratulations, you've made it to the penultimate step;
208+
Congratulations 🎉🎉🎉, you've made it to the penultimate step;
212209
your code is ready to be checked and reviewed by the maintainers!
213210
Head over to the GitHub website and create a pull request.
214211
When you are picking out which branch to merge into,

0 commit comments

Comments
 (0)