decision
========
[![](https://github.com/lycantropos/decision/workflows/CI/badge.svg)](https://github.com/lycantropos/decision/actions/workflows/ci.yml "Github Actions")
[![](https://codecov.io/gh/lycantropos/decision/branch/master/graph/badge.svg)](https://codecov.io/gh/lycantropos/decision "Codecov")
[![](https://img.shields.io/github/license/lycantropos/decision.svg)](https://github.com/lycantropos/decision/blob/master/LICENSE "License")
[![](https://badge.fury.io/py/decision.svg)](https://badge.fury.io/py/decision "PyPI")
In what follows `python` is an alias for `python3.6` or `pypy3.6`
or any later version (`python3.7`, `pypy3.7` and so on).
Installation
------------
Install the latest `pip` & `setuptools` packages versions
```bash
python -m pip install --upgrade pip setuptools
```
### User
Download and install the latest stable version from `PyPI` repository
```bash
python -m pip install --upgrade decision
```
### Developer
Download the latest version from `GitHub` repository
```bash
git clone https://github.com/lycantropos/decision.git
cd decision
```
Install
```bash
python setup.py install
```
Usage
-----
```python
>>> from decision.partition import coin_change
>>> coin_change(10, [2])
(2, 2, 2, 2, 2)
>>> coin_change(10, [2, 3])
(2, 2, 3, 3)
>>> coin_change(10, [2, 3, 4])
(2, 4, 4)
>>> coin_change(10, [2, 3, 4, 5])
(5, 5)
```
Development
-----------
### Bumping version
#### Preparation
Install
[bump2version](https://github.com/c4urself/bump2version#installation).
#### Pre-release
Choose which version number category to bump following [semver
specification](http://semver.org/).
Test bumping version
```bash
bump2version --dry-run --verbose $CATEGORY
```
where `$CATEGORY` is the target version number category name, possible
values are `patch`/`minor`/`major`.
Bump version
```bash
bump2version --verbose $CATEGORY
```
This will set version to `major.minor.patch-alpha`.
#### Release
Test bumping version
```bash
bump2version --dry-run --verbose release
```
Bump version
```bash
bump2version --verbose release
```
This will set version to `major.minor.patch`.
### Running tests
Install dependencies
```bash
python -m pip install -r requirements-tests.txt
```
Plain
```bash
pytest
```
Inside `Docker` container:
- with `CPython`
```bash
docker-compose --file docker-compose.cpython.yml up
```
- with `PyPy`
```bash
docker-compose --file docker-compose.pypy.yml up
```
`Bash` script:
- with `CPython`
```bash
./run-tests.sh
```
or
```bash
./run-tests.sh cpython
```
- with `PyPy`
```bash
./run-tests.sh pypy
```
`PowerShell` script:
- with `CPython`
```powershell
.\run-tests.ps1
```
or
```powershell
.\run-tests.ps1 cpython
```
- with `PyPy`
```powershell
.\run-tests.ps1 pypy
```
Raw data
{
"_id": null,
"home_page": "https://github.com/lycantropos/decision/",
"name": "decision",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "",
"author": "Azat Ibrakov",
"author_email": "azatibrakov@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/22/8d/ddb8e8b35fc9157ed7b68ec6b310d0502e249a68e0c8284b0c48f7b10f5d/decision-0.3.1.tar.gz",
"platform": null,
"description": "decision\n========\n\n[![](https://github.com/lycantropos/decision/workflows/CI/badge.svg)](https://github.com/lycantropos/decision/actions/workflows/ci.yml \"Github Actions\")\n[![](https://codecov.io/gh/lycantropos/decision/branch/master/graph/badge.svg)](https://codecov.io/gh/lycantropos/decision \"Codecov\")\n[![](https://img.shields.io/github/license/lycantropos/decision.svg)](https://github.com/lycantropos/decision/blob/master/LICENSE \"License\")\n[![](https://badge.fury.io/py/decision.svg)](https://badge.fury.io/py/decision \"PyPI\")\n\nIn what follows `python` is an alias for `python3.6` or `pypy3.6`\nor any later version (`python3.7`, `pypy3.7` and so on).\n\nInstallation\n------------\n\nInstall the latest `pip` & `setuptools` packages versions\n```bash\npython -m pip install --upgrade pip setuptools\n```\n\n### User\n\nDownload and install the latest stable version from `PyPI` repository\n```bash\npython -m pip install --upgrade decision\n```\n\n### Developer\n\nDownload the latest version from `GitHub` repository\n```bash\ngit clone https://github.com/lycantropos/decision.git\ncd decision\n```\n\nInstall\n```bash\npython setup.py install\n```\n\nUsage\n-----\n```python\n>>> from decision.partition import coin_change\n>>> coin_change(10, [2])\n(2, 2, 2, 2, 2)\n>>> coin_change(10, [2, 3])\n(2, 2, 3, 3)\n>>> coin_change(10, [2, 3, 4])\n(2, 4, 4)\n>>> coin_change(10, [2, 3, 4, 5])\n(5, 5)\n\n```\n\nDevelopment\n-----------\n\n### Bumping version\n\n#### Preparation\n\nInstall\n[bump2version](https://github.com/c4urself/bump2version#installation).\n\n#### Pre-release\n\nChoose which version number category to bump following [semver\nspecification](http://semver.org/).\n\nTest bumping version\n```bash\nbump2version --dry-run --verbose $CATEGORY\n```\n\nwhere `$CATEGORY` is the target version number category name, possible\nvalues are `patch`/`minor`/`major`.\n\nBump version\n```bash\nbump2version --verbose $CATEGORY\n```\n\nThis will set version to `major.minor.patch-alpha`. \n\n#### Release\n\nTest bumping version\n```bash\nbump2version --dry-run --verbose release\n```\n\nBump version\n```bash\nbump2version --verbose release\n```\n\nThis will set version to `major.minor.patch`.\n\n### Running tests\n\nInstall dependencies\n```bash\npython -m pip install -r requirements-tests.txt\n```\n\nPlain\n```bash\npytest\n```\n\nInside `Docker` container:\n- with `CPython`\n ```bash\n docker-compose --file docker-compose.cpython.yml up\n ```\n- with `PyPy`\n ```bash\n docker-compose --file docker-compose.pypy.yml up\n ```\n\n`Bash` script:\n- with `CPython`\n ```bash\n ./run-tests.sh\n ```\n or\n ```bash\n ./run-tests.sh cpython\n ```\n\n- with `PyPy`\n ```bash\n ./run-tests.sh pypy\n ```\n\n`PowerShell` script:\n- with `CPython`\n ```powershell\n .\\run-tests.ps1\n ```\n or\n ```powershell\n .\\run-tests.ps1 cpython\n ```\n- with `PyPy`\n ```powershell\n .\\run-tests.ps1 pypy\n ```\n\n\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Decision making problems.",
"version": "0.3.1",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "1a09c85d9d8504e1fbc782be2d93c2cc",
"sha256": "2575cd18b8dcc11ad11fd05b0cb849f75de1756cbfc42663750cd3741d30c75c"
},
"downloads": -1,
"filename": "decision-0.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1a09c85d9d8504e1fbc782be2d93c2cc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 5431,
"upload_time": "2022-04-17T18:44:08",
"upload_time_iso_8601": "2022-04-17T18:44:08.457762Z",
"url": "https://files.pythonhosted.org/packages/26/b2/adf47d8dfd4e6e9ffe6d4d9d58a2a666628644e3be9515c8dc0ef0b337b7/decision-0.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "b920d5e95a24bdd0d85c0ff4793c6d1d",
"sha256": "346038b3fac278fe0ce60e8b8d52845f07a83990fdd134737e9c11658e1421aa"
},
"downloads": -1,
"filename": "decision-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "b920d5e95a24bdd0d85c0ff4793c6d1d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 4777,
"upload_time": "2022-04-17T18:44:09",
"upload_time_iso_8601": "2022-04-17T18:44:09.680142Z",
"url": "https://files.pythonhosted.org/packages/22/8d/ddb8e8b35fc9157ed7b68ec6b310d0502e249a68e0c8284b0c48f7b10f5d/decision-0.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-04-17 18:44:09",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "lycantropos",
"github_project": "decision",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [],
"lcname": "decision"
}