From 7c9120e1e671e0623f8a996a9f080518eebf8157 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 17 Aug 2020 14:12:23 +0200 Subject: [PATCH 1/6] Update coveralls requirement from ~=2.1.1 to ~=2.1.2 (#108) Updates the requirements on [coveralls](https://github.com/coveralls-clients/coveralls-python) to permit the latest version. - [Release notes](https://github.com/coveralls-clients/coveralls-python/releases) - [Changelog](https://github.com/coveralls-clients/coveralls-python/blob/master/CHANGELOG.md) - [Commits](https://github.com/coveralls-clients/coveralls-python/compare/2.1.1...2.1.2) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 39c8989..5f365eb 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -coveralls~=2.1.1 +coveralls~=2.1.2 doctr~=1.8.0 pdoc3~=0.8.4 responses~=0.10.15 From 8e0a60389c575ec8a371ac48c1c3796f6c89d57d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 17 Aug 2020 14:12:30 +0200 Subject: [PATCH 2/6] Update responses requirement from ~=0.10.15 to ~=0.10.16 (#107) Updates the requirements on [responses](https://github.com/getsentry/responses) to permit the latest version. - [Release notes](https://github.com/getsentry/responses/releases) - [Changelog](https://github.com/getsentry/responses/blob/master/CHANGES) - [Commits](https://github.com/getsentry/responses/compare/0.10.15...0.10.16) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 5f365eb..d5f5500 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ coveralls~=2.1.2 doctr~=1.8.0 pdoc3~=0.8.4 -responses~=0.10.15 +responses~=0.10.16 From 587737a5de7ef30e1e318c22c25387710234a099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isabella=20Gross=20Alstr=C3=B6m?= Date: Tue, 18 Aug 2020 09:00:26 +0200 Subject: [PATCH 3/6] Check for empty string in parse_date (#120) Tasks returns an empty string if due date is not set Co-authored-by: Sebastian Rutofski --- pygrocy/utils.py | 2 +- test/test_utils.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pygrocy/utils.py b/pygrocy/utils.py index 02fa408..2c11289 100644 --- a/pygrocy/utils.py +++ b/pygrocy/utils.py @@ -5,7 +5,7 @@ def parse_date(input_value): - if input_value is None: + if input_value is "" or input_value is None: return None return iso8601.parse_date(input_value) diff --git a/test/test_utils.py b/test/test_utils.py index 2d3409b..70d758a 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -16,7 +16,13 @@ def test_parse_date_no_data(self): date_obj = utils.parse_date(date_str) assert date_obj is None + + def test_parse_date_empty_string(self): + date_str = "" + date_obj = utils.parse_date(date_str) + assert date_obj is None + def test_parse_int_valid(self): int_str = "2" int_number = utils.parse_int(int_str) From 8f205f0b913693c88f61e12f030ac151b160ca49 Mon Sep 17 00:00:00 2001 From: Sebastian Rutofski Date: Tue, 18 Aug 2020 13:16:29 +0200 Subject: [PATCH 4/6] Create release-from-tag.yml --- .github/workflows/release-from-tag.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/release-from-tag.yml diff --git a/.github/workflows/release-from-tag.yml b/.github/workflows/release-from-tag.yml new file mode 100644 index 0000000..f3fa636 --- /dev/null +++ b/.github/workflows/release-from-tag.yml @@ -0,0 +1,24 @@ +on: + push: + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +name: Create Release + +jobs: + build: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@master + - name: Create Release + id: create_release + uses: actions/create-release@latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false From 0955c74c4f2e921c43b651a873f960b07ff8098f Mon Sep 17 00:00:00 2001 From: Sebastian Rutofski Date: Tue, 18 Aug 2020 17:39:14 +0200 Subject: [PATCH 5/6] init all Product fields with None by default (#123) Signed-off-by: Sebastian Rutofski --- pygrocy/grocy.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/pygrocy/grocy.py b/pygrocy/grocy.py index 4543d0b..d1088f5 100644 --- a/pygrocy/grocy.py +++ b/pygrocy/grocy.py @@ -24,6 +24,7 @@ class Product(DataModel): def __init__(self, response): + self._init_empty() if isinstance(response, CurrentStockResponse): self._init_from_CurrentStockResponse(response) elif isinstance(response, MissingProductResponse): @@ -31,12 +32,22 @@ def __init__(self, response): elif isinstance(response, ProductDetailsResponse): self._init_from_ProductDetailsResponse(response) + def _init_empty(self): + self._name = None + self._id = None + self._amount_missing = None + self._is_partly_in_stock = None + + self._available_amount = None + self._best_before_date = None + + self._barcodes = None + self._product_group_id = None + def _init_from_CurrentStockResponse(self, response: CurrentStockResponse): self._id = response.product_id self._available_amount = response.amount self._best_before_date = response.best_before_date - self._amount_missing = None - self._is_partly_in_stock = None if response.product: self._name = response.product.name self._barcodes = response.product.barcodes @@ -45,12 +56,8 @@ def _init_from_CurrentStockResponse(self, response: CurrentStockResponse): def _init_from_MissingProductResponse(self, response: MissingProductResponse): self._id = response.product_id self._name = response.name - self._available_amount = None - self._best_before_date = None self._amount_missing = response.amount_missing self._is_partly_in_stock = response.is_partly_in_stock - self._barcodes = None - self._product_group_id = None def _init_from_ProductDetailsResponse(self, response: ProductDetailsResponse): self._id = response.product.id From 4bd66ae1c115ed5aed8697e3bfa55e80adca053c Mon Sep 17 00:00:00 2001 From: Sebastian Rutofski Date: Tue, 18 Aug 2020 17:41:16 +0200 Subject: [PATCH 6/6] 0.21.0 prep Signed-off-by: Sebastian Rutofski --- CHANGELOG.md | 23 +++++++++++++++++++++++ setup.py | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69c608f..65c90e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [v0.21.0](https://github.com/SebRut/pygrocy/tree/v0.21.0) (2020-08-18) + +[Full Changelog](https://github.com/SebRut/pygrocy/compare/v0.20.0...v0.21.0) + +**Implemented enhancements:** + +- consider using ciso8601 instead of iso8601 [\#84](https://github.com/SebRut/pygrocy/issues/84) + +**Fixed bugs:** + +- Not all fields of Product are set in all cases [\#122](https://github.com/SebRut/pygrocy/issues/122) + +**Closed issues:** + +- Task without due date gives error [\#119](https://github.com/SebRut/pygrocy/issues/119) + +**Merged pull requests:** + +- init all Product fields with None by default [\#123](https://github.com/SebRut/pygrocy/pull/123) ([SebRut](https://github.com/SebRut)) +- Check for empty string in parse\_date [\#120](https://github.com/SebRut/pygrocy/pull/120) ([isabellaalstrom](https://github.com/isabellaalstrom)) +- Update coveralls requirement from ~=2.1.1 to ~=2.1.2 [\#108](https://github.com/SebRut/pygrocy/pull/108) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) +- Update responses requirement from ~=0.10.15 to ~=0.10.16 [\#107](https://github.com/SebRut/pygrocy/pull/107) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) + ## [v0.20.0](https://github.com/SebRut/pygrocy/tree/v0.20.0) (2020-08-16) [Full Changelog](https://github.com/SebRut/pygrocy/compare/v0.19.0...v0.20.0) diff --git a/setup.py b/setup.py index c9712e1..f5e2ecb 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="pygrocy", - version="0.20.0", + version="0.21.0", author="Sebastian Rutofski", author_email="kontakt@sebastian-rutofski.de", description="",