=================
gobjectservicelib
=================
GObject mainloop enabled version of https://gitlab.com/advian-oss/python-datastreamservicelib
(runs GObject mainloop in a thread, asyncio is still the main threads mainloop).
Notable helpers
---------------
ServiceWidgetBase/ServiceWindowBase (in widgets.py) and the aio decorator (in eventloop.py), the first should be used
as baseclass for your own widgets/windows that need a reference to the main service and aio mainloop.
The latter is a decorator that can be applied to a method of subclass of ServiceWidgetBase to
make said method run in the aio mainloop.
And of course the GObject mainloop enabled SimpleService which extends the one in 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
.. _buildkit: https://docs.docker.com/develop/develop-images/build_enhancements/
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 --progress plain --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 --progress plain --ssh default --target tox -t gobjectservicelib:tox .
docker run --rm -it -v `pwd`":/app" `echo $DOCKER_SSHAGENT` gobjectservicelib:tox
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).
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/advian-oss/python-gobjectservicelib/",
"name": "gobjectservicelib",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6.2,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Eero af Heurlin",
"author_email": "eero.afheurlin@advian.fi",
"download_url": "https://files.pythonhosted.org/packages/f5/7e/e3fdd7319521bc7006b83abf3126393fceb7c06a6458b46f1ebb6d262de0/gobjectservicelib-1.4.1.tar.gz",
"platform": null,
"description": "=================\ngobjectservicelib\n=================\n\nGObject mainloop enabled version of https://gitlab.com/advian-oss/python-datastreamservicelib\n(runs GObject mainloop in a thread, asyncio is still the main threads mainloop).\n\nNotable helpers\n---------------\n\nServiceWidgetBase/ServiceWindowBase (in widgets.py) and the aio decorator (in eventloop.py), the first should be used\nas baseclass for your own widgets/windows that need a reference to the main service and aio mainloop.\nThe latter is a decorator that can be applied to a method of subclass of ServiceWidgetBase to\nmake said method run in the aio mainloop.\n\nAnd of course the GObject mainloop enabled SimpleService which extends the one in datastreamservicelib\n\nDocker\n------\n\nThis depends on GObject libraries etc from the operating system level, easiest way\nto get hacking is to build the docker image and work inside it.\n\nSSH agent forwarding\n^^^^^^^^^^^^^^^^^^^^\n\nWe need buildkit_::\n\n export DOCKER_BUILDKIT=1\n\n.. _buildkit: https://docs.docker.com/develop/develop-images/build_enhancements/\n\nAnd also the exact way for forwarding agent to running instance is different on OSX::\n\n 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\"\n\nand Linux::\n\n export DOCKER_SSHAGENT=\"-v $SSH_AUTH_SOCK:$SSH_AUTH_SOCK -e SSH_AUTH_SOCK\"\n\n\nCreating the container\n^^^^^^^^^^^^^^^^^^^^^^\n\nMake sure you have defined DOCKER_DISPLAY above.\n\nBuild image, create container and start it::\n\n docker build --progress plain --ssh default --target devel_shell -t gobjectservicelib:devel_shell .\n docker create --name gobjectservicelib_devel -v `pwd`\":/app\" -it -v /tmp:/tmp `echo $DOCKER_SSHAGENT` gobjectservicelib:devel_shell\n docker start -i gobjectservicelib_devel\n\nThis will give you a shell with system level dependencies installed, you should do any shell things (like\nrun tests, pre-commit checks etc) there.\n\n\npre-commit considerations\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\nIf working in Docker instead of native env you need to run the pre-commit checks in docker too::\n\n docker exec -i gobjectservicelib_devel /bin/bash -c \"pre-commit install\"\n docker exec -i gobjectservicelib_devel /bin/bash -c \"pre-commit run --all-files\"\n\nYou need to have the container running, see above. Or alternatively use the docker run syntax but using\nthe running container is faster::\n\n docker run --rm -v `pwd`\":/app\" gobjectservicelib:devel_shell -c \"pre-commit run --all-files\"\n\n\nTest suite\n^^^^^^^^^^\n\nYou can use the devel shell to run py.test when doing development, for CI use\nthe \"test\" target in the Dockerfile::\n\n docker build --progress plain --ssh default --target tox -t gobjectservicelib:tox .\n docker run --rm -it -v `pwd`\":/app\" `echo $DOCKER_SSHAGENT` gobjectservicelib:tox\n\n\nLocal Development\n-----------------\n\nTLDR:\n\n- Check dockerfile for system dependencies and adapt according to your env\n- Create and activate a Python 3.7 virtualenv (assuming virtualenvwrapper)::\n\n mkvirtualenv -p `which python3.7` my_virtualenv\n\n- change to a branch::\n\n git checkout -b my_branch\n\n- install Poetry: https://python-poetry.org/docs/#installation\n- Install project deps and pre-commit hooks::\n\n poetry install\n pre-commit install\n pre-commit run --all-files\n\n- Ready to go.\n\nRemember to activate your virtualenv whenever working on the repo, this is needed\nbecause pylint and mypy pre-commit hooks use the \"system\" python for now (because reasons).\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "GObject mainloop implementation of https://gitlab.com/advian-oss/python-datastreamservicelib",
"version": "1.4.1",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1003d3e330a0b497a2dbddb5586ef97934ffaedc061f722a722db75188f59749",
"md5": "a06fb58619144ab39540019a416c6f1b",
"sha256": "9db4378a3c4696a6de44baead7bd127b69aec8839ccca2084b974c448652353f"
},
"downloads": -1,
"filename": "gobjectservicelib-1.4.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a06fb58619144ab39540019a416c6f1b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6.2,<4.0",
"size": 6389,
"upload_time": "2023-03-20T11:06:00",
"upload_time_iso_8601": "2023-03-20T11:06:00.202376Z",
"url": "https://files.pythonhosted.org/packages/10/03/d3e330a0b497a2dbddb5586ef97934ffaedc061f722a722db75188f59749/gobjectservicelib-1.4.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f57ee3fdd7319521bc7006b83abf3126393fceb7c06a6458b46f1ebb6d262de0",
"md5": "4c31587bcaff7dedf8f35cdc69f3afbe",
"sha256": "feca37cf55d479e467619116253e14341a69a998d2061d052c7118073bf0075f"
},
"downloads": -1,
"filename": "gobjectservicelib-1.4.1.tar.gz",
"has_sig": false,
"md5_digest": "4c31587bcaff7dedf8f35cdc69f3afbe",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6.2,<4.0",
"size": 6146,
"upload_time": "2023-03-20T11:06:01",
"upload_time_iso_8601": "2023-03-20T11:06:01.409058Z",
"url": "https://files.pythonhosted.org/packages/f5/7e/e3fdd7319521bc7006b83abf3126393fceb7c06a6458b46f1ebb6d262de0/gobjectservicelib-1.4.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-20 11:06:01",
"github": false,
"gitlab": true,
"bitbucket": false,
"gitlab_user": "advian-oss",
"gitlab_project": "python-gobjectservicelib",
"lcname": "gobjectservicelib"
}