From 13ed9f8daf35cdffa38edc171b5ce1970a728dc1 Mon Sep 17 00:00:00 2001 From: "Christian Tremblay, ing" Date: Thu, 28 Jan 2021 14:20:28 -0500 Subject: [PATCH 01/16] Bumping dev version --- BAC0/infos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BAC0/infos.py b/BAC0/infos.py index 126b36ef..6d47a4a3 100644 --- a/BAC0/infos.py +++ b/BAC0/infos.py @@ -12,5 +12,5 @@ __email__ = "christian.tremblay@servisys.com" __url__ = "https://github.com/ChristianTremblay/BAC0" __download_url__ = "https://github.com/ChristianTremblay/BAC0/archive/master.zip" -__version__ = "21.01.28" +__version__ = "21.01.28dev2" __license__ = "LGPLv3" From 85ec0fb1530e8eca7f670b2f3bb53c025720b52b Mon Sep 17 00:00:00 2001 From: "Christian Tremblay, ing" Date: Thu, 28 Jan 2021 14:31:32 -0500 Subject: [PATCH 02/16] Coveralls test --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3b51173d..cbe7f0c4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,3 +48,7 @@ jobs: run: | coverage run --source BAC0 -m pytest -v coverage report + - name: Coveralls GitHub Action + uses: coverallsapp/github-action@v1.1.2 + with: + github-token: ${{ secrets.COVERALLS_TOKEN }} From 12c297b8b86a7f3715b54d0e8896240109b825a2 Mon Sep 17 00:00:00 2001 From: "Christian Tremblay, ing" Date: Thu, 28 Jan 2021 15:16:15 -0500 Subject: [PATCH 03/16] Switching to another coveralls script. https://github.com/marketplace/actions/coveralls-python --- .github/workflows/test.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cbe7f0c4..f274fafd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,7 +48,18 @@ jobs: run: | coverage run --source BAC0 -m pytest -v coverage report - - name: Coveralls GitHub Action - uses: coverallsapp/github-action@v1.1.2 + coveralls + - name: Coveralls Python + uses: AndreMiras/coveralls-python-action@v20201129 with: + parallel: true github-token: ${{ secrets.COVERALLS_TOKEN }} + + coveralls_finish: + needs: test + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: AndreMiras/coveralls-python-action@v20201129 + with: + parallel-finished: true \ No newline at end of file From a386b4e14030c7afed94b47c0a564aec1ece993c Mon Sep 17 00:00:00 2001 From: Christian Tremblay Date: Thu, 28 Jan 2021 15:18:59 -0500 Subject: [PATCH 04/16] Update test.yml Error on workflow --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f274fafd..c45441c5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,10 +56,10 @@ jobs: github-token: ${{ secrets.COVERALLS_TOKEN }} coveralls_finish: - needs: test + needs: build runs-on: ubuntu-latest steps: - name: Coveralls Finished uses: AndreMiras/coveralls-python-action@v20201129 with: - parallel-finished: true \ No newline at end of file + parallel-finished: true From 44d99c88fbd9b17eb763b0baaf981df5ec0a0f13 Mon Sep 17 00:00:00 2001 From: Christian Tremblay Date: Thu, 28 Jan 2021 15:35:25 -0500 Subject: [PATCH 05/16] Update test.yml --- .github/workflows/test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c45441c5..1b8db7ca 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,9 +52,9 @@ jobs: - name: Coveralls Python uses: AndreMiras/coveralls-python-action@v20201129 with: - parallel: true github-token: ${{ secrets.COVERALLS_TOKEN }} - + parallel: true + coveralls_finish: needs: build runs-on: ubuntu-latest @@ -62,4 +62,6 @@ jobs: - name: Coveralls Finished uses: AndreMiras/coveralls-python-action@v20201129 with: + github-token: ${{ secrets.COVERALLS_TOKEN }} parallel-finished: true + From 5e14955c76dd311187a7b00e6d4950544fcaee0e Mon Sep 17 00:00:00 2001 From: Christian Tremblay Date: Thu, 28 Jan 2021 15:37:17 -0500 Subject: [PATCH 06/16] Update test.yml Closer to something --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1b8db7ca..15686476 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,7 +48,6 @@ jobs: run: | coverage run --source BAC0 -m pytest -v coverage report - coveralls - name: Coveralls Python uses: AndreMiras/coveralls-python-action@v20201129 with: From 3a8fb80ca179731d8421ec58cb9902d04d326417 Mon Sep 17 00:00:00 2001 From: Christian Tremblay Date: Thu, 28 Jan 2021 15:47:50 -0500 Subject: [PATCH 07/16] Update test.yml This way ? --- .github/workflows/test.yml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 15686476..4c47c356 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,19 +48,23 @@ jobs: run: | coverage run --source BAC0 -m pytest -v coverage report - - name: Coveralls Python - uses: AndreMiras/coveralls-python-action@v20201129 - with: - github-token: ${{ secrets.COVERALLS_TOKEN }} - parallel: true + - name: Upload coverage data to coveralls.io + run: coveralls + env: + GITHUB_TOKEN: ${{ secrets.COVERALLS_TOKEN }} + COVERALLS_FLAG_NAME: ${{ matrix.test-name }} + COVERALLS_PARALLEL: true - coveralls_finish: + coveralls: + name: Indicate completion to coveralls.io needs: build runs-on: ubuntu-latest + container: python:3-slim steps: - - name: Coveralls Finished - uses: AndreMiras/coveralls-python-action@v20201129 - with: - github-token: ${{ secrets.COVERALLS_TOKEN }} - parallel-finished: true + - name: Finished + run: | + pip3 install --upgrade coveralls + coveralls --finish + env: + GITHUB_TOKEN: ${{ secrets.COVERALLS_TOKEN }} From 5dd65570577d8f7c6f9c14f9888e2d3a36124f59 Mon Sep 17 00:00:00 2001 From: "Christian Tremblay, ing" Date: Fri, 29 Jan 2021 08:23:37 -0500 Subject: [PATCH 08/16] Default filename for SQLite file will be dev_XYZ where XYZ is the device ID. User can also provide a filename, but using this default will prevent troubles when the device name is too long, contains weird characters, etc... This should solve issue #245 --- BAC0/sql/sql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BAC0/sql/sql.py b/BAC0/sql/sql.py index 83620915..4dd3d4cb 100644 --- a/BAC0/sql/sql.py +++ b/BAC0/sql/sql.py @@ -155,7 +155,7 @@ def save(self, filename=None, resampling=None): filename = filename.split(".")[0] self.properties.db_name = filename else: - self.properties.db_name = "{}".format(self.properties.name) + self.properties.db_name = "dev_{}".format(self.properties.device_id) if resampling is None: resampling = self.properties.save_resampling From ae40fca6433815fbbf3902495e185b4ab47b2525 Mon Sep 17 00:00:00 2001 From: "Christian Tremblay, ing" Date: Fri, 29 Jan 2021 08:29:36 -0500 Subject: [PATCH 09/16] Forcing token when launching coveralls --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4c47c356..5e7ed476 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -64,7 +64,7 @@ jobs: - name: Finished run: | pip3 install --upgrade coveralls - coveralls --finish + COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_TOKEN }} coveralls --finish env: GITHUB_TOKEN: ${{ secrets.COVERALLS_TOKEN }} From 2573b11e3007dcb03a0241e86af3d94fc816f1eb Mon Sep 17 00:00:00 2001 From: "Christian Tremblay, ing" Date: Fri, 29 Jan 2021 09:02:52 -0500 Subject: [PATCH 10/16] One last test for today --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5e7ed476..5b4fcf2c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: Python package +name: Build & Test on: push: @@ -15,7 +15,6 @@ jobs: strategy: matrix: python-version: [3.6, 3.7, 3.8, 3.9] - steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -64,7 +63,8 @@ jobs: - name: Finished run: | pip3 install --upgrade coveralls - COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_TOKEN }} coveralls --finish + coveralls --finish env: GITHUB_TOKEN: ${{ secrets.COVERALLS_TOKEN }} - + COVERALLS_FLAG_NAME: ${{ matrix.test-name }} + COVERALLS_PARALLEL: true \ No newline at end of file From c08b961e9d4ff1bcdb32e65761f303c5f18c16d3 Mon Sep 17 00:00:00 2001 From: "Christian Tremblay, ing" Date: Fri, 29 Jan 2021 09:16:43 -0500 Subject: [PATCH 11/16] can't stop... --- .github/workflows/test.yml | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5b4fcf2c..464e56d9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,23 +48,24 @@ jobs: coverage run --source BAC0 -m pytest -v coverage report - name: Upload coverage data to coveralls.io + if: matrix.python-version == '3.9' run: coveralls env: GITHUB_TOKEN: ${{ secrets.COVERALLS_TOKEN }} COVERALLS_FLAG_NAME: ${{ matrix.test-name }} - COVERALLS_PARALLEL: true + - coveralls: - name: Indicate completion to coveralls.io - needs: build - runs-on: ubuntu-latest - container: python:3-slim - steps: - - name: Finished - run: | - pip3 install --upgrade coveralls - coveralls --finish - env: - GITHUB_TOKEN: ${{ secrets.COVERALLS_TOKEN }} - COVERALLS_FLAG_NAME: ${{ matrix.test-name }} - COVERALLS_PARALLEL: true \ No newline at end of file +# coveralls: +# name: Indicate completion to coveralls.io +# needs: build +# runs-on: ubuntu-latest +# container: python:3-slim +# steps: +# - name: Finished +# run: | +# pip3 install --upgrade coveralls +# coveralls --finish +# env: +# GITHUB_TOKEN: ${{ secrets.COVERALLS_TOKEN }} +# COVERALLS_FLAG_NAME: ${{ matrix.test-name }} +# COVERALLS_PARALLEL: true \ No newline at end of file From 5d1e52001fa9ea368aadad0ca6ac99a7149adcd3 Mon Sep 17 00:00:00 2001 From: Christian Tremblay Date: Fri, 29 Jan 2021 09:22:57 -0500 Subject: [PATCH 12/16] Update README.rst --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index ceded2ae..a4b90cbd 100644 --- a/README.rst +++ b/README.rst @@ -47,7 +47,7 @@ But also a really good tool to assist your startup, test and balancing. Using Ju even be able to create nice looking report right from your code. -.. |build-status| image:: https://github.com/ChristianTremblay/BAC0/workflows/Python%20package/badge.svg?branch=master +.. |build-status| image:: https://github.com/ChristianTremblay/BAC0/workflows/Build%20&%20Test/badge.svg?branch=master :target: https://github.com/ChristianTremblay/BAC0/actions :alt: Build status From bdc06d0eb4c4302cb73835d73dde4e87a835f370 Mon Sep 17 00:00:00 2001 From: Nathan Merritt Date: Tue, 2 Feb 2021 11:11:48 -0700 Subject: [PATCH 13/16] Fix exception 'NoneType' object has no attribute 'log_device_object_property' This can happen if the read for logDeviceObjectProperty fails while building the TrendLog object. Currently there's a debug message generated, for example: DEBUG | Property Access Error for but no other information and the exception stops the controller's points list from getting populated --- BAC0/core/devices/Device.py | 1 + BAC0/core/devices/mixins/read_mixin.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/BAC0/core/devices/Device.py b/BAC0/core/devices/Device.py index 21296fa3..417256ca 100755 --- a/BAC0/core/devices/Device.py +++ b/BAC0/core/devices/Device.py @@ -855,6 +855,7 @@ def connect(self, *, db=None): self.new_state(RPDeviceConnected) except (NoResponseFromController, AttributeError) as error: + self._log.warning("Error connecting: %s", error) if self.properties.db_name: self.new_state(DeviceFromDB) else: diff --git a/BAC0/core/devices/mixins/read_mixin.py b/BAC0/core/devices/mixins/read_mixin.py index 63f9860a..54b742c0 100755 --- a/BAC0/core/devices/mixins/read_mixin.py +++ b/BAC0/core/devices/mixins/read_mixin.py @@ -385,6 +385,8 @@ def _find_propid_index(key): for each in retrieve_type(objList, "trendLog"): point_address = str(each[1]) tl = TrendLog(point_address, self, read_log_on_creation=False) + if tl.properties.log_device_object_property is None: + continue ldop_type, ldop_addr = ( tl.properties.log_device_object_property.objectIdentifier ) From bd0e54553c12f4b4268f3a716a36f7aef95da42c Mon Sep 17 00:00:00 2001 From: "Christian Tremblay, ing" Date: Tue, 2 Feb 2021 13:17:52 -0500 Subject: [PATCH 14/16] Trying stale github action --- .github/workflows/stale.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 00000000..b671fc09 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,19 @@ +name: Mark stale issues and pull requests + +on: + schedule: + - cron: "30 1 * * *" + +jobs: + stale: + + runs-on: ubuntu-latest + + steps: + - uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: 'Stale issue message' + stale-pr-message: 'Stale pull request message' + stale-issue-label: 'no-issue-activity' + stale-pr-label: 'no-pr-activity' From 75e1033d3d5b057ce2ee97f12ddf276e3da12166 Mon Sep 17 00:00:00 2001 From: "Christian Tremblay, ing" Date: Tue, 2 Feb 2021 15:01:44 -0500 Subject: [PATCH 15/16] Correction provided by email from jean-christophe.frehling. Thanks ! --- BAC0/core/functions/cov.py | 4 ++-- doc/source/cov.rst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/BAC0/core/functions/cov.py b/BAC0/core/functions/cov.py index dd595a80..972e595e 100644 --- a/BAC0/core/functions/cov.py +++ b/BAC0/core/functions/cov.py @@ -24,8 +24,8 @@ class SubscriptionContext: def __init__(self, address, objectID, confirmed=None, lifetime=None, callback=None): self.address = address - self.subscriberProcessIdentifier = self.next_proc_id - self.next_proc_id += 1 + self.subscriberProcessIdentifier = SubscriptionContext.next_proc_id + SubscriptionContext.next_proc_id += 1 self.monitoredObjectIdentifier = objectID self.issueConfirmedNotifications = confirmed self.lifetime = lifetime diff --git a/doc/source/cov.rst b/doc/source/cov.rst index 66dd68b2..831fffc7 100644 --- a/doc/source/cov.rst +++ b/doc/source/cov.rst @@ -39,7 +39,7 @@ the function as a callback to the subscription :: # elements is a dict containing all the information of the COV def my_callback(elements): - print("Present value is : {}".format(elements['properties']['presentValue']) + print("Present value is : {}".format(elements['properties']['presentValue'])) .. note:: Here you can find a typical COV notification and the content of elements. From 6ee3daf6c6eb0114c83fc066536458902da7362c Mon Sep 17 00:00:00 2001 From: "Christian Tremblay, ing" Date: Thu, 4 Feb 2021 13:30:48 -0500 Subject: [PATCH 16/16] Bumping version for release --- BAC0/infos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BAC0/infos.py b/BAC0/infos.py index 6d47a4a3..97795312 100644 --- a/BAC0/infos.py +++ b/BAC0/infos.py @@ -12,5 +12,5 @@ __email__ = "christian.tremblay@servisys.com" __url__ = "https://github.com/ChristianTremblay/BAC0" __download_url__ = "https://github.com/ChristianTremblay/BAC0/archive/master.zip" -__version__ = "21.01.28dev2" +__version__ = "21.0204" __license__ = "LGPLv3"