Name | srepkg JSON |
Version |
0.1.7
JSON |
| download |
home_page | None |
Summary | Repackages apps to restrict installation into isolated env |
upload_time | 2025-02-17 05:35:05 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | MIT License
Copyright (c) 2022 duanegoodner
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
|
keywords |
solo repackage
command line
command line interface
dependencies
dependency
dependency conflict
dependency conflicts
entry point
entry points
install
isolated environment
isolation
packaging
pip
virtual environment
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 📦 Solo Repackage (srepkg)


[](https://codecov.io/gh/duanegoodner/srepkg)

[](https://duanegoodner.github.io/srepkg/)

Wraps a Python package with an isolation layer that enforces installation in an isolated virtual environment while still providing access to the original package's command-line interface in an external environment.
## 📖 Description
When a Python package that has been wrapped in a *srepkg* isolation is installed in an active, pre-existing Python environment:
- The original package plus its dependencies are installed in a new, automatically created virtual environment.
- A dependency-free "access" package installed in the pre-existing environment contains a controller module capable of making calls to the Python interpreter in the newly created environment.
- This package structure ensures that none of the original package's dependencies conflict with packages in the pre-existing environment but still exposes the original package’s CL to the pre-existing environment.
## 📘 Documentation
Full project documentation, including detailed examples, is available at: [duanegoodner/github.io/srepkg](https://duanegoodner.github.io/srepkg/)
## 🎯 Use Cases
### For Package Distributors
- *srepkg* can be useful if you are sharing a Python command line application, and you want to be certain that users can install and run it without worrying about dependency conflicts.
- Wrapping a CL package with *srepkg* prior to sharing the package with other users will ensure that wherever the package is installed, it does not introduce dependency conflicts into a user's existing Python environment — even if the user knows nothing about managing Python environments.
### For Package Users
- Any existing CL package obtained from Python Packaging Index (PyPI) or GitHub can be wrapped with *srepkg* prior to installation.
- If you want the original package commands to be accessible from a single environment (that is distinct from the isolated environment where the original package is installed), then *srepkg* is likely a good option.
- However, if you want the isolated package's command interface to be available globally and/or want a much more mature isolation tool, then [pipx]("https://github.com/pypa/pipx") is likely a better choice.
## ⚡ Quick Start
### Requirements
- Python version 3.9 or higher
- For compatibility with *srepkg*, and existing package must:
* Be installable via [pip](https://pip.pypa.io/en/stable/installation/#)
* Be compatible with the Python interpreter version that is running *srepkg*.
* Have command line entry point(s) specified in either one the `[project.scripts]` section of a `pyproject.toml` (preferred), the `[options.entry_points]` section of a `setup.cfg`, or the `entry_points` arguments passed to `setup()` in a `setupy.py` file.
- Optional: `miniconda` or `conda` if you want to exactly follow the examples below
### Simple Demo
```shell
# Create and activate a new conda environment for testing
conda create -n srepkg_test python=3.11
conda activate srepkg_test
# Install srepkg from PyPI
pip install srepkg
# Re-package a version of black, obtained from PyPI
srepkg black -r 25.1.0 # creates re-package wheel and sdist under ./srepkg_dists
# install our re-packaged wheel
pip install ./srepkg_dists/blacksrepkg-25.1.0-py3-none-any.whl
# Confirm blacksrepkg is installed and that black is NOT installed in our conda env
conda list | grep black
# Output:
# blacksrepkg 25.1.0 pypi_0 pypi
# Check if any of black's dependencies are installed in our conda environment
onda list | grep "click\|\
mypy_extensions\|\
packaging\|\
pathspec\|\
platformdirs\|\
tomli\|\
typing_extensions"
# Output:
# packaging 24.2 pypi_0 pypi
# Note: 'packaging' is installed because it is a dependency of 'srepkg'.
# No other package that black depends on is in our environment.
# Confirm that we have access to the black CLI
black -c "def foo():print('hello,world')"
# Output:
# def foo():
# print("hello,world")
```
### Command Line Help
For details on all `srepkg` command options, run:
```shell
srepkg --help
```
## 🧪 Testing
An automated test suite runs via **GitHub Actions** on every push to the `main` branch and every pull request. However, tests can also be run manually.
First, clone the repo and install dependencies:
```
$ git clone https://github.com/duanegoodner/srepkg
$ cd srepkg
$ pip install -e '.[test]'
```
Then run the test suite and generate a coverage report:
```
$ coverage run -m pytest
$ coverage report -m
```
## 🤝 Contributing
Issues, Pull Requests and/or Discussions are welcome and appreciated!
Raw data
{
"_id": null,
"home_page": null,
"name": "srepkg",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "solo repackage, command line, command line interface, dependencies, dependency, dependency conflict, dependency conflicts, entry point, entry points, install, isolated environment, isolation, packaging, pip, virtual environment",
"author": null,
"author_email": "Duane Goodner <dmgoodner@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/1b/2d/74f8cbcbe4609e5186cae53bcd461de7e5bf1b3f4ee646304f6d86118241/srepkg-0.1.7.tar.gz",
"platform": null,
"description": "\n\n\n# \ud83d\udce6 Solo Repackage (srepkg)\n\n\n\n[](https://codecov.io/gh/duanegoodner/srepkg)\n\n[](https://duanegoodner.github.io/srepkg/)\n\n\n\nWraps a Python package with an isolation layer that enforces installation in an isolated virtual environment while still providing access to the original package's command-line interface in an external environment.\n\n## \ud83d\udcd6 Description\n\nWhen a Python package that has been wrapped in a *srepkg* isolation is installed in an active, pre-existing Python environment:\n- The original package plus its dependencies are installed in a new, automatically created virtual environment.\n- A dependency-free \"access\" package installed in the pre-existing environment contains a controller module capable of making calls to the Python interpreter in the newly created environment.\n- This package structure ensures that none of the original package's dependencies conflict with packages in the pre-existing environment but still exposes the original package\u2019s CL to the pre-existing environment.\n\n## \ud83d\udcd8 Documentation\n\nFull project documentation, including detailed examples, is available at: [duanegoodner/github.io/srepkg](https://duanegoodner.github.io/srepkg/)\n\n## \ud83c\udfaf Use Cases\n\n### For Package Distributors\n- *srepkg* can be useful if you are sharing a Python command line application, and you want to be certain that users can install and run it without worrying about dependency conflicts. \n- Wrapping a CL package with *srepkg* prior to sharing the package with other users will ensure that wherever the package is installed, it does not introduce dependency conflicts into a user's existing Python environment — even if the user knows nothing about managing Python environments.\n\n### For Package Users\n- Any existing CL package obtained from Python Packaging Index (PyPI) or GitHub can be wrapped with *srepkg* prior to installation.\n- If you want the original package commands to be accessible from a single environment (that is distinct from the isolated environment where the original package is installed), then *srepkg* is likely a good option.\n- However, if you want the isolated package's command interface to be available globally and/or want a much more mature isolation tool, then [pipx](\"https://github.com/pypa/pipx\") is likely a better choice.\n\n## \u26a1 Quick Start\n\n### Requirements\n\n- Python version 3.9 or higher\n- For compatibility with *srepkg*, and existing package must:\n * Be installable via [pip](https://pip.pypa.io/en/stable/installation/#)\n * Be compatible with the Python interpreter version that is running *srepkg*.\n * Have command line entry point(s) specified in either one the `[project.scripts]` section of a `pyproject.toml` (preferred), the `[options.entry_points]` section of a `setup.cfg`, or the `entry_points` arguments passed to `setup()` in a `setupy.py` file.\n- Optional: `miniconda` or `conda` if you want to exactly follow the examples below\n\n\n### Simple Demo\n\n```shell\n# Create and activate a new conda environment for testing\nconda create -n srepkg_test python=3.11\nconda activate srepkg_test\n\n# Install srepkg from PyPI\npip install srepkg\n\n# Re-package a version of black, obtained from PyPI\nsrepkg black -r 25.1.0 # creates re-package wheel and sdist under ./srepkg_dists\n\n# install our re-packaged wheel\npip install ./srepkg_dists/blacksrepkg-25.1.0-py3-none-any.whl\n\n# Confirm blacksrepkg is installed and that black is NOT installed in our conda env\nconda list | grep black\n# Output:\n# blacksrepkg 25.1.0 pypi_0 pypi\n\n# Check if any of black's dependencies are installed in our conda environment\nonda list | grep \"click\\|\\\nmypy_extensions\\|\\\npackaging\\|\\\npathspec\\|\\\nplatformdirs\\|\\\ntomli\\|\\\ntyping_extensions\"\n\n# Output:\n# packaging 24.2 pypi_0 pypi\n\n# Note: 'packaging' is installed because it is a dependency of 'srepkg'.\n# No other package that black depends on is in our environment.\n\n# Confirm that we have access to the black CLI\nblack -c \"def foo():print('hello,world')\"\n# Output:\n# def foo():\n# print(\"hello,world\")\n```\n\n### Command Line Help\nFor details on all `srepkg` command options, run:\n```shell\nsrepkg --help\n```\n\n## \ud83e\uddea Testing\n\nAn automated test suite runs via **GitHub Actions** on every push to the `main` branch and every pull request. However, tests can also be run manually.\n\nFirst, clone the repo and install dependencies:\n\n```\n$ git clone https://github.com/duanegoodner/srepkg\n$ cd srepkg\n$ pip install -e '.[test]'\n```\nThen run the test suite and generate a coverage report:\n```\n$ coverage run -m pytest\n$ coverage report -m\n```\n\n\n## \ud83e\udd1d Contributing\n\nIssues, Pull Requests and/or Discussions are welcome and appreciated!\n\n\n",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) 2022 duanegoodner\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n ",
"summary": "Repackages apps to restrict installation into isolated env",
"version": "0.1.7",
"project_urls": {
"Documentation": "https://duanegoodner.github.io/srepkg/",
"Repository": "https://github.com/duanegoodner/srepkg"
},
"split_keywords": [
"solo repackage",
" command line",
" command line interface",
" dependencies",
" dependency",
" dependency conflict",
" dependency conflicts",
" entry point",
" entry points",
" install",
" isolated environment",
" isolation",
" packaging",
" pip",
" virtual environment"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "5e777c03d4f4c61638a8f372a38079ede61bc65b5c8d3e9d49cfe67adb0ddba7",
"md5": "c9b9df28670c0a4c2e2342b1038060c7",
"sha256": "d1d1cd0254f049de42066f69093a91b1f2a91890194bdf831aa74621a3f75994"
},
"downloads": -1,
"filename": "srepkg-0.1.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c9b9df28670c0a4c2e2342b1038060c7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 97792,
"upload_time": "2025-02-17T05:35:03",
"upload_time_iso_8601": "2025-02-17T05:35:03.405914Z",
"url": "https://files.pythonhosted.org/packages/5e/77/7c03d4f4c61638a8f372a38079ede61bc65b5c8d3e9d49cfe67adb0ddba7/srepkg-0.1.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "1b2d74f8cbcbe4609e5186cae53bcd461de7e5bf1b3f4ee646304f6d86118241",
"md5": "02a335c0d50e8ef842bcb7349625dbe8",
"sha256": "48d09d434f7db6989ab4cc7a77e347e5b0f5177724e3205dec2804b5512278d6"
},
"downloads": -1,
"filename": "srepkg-0.1.7.tar.gz",
"has_sig": false,
"md5_digest": "02a335c0d50e8ef842bcb7349625dbe8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 74751,
"upload_time": "2025-02-17T05:35:05",
"upload_time_iso_8601": "2025-02-17T05:35:05.239673Z",
"url": "https://files.pythonhosted.org/packages/1b/2d/74f8cbcbe4609e5186cae53bcd461de7e5bf1b3f4ee646304f6d86118241/srepkg-0.1.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-17 05:35:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "duanegoodner",
"github_project": "srepkg",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "srepkg"
}