If you are interested in contributing to wei, your contributions will fall into two categories:
- You want to implement a new feature:
- In general, we accept any features as long as they fit the scope of this package. If you are unsure about this or need help on the design/implementation of your feature, post about it in an issue.
- You want to fix a bug:
- Please post an issue using the Bug template which provides a clear and concise description of what the bug was.
Once you finish implementing a feature or bug-fix, please send a Pull Request to https://github.com/AD-SDL/wei.
To develop wei on your machine, please follow these instructions:
- Clone a copy of wei from source:
git clone https://github.com/AD-SDL/wei.git
cd wei
- If you already have wei from source, update it:
git pull
- Install wei in
develop
mode:
conda create -n rpl-wei python=3.9
conda activate rpl-wei
pip3 install --upgrade pip setuptools wheel
pip3 install -r requirements/dev.txt
pip3 install -r requirements/requirements.txt
pip3 install -e .
This mode will symlink the Python files from the current local source tree into the Python install. Hence, if you modify a Python file, you do not need to reinstall wei again and again.
- Ensure that you have a working
wei
installation by running:
python3 -c "import wei; print(wei.__version__)"
- To run dev tools (isort, flake8, black):
make
To run the test suite:
- Build and install wei from source.
- The
requirements/dev.txt
contains the additional testing dependencies. - Run the test suite:
pytest test -vs
If contributing, please add a test_<module_name>.py
in the test/
directory
in a subdirectory that matches the wei package directory structure. Inside,
test_<module_name>.py
implement test functions using pytest.
To build the documentation:
- Build and install wei from source.
- The
requirements/dev.txt
contains all the dependencies needed to build the documentation. - Generate the documentation file via:
cd wei/docs
make html
The docs are located in wei/docs/build/html/index.html
.
To view the docs run: open wei/docs/build/html/index.html
.
To release a new version of wei to PyPI:
- Merge the
develop
branch into themain
branch with an updated version number inwei.__init__
. - Make a new release on GitHub with the tag and name equal to the version number.
- Build and install wei from source.
- Run the following commands:
python3 setup.py sdist
twine upload dist/*