/shellhub-python

A Python SDK for shellhub (https://shellhub.io)

Primary LanguagePython

[Shellhub Python SDK]

codecov

What is it

This repository contains the source code to a Shellhub (https://shellhub.io) Python SDK. It is used to interact with the Shellhub API.

Tested with shellhub v0.14.1

Open to all contributions, wether it is a bug fix, a new feature or a documentation improvement, or even a better way to do things.

Installation

From pip: pip install shellhub

Locally

Create a virtual environment

python3.11 -m venv venv

You can use any version starting python 3.8

Activate it

source venv/bin/activate

Install the requirements

pip install -r requirements-dev.txt

Activate the pre-commit

pip install pre-commit
pre-commit install
pre-commit install --hook commit-msg

Edit the env file with the correct parameters

vim .env

Install the module locally

python setup.py develop

Deployment

In your Pull Request, make sure you have modified the version in __init__.py according to semver.org Once done, and the PR is merged, you need to push on the main branch a tag with a v prefix

For example: If the __version__ in __init__.py is 1.0.0, you need to tag the last commit on main with your changes with v1.0.0

Procedure:

  • Merge the PR
  • git checkout main
  • git pull
  • git tag vx.x.x
  • git push --tags

Once done, go to the repository, find the tag and create a release from the tag. In the description, explain what has changed so we can easily see what has been done A few seconds after, the package should be up in the pypi server.

Repository rules

When contributing:

  • Create a branch based on main
  • Code on it and commit
  • Create PR
  • Wait for it to be approved and make sure all checks pass
  • Merge it

Code owner

jules.lasne@gmail.com

TODO:

  • Migrate tests to pytest-recording
  • Add a readthedocs documentation
  • Switch to an OpenAPI generated client ? see shellhub-io/shellhub#3497 (comment)
  • Add deployment to pypi on merge to main
  • Add a changelog
  • Setup coverage reporting
  • Update tests to tests on multiple python versions