Skip to content

Latest commit

 

History

History
67 lines (54 loc) · 1.98 KB

File metadata and controls

67 lines (54 loc) · 1.98 KB

Development

Home

This section contains information for developers. In case you want to improve, debug, extend the project you may find here some useful information.

Running Tests

To run a particular test execute a command similar like this:

$ pipenv run python -m unittest tests/cloudio/test_cloudio_attribute.py

To execute all tests:

$ pipenv run python -m unittest discover -s tests/cloudio

Running Test Coverage

To run the test coverage execute the following commands:

$ pipenv run coverage run --source=./src -m unittest discover -s tests/cloudio
$ pipenv run coverage report -m

Update Coverage Badge Image

To update the coverage image shown on the readme page execute the following command:

$ pipenv run coverage-badge -f -o docs/images/coverage.svg

Generate and Upload Distribution Package

Prior to upload a new Python package be sure to create first a new release of the project:

  • Update development branch
  • Run tests with coverage
  • Increment version number
  • Update CHANGELOG.md file
  • Check content of setup.py and change accordingly
  • Generate distribution packages
  • Push to master branch
$ cd <into project>

# Install package needed for deployment (coverage, build, twine, etc.) 
$ pipenv install --dev

# Build the package
$ pipenv run python -m build

# Optional: Send to test server
$ pipenv run twine upload --repository testpypi dist/*

# Upload to official server
$ pipenv run twine upload --repository pypi dist/{<project-name>-x.y.z}*.whl
$ pipenv run twine upload --repository pypi dist/{<project-name>-x.y.z}.tar.gz

Link to Local Package

If you want to use for example the cloudio-glue-python package from your locally cloned git repository, use a command similar like:

$ pipenv install --dev -e ../cloudio-glue-python

If it does not work with a relative path, try with an absolute path. The folder you are referencing must contain a setup.cfg or setup.py file.