Fake Driver supported and maintained by the Volttron team.
Project description
volttron-lib-fake-driver
This project contains Drivers supported and maintained by the Volttron team.
Prerequisites
- Python 3.8
- Poetry 1.2.2
Python
To install Python 3.8, we recommend using pyenv
.
# install pyenv
git clone https://github.com/pyenv/pyenv ~/.pyenv
# setup pyenv (you should also put these three lines in .bashrc or similar)
export PATH="${HOME}/.pyenv/bin:${PATH}"
export PYENV_ROOT="${HOME}/.pyenv"
eval "$(pyenv init -)"
# install Python 3.8
pyenv install 3.8.10
# make it available globally
pyenv global system 3.8.10
Poetry
This project uses poetry
to install and manage dependencies. To install poetry,
follow these instructions.
Installation
With pip
:
python3.8 -m pip install volttron-lib-fake-driver
# Develop mode
python3.8 -m pip install --editable volttron-lib-fake-driver
Development
Environment
Set the environment to be in your project directory:
poetry config virtualenvs.in-project true
If you want to install all your dependencies, including dependencies to help with developing your agent, run this command:
poetry install
If you want to install only the dependencies needed to run your agent, run this command:
poetry install --no-dev
Activate the virtual environment:
# using Poetry
poetry shell
# using 'source' command
source "$(poetry env info --path)/bin/activate"
Source Control
- To use git to manage version control, create a new git repository in your local agent project.
git init
-
Then create a new repo in your Github or Gitlab account. Copy the URL that points to that new repo in your Github or Gitlab account. This will be known as our 'remote'.
-
Add the remote (i.e. the new repo URL from your Github or Gitlab account) to your local repository. Run the following command:
git remote add origin <my github/gitlab URL>
When you push to your repo, note that the default branch is called 'main'.
Optional Configurations
Precommit
Note: Ensure that you have created the virtual environment using Poetry
Install pre-commit hooks:
poetry run pre-commit install
To run pre-commit on all your files, run this command:
poetry run pre-commit run --all-files
If you have precommit installed and you want to ignore running the commit hooks
every time you run a commit, include the --no-verify
flag in your commit. The following
is an example:
git commit -m "Some message" --no-verify
Publishing to PyPi
Publishing your Driver module to PyPi is automated through the continuous integration workflow provided in ~/.github/workflows/publish_to_pypi.yml
.
You can update that Github Workflow with your credentials to ensure that publishing to PyPi will succeed. The default behavior of
that workflow is to publish to PyPi when a release has been published. If you want to change this behavior, you can modify the
workflow to publish to PyPi based on whatever desired event; see Github Workflows docs
on how to change the events that trigger a workflow.
Documentation
To build the docs, navigate to the 'docs' directory and build the documentation:
cd docs
make html
After the documentation is built, view the documentation in html form in your browser.
The html files will be located in ~<path to project directory>/docs/build/html
.
PROTIP: To open the landing page of your documentation directly from the command line, run the following command:
open <path to project directory>/docs/build/html/index.html
This will open the documentation landing page in your default browsert (e.g. Chrome, Firefox).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for volttron_lib_fake_driver-0.1.1a2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e3744702e7d3c674f5315dc40884c9a8a86deb631278f4f34056b7920bc1654 |
|
MD5 | d53209b3fa2c9656f2bfa19b0e42787a |
|
BLAKE2b-256 | e0e966111715c107e4bc7f97cbe6244a95d3b0dd4f2bfae6f347c379e6da53c9 |
Hashes for volttron_lib_fake_driver-0.1.1a2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9243038385e156e85e3241ab21fc7aef4e95e8698fa38f86a6c8ae9daf04cc2b |
|
MD5 | d62877b8bc4479a22b0bb76f51b9d264 |
|
BLAKE2b-256 | e2a47405a956acc77ea7321c7d0da66d793ba766dc15e06128c9472fa5e98264 |