Getting Started
Python installation¶
Python can be downloaded here.
For further information on how to install Python on your operating system :
On OSx you can also install Python through HomeBrew
, which would also install pip along, to do so, you need to install HomeBrew and then run the following command : brew install python3
pip¶
pip is the standard package manager for Python. It allows you to install and manage additional packages that are not part of the Python standard library.
Install pip
¶
On Windows¶
- Download get-pip.py
- Open your terminal (
powershell
,cmd
, ...) and navigate to the folder containingget-pip.py
- Run the following command :
python get-pip.py
- Pip is now installed
On Unix¶
Debian / Ubuntu:
sudo apt install python3-pip
CentOS / Rhel:
sudo yum install epel-release
sudo yum install python-pip
Fedora:
sudo dnf install python3
Arch Linux:
sudo pacman -S python-pip
openSUSE:
sudo zypper install python3-pip
On macOS:
Download get-pip.py
and then run it
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
With Brew:
brew install python3
You can verify that
pip
was installed properly by running the following command in your terminal :pip -V
which should returns the version of the installedpip
program.
Development¶
-
Fork the package.
-
Clone your forked repository.
git clone https://github.com/<githubusername>/python-client
- Next, move into the fresh cloned directory.
cd python-client
- The next step would be to create something like a virtual environment to ensure no name clashes occur.
- Create and enter the virtual environment
# With virtualenv (on Unix and OSx)
mkdir my-amazing-solar-project
cd my-amazing-solar-project
virtualenv virtualEnvName
source venv/bin/activate
# With virtualenv (on Windows)
mkdir my-amazing-solar-project
cd my-amazing-solar-project
virtualenv virtualEnvName
.\venv\Scripts\activate.bat
- Once inside the virtualenv, you can proceed to install the dependencies. These are listed inside the setup.py file.
pip install \
requests \
backoff \
flake8 \
flake8-import-order \
flake8-print \
flake8-quotes \
pytest \
pytest-responses \
pytest-mock \
pytest-cov
- Dependencies are now installed, you can now run the tests to see if everything is running as it should.
pytest