Python API for the T.A.R.A.L.L.O. Inventory System
Create a python3 virtual environment
python3 -m venv venv
or using virtualenv
virtualenv -p python3 venv
Create a file named .env
(a dot followed by the word "env") with this content:
export TARALLO_URL=http://127.0.0.1:8080
export TARALLO_TOKEN=yoLeCHmEhNNseN0BlG0s3A:ksfPYziGg7ebj0goT0Zc7pbmQEIYvZpRTIkwuscAM_k
Or, as an alternative, you can add these lines to PyCharm (or whatever other IDE you're using) configuration for the test script launcher, they are just environment variables.
The token is the default one for the dev enviroment (see T.A.R.A.L.L.O. developement, but you can generate different ones from T.A.R.A.L.L.O. obviously.
Then activate the virtualenv:
source venv/bin/activate
Install dependencies for developement
pip install -e ".[dev]"
or for production only
pip install -e .
To run tests type
nosetests -v
You may also get pytarallo through PyPI by using the command pip install pytarallo
- Click here (or on the right of this page, on "Releases", then "Draft a new release").
- Enter the version tag with format "vX.Y.Z" without double quotes.
- Optionally enter a release title and a release description.
- You can follow the build and release process in the Actions tab at the top.
-
Clone the repo locally
git clone https://github.com/WEEE-Open/pytarallo && cd pytarallo
-
Update the setup.py so that it contains the correct version and other info (including dependencies).
You should update at leastversion
anddownload_url
.vim setup.py
-
Enter in the virtual environment
source venv/bin/activate
-
Install required packages for publishing on PyPI
pip install setuptools wheel twine
-
Remove old builds
rm dist/*
-
Build the .tar.gz package
python setup.py sdist bdist_wheel
-
Upload the output packages to PyPI:
twine upload dist/*
This last step requires:
- you having an account on pypi.org
- your account being owner or maintainer of the pytarallo package
- you entering your username and password when prompted by twine