Decision making problems.
Project description
decision
In what follows
python
is an alias forpython3.5
or any later version (python3.6
and so on),pypy
is an alias forpypy3.5
or any later version (pypy3.6
and so on).
Installation
Install the latest pip
& setuptools
packages versions:
- with
CPython
python -m pip install --upgrade pip setuptools
- with
PyPy
pypy -m pip install --upgrade pip setuptools
User
Download and install the latest stable version from PyPI
repository:
- with
CPython
python -m pip install --upgrade decision
- with
PyPy
pypy -m pip install --upgrade decision
Developer
Download the latest version from GitHub
repository
git clone https://github.com/lycantropos/decision.git
cd decision
Install dependencies:
- with
CPython
python -m pip install --force-reinstall -r requirements.txt
- with
PyPy
pypy -m pip install --force-reinstall -r requirements.txt
Install:
- with
CPython
python setup.py install
- with
PyPy
pypy setup.py install
Usage
>>> from decision.partition import coin_change
>>> list(coin_change(10, [2]))
[2, 2, 2, 2, 2]
>>> list(coin_change(10, [2, 3]))
[2, 2, 3, 3]
>>> list(coin_change(10, [2, 3, 4]))
[2, 4, 4]
>>> list(coin_change(10, [2, 3, 4, 5]))
[5, 5]
Development
Bumping version
Preparation
Install bump2version.
Pre-release
Choose which version number category to bump following semver specification.
Test bumping version
bump2version --dry-run --verbose $CATEGORY
where $CATEGORY
is the target version number category name, possible
values are patch
/minor
/major
.
Bump version
bump2version --verbose $CATEGORY
This will set version to major.minor.patch-alpha
.
Release
Test bumping version
bump2version --dry-run --verbose release
Bump version
bump2version --verbose release
This will set version to major.minor.patch
.
Running tests
Install dependencies:
- with
CPython
python -m pip install --force-reinstall -r requirements-tests.txt
- with
PyPy
pypy -m pip install --force-reinstall -r requirements-tests.txt
Plain
pytest
Inside Docker
container:
- with
CPython
docker-compose --file docker-compose.cpython.yml up
- with
PyPy
docker-compose --file docker-compose.pypy.yml up
Bash
script (e.g. can be used in Git
hooks):
-
with
CPython
./run-tests.sh
or
./run-tests.sh cpython
-
with
PyPy
./run-tests.sh pypy
PowerShell
script (e.g. can be used in Git
hooks):
- with
CPython
.\run-tests.ps1
or.\run-tests.ps1 cpython
- with
PyPy
.\run-tests.ps1 pypy
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file decision-0.1.0.tar.gz
.
File metadata
- Download URL: decision-0.1.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.5.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32ade900d87e5d282a98fd23ea9ff3554f42d9f3568f4c5df4112493a48ea5f5 |
|
MD5 | 1f16991122266a7906f106dbc4d7d803 |
|
BLAKE2b-256 | 8ba42975dc1a698b0cdb431abab4fc39cee267af7f0870814c387da78360e9d4 |
Provenance
File details
Details for the file decision-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: decision-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.5.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a0b30623afbd74b9625c04a105444495f10eeb58e4dde8387234d58762d04ca |
|
MD5 | 419538d80d1fbc601f4b57ef5390e835 |
|
BLAKE2b-256 | 4811c06b51176b6fe70ceaad6d435e7e03068ecc01cb4ed100d4e4a91fe5dcf1 |