### Declarative resources with implicit deployment
This package provide classes that allow to setup external resources
(utilities, python packages, executables etc.) that will be deployed as
they are used. In most cases data should be on the web and it will be
deployed and cached locally on only first usage.
There are several examples in `test/` folder and `getpack.library` module
already defined and useable. But main intention is to provide framework for
declarative setup of any resource and work with it without care of deployment.
```python
from getpack.resource import WebResource
class Example(WebResource):
version = '0.1'
archive_url = 'https://example.com/example-0.1.zip'
```
then it would be used:
```python
import subprocess
subprocess.call(Example()().path / 'example.exe')
```
Second round braces required to actually make an effect from resource
and first round braces used to initialize resource class, that would produce
resource descriptions on the fly like follows:
```python
Example(version='0.2', archive_url='https://Example.com/example-0.2.zip')
```
You may experiment with following working snippet and try to change `PySide2`
version:
```bash
python -c "import getpack.library;getpack.library.PySide2(version='5.14.1')(); import PySide2.QtWidgets; app=PySide2.QtWidgets.QApplication(); w=PySide2.QtWidgets.QPushButton(PySide2.__version__); w.clicked.connect(w.close); w.show(); app.exec_()"
```
### TODO
- Utilize `requirements.txt` to reproduce both development and production
environments.
### Testings
For linux testing with Docker, run: `docker build -t test . && docker run -it --rm test pytest .`
### Environs
* `GETPACK_RETRIES` - int, number of general retries, used for renaming and
removing temporary folders
* `GETPACK_BACKOFF` - float, delay between retires
* `GETPACK_ROOT` - str, default root folder for all resources
Raw data
{
"_id": null,
"home_page": "https://github.com/kalemas/getpack",
"name": "getpack",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Konstantin Maslyuk",
"author_email": "Kostya.Maslyuk@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/9f/21/45722bdca73cff1315f7cb50d8ae7998bd7304270a9056a75780474c8bec/getpack-0.5.1.tar.gz",
"platform": null,
"description": "### Declarative resources with implicit deployment\r\n\r\nThis package provide classes that allow to setup external resources\r\n(utilities, python packages, executables etc.) that will be deployed as\r\nthey are used. In most cases data should be on the web and it will be\r\ndeployed and cached locally on only first usage.\r\n\r\nThere are several examples in `test/` folder and `getpack.library` module\r\nalready defined and useable. But main intention is to provide framework for\r\ndeclarative setup of any resource and work with it without care of deployment.\r\n```python\r\nfrom getpack.resource import WebResource\r\nclass Example(WebResource):\r\n version = '0.1'\r\n archive_url = 'https://example.com/example-0.1.zip'\r\n```\r\nthen it would be used:\r\n```python\r\nimport subprocess\r\nsubprocess.call(Example()().path / 'example.exe')\r\n```\r\nSecond round braces required to actually make an effect from resource\r\nand first round braces used to initialize resource class, that would produce\r\nresource descriptions on the fly like follows:\r\n```python\r\nExample(version='0.2', archive_url='https://Example.com/example-0.2.zip')\r\n```\r\nYou may experiment with following working snippet and try to change `PySide2`\r\nversion:\r\n```bash\r\npython -c \"import getpack.library;getpack.library.PySide2(version='5.14.1')(); import PySide2.QtWidgets; app=PySide2.QtWidgets.QApplication(); w=PySide2.QtWidgets.QPushButton(PySide2.__version__); w.clicked.connect(w.close); w.show(); app.exec_()\"\r\n```\r\n\r\n### TODO\r\n\r\n- Utilize `requirements.txt` to reproduce both development and production\r\n environments.\r\n\r\n### Testings\r\nFor linux testing with Docker, run: `docker build -t test . && docker run -it --rm test pytest .`\r\n\r\n### Environs\r\n* `GETPACK_RETRIES` - int, number of general retries, used for renaming and\r\n removing temporary folders\r\n* `GETPACK_BACKOFF` - float, delay between retires\r\n* `GETPACK_ROOT` - str, default root folder for all resources\r\n\r\n\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Declarative external resources with implicit deployment",
"version": "0.5.1",
"project_urls": {
"Bug Tracker": "https://github.com/kalemas/getpack/issues",
"Homepage": "https://github.com/kalemas/getpack"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9f2145722bdca73cff1315f7cb50d8ae7998bd7304270a9056a75780474c8bec",
"md5": "3a179e7121a8b59d7215389aa1292670",
"sha256": "a7a22391f72c600228fec57245a952fdf862e57f2721a85484ebc74eef9aec81"
},
"downloads": -1,
"filename": "getpack-0.5.1.tar.gz",
"has_sig": false,
"md5_digest": "3a179e7121a8b59d7215389aa1292670",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12461,
"upload_time": "2024-06-01T23:03:30",
"upload_time_iso_8601": "2024-06-01T23:03:30.617630Z",
"url": "https://files.pythonhosted.org/packages/9f/21/45722bdca73cff1315f7cb50d8ae7998bd7304270a9056a75780474c8bec/getpack-0.5.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-01 23:03:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kalemas",
"github_project": "getpack",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "getpack"
}