Richard Wen
rrwen.dev@gmail.com
Setup and install a development environment:
- Install git
- Install Anaconda Python 3
- Install GraphViz
- Clone this repository
git clone
- Move to the cloned folder
cd msdss-users-api
- Install python dependencies with
bin\install.bat
orbin/install.sh
In Mac OS (with Homebrew installed):
brew install git graphviz -y
git clone https://www.github.com/rrwen/msdss-users-api
cd msdss-users-api
chmod +x bin/install.sh
source bin/install.sh
In Linux (Ubuntu):
apt install git graphviz -y
git clone https://www.github.com/rrwen/msdss-users-api
cd msdss-users-api
chmod +x bin/install.sh
source bin/install.sh
In Windows (with Chocolatey installed):
choco install git graphviz -y
git clone https://www.github.com/rrwen/msdss-users-api
cd msdss-users-api
bin\install
A conda environment will also be created with bin/install
, which installs the environment defined by env.yml
.
If you are opening a new terminal, you will need to use bin/activate
to activate the environment.
In Linux/Mac OS:
source bin/activate.sh
In Windows:
bin\activate
Note: The environment exists inside the tmp/
folder.
The package can be reinstalled or uninstalled locally using the scripts in the bin
folder.
This is particularly useful when you add or remove package dependencies in setup.cfg
.
For example, you may want to run bin/reinstall_package
after you edit the package dependencies to ensure that all dependencies are met after the changes.
The package can be reinstalled in your virtual environment by running bin/reinstall_package
.
In Linux/Mac OS:
source bin/reinstall_package.sh
In Windows:
bin\reinstall_package
The package can be uninstalled from your virtual environment using bin/uninstall_package
.
In Linux/Mac OS:
source bin/uninstall_package.sh
In Windows:
bin\uninstall_package
The documentation is automatically built with sphinx.
You can build the documentation files into the docs
folder by running bin/build_docs
.
In Linux/Mac OS:
source bin/build_docs.sh
In Windows:
bin\build_docs
You can also completely rebuild the docs (reinstalling the package, and removing existing documentation) with bin/rebuild_docs
.
In Linux/Mac OS:
source bin/rebuild_docs.sh
In Windows:
bin\rebuild_docs
When the package is ready, you can publish it to PyPi so that it is publicly available and pip
installable:
- Remove any existing version builds in the
dist/
folder - Build the current package distribution files in
dist/
withsetup.py sdist
- Upload the package to PyPi with
twine
- You will be prompted for your user name and password on PyPi
- Your package should be available at https://pypi.org/project/msdss-users-api
In Linux/Mac OS:
rm -rf dist
python setup.py sdist
twine upload dist/*
In Windows:
rmdir /s /q dist\
python setup.py sdist
twine upload dist/*
Note: You will need to a registered account on PyPi to publish packages.