Skip to main content

GObject mainloop implementation of https://gitlab.com/advian-oss/python-datastreamservicelib

Project description

GObject mainloop implementation of https://gitlab.com/advian-oss/python-datastreamservicelib

Docker

This depends on GObject libraries etc from the operating system level, easiest way to get hacking is to build the docker image and work inside it.

SSH agent forwarding

We need buildkit:

export DOCKER_BUILDKIT=1

And also the exact way for forwarding agent to running instance is different on OSX:

export DOCKER_SSHAGENT="-v /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock -e SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock"

and Linux:

export DOCKER_SSHAGENT="-v $SSH_AUTH_SOCK:$SSH_AUTH_SOCK -e SSH_AUTH_SOCK"

Creating the container

Make sure you have defined DOCKER_DISPLAY above.

Build image, create container and start it:

docker build --ssh default --target devel_shell -t gobjectservicelib:devel_shell .
docker create --name gobjectservicelib_devel -v `pwd`":/app" -it  -v /tmp:/tmp `echo $DOCKER_SSHAGENT` gobjectservicelib:devel_shell
docker start -i gobjectservicelib_devel

This will give you a shell with system level dependencies installed, you should do any shell things (like run tests, pre-commit checks etc) there.

pre-commit considerations

If working in Docker instead of native env you need to run the pre-commit checks in docker too:

docker exec -i gobjectservicelib_devel /bin/bash -c "pre-commit install"
docker exec -i gobjectservicelib_devel /bin/bash -c "pre-commit run --all-files"

You need to have the container running, see above. Or alternatively use the docker run syntax but using the running container is faster:

docker run --rm -v `pwd`":/app" gobjectservicelib:devel_shell -c "pre-commit run --all-files"

Test suite

You can use the devel shell to run py.test when doing development, for CI use the “test” target in the Dockerfile:

docker build --ssh default --target test -t gobjectservicelib:test .
docker run --rm -it -v `pwd`":/app" `echo $DOCKER_SSHAGENT` gobjectservicelib:test

Local Development

TLDR:

  • Check dockerfile for system dependencies and adapt according to your env

  • Create and activate a Python 3.7 virtualenv (assuming virtualenvwrapper):

    mkvirtualenv -p `which python3.7` my_virtualenv
  • change to a branch:

    git checkout -b my_branch
  • install Poetry: https://python-poetry.org/docs/#installation

  • Install project deps and pre-commit hooks:

    poetry install
    pre-commit install
    pre-commit run --all-files
  • Ready to go.

Remember to activate your virtualenv whenever working on the repo, this is needed because pylint and mypy pre-commit hooks use the “system” python for now (because reasons).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gobjectservicelib-1.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

gobjectservicelib-1.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file gobjectservicelib-1.1.0.tar.gz.

File metadata

  • Download URL: gobjectservicelib-1.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for gobjectservicelib-1.1.0.tar.gz
Algorithm Hash digest
SHA256 5fc3882a478442da3f660ff5e3198528e2fb168952fa30da12b354ef29d18972
MD5 61f3ccfe3e0affb425a40fc6ebf866b1
BLAKE2b-256 33cd71ac1adb6f3b38ef6283a634a955904626e15e890ec66a40d1ff0654873f

See more details on using hashes here.

File details

Details for the file gobjectservicelib-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: gobjectservicelib-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for gobjectservicelib-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 757aa300066426ebac05f1ea202408eb9a6ad4d54fc00a19a31868945c89fcea
MD5 04624d5c5c53035c5a70bd994fda23a2
BLAKE2b-256 13dbbe2924e078df094b883384c8b8d76effff89b3e30d63eccca25e4ad3e4a8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page