Skip to content

[misc] Python3 support, Github CI and QA Checks - #59

Merged
nemesifier merged 5 commits into
masterfrom
github-actions-ci
Jun 2, 2021
Merged

[misc] Python3 support, Github CI and QA Checks#59
nemesifier merged 5 commits into
masterfrom
github-actions-ci

Conversation

@purhan

@purhan purhan commented May 28, 2021

Copy link
Copy Markdown
Contributor

Closes #50, closes #49, closes #52, closes #55, closes #61

@pandafy pandafy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it will work after rebasing on current master.

Comment thread .github/workflows/ci.yml Outdated
@purhan
purhan force-pushed the github-actions-ci branch 2 times, most recently from 3ac707a to c8a4566 Compare May 29, 2021 03:59
@purhan purhan changed the title GitHub actions ci [misc] Python3 support, Github CI and QA Checks May 29, 2021
@purhan
purhan force-pushed the github-actions-ci branch from c8a4566 to e8021a5 Compare May 29, 2021 04:26
@purhan

This comment has been minimized.

@purhan
purhan force-pushed the github-actions-ci branch 3 times, most recently from 7284efd to 75f77fe Compare May 29, 2021 07:22

@pandafy pandafy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is my initial review. I will look up the code again to see if anything got left out.

@purhan it will be easier for you later to squash commits later if you keep commits on this PR atomic. Remember we will merge 4 commits in the end.

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread run-qa-checks
Comment thread setup.cfg Outdated
@pandafy

pandafy commented May 31, 2021

Copy link
Copy Markdown
Member

This is an issue with mock library and is fixed in python 3.8. Should we use python 3.8, or look for a workaround?

We should look for a workaround for now since rest of OpenWISP currently supports Python 3.6 and 3.7.
A possible workaround will be to catch the RuntimeError in tearDown:

diff --git a/tests/test_snmp/test_airos.py b/tests/test_snmp/test_airos.py
index 56234d0..fc190e2 100644
--- a/tests/test_snmp/test_airos.py
+++ b/tests/test_snmp/test_airos.py
@@ -168,4 +168,7 @@ class TestSNMPAirOS(unittest.TestCase, MockOutputMixin):
         self.assertIsInstance(self.device.uptime_tuple, tuple)
 
     def tearDown(self):
-        self.getcmd_patcher.stop()
+        try:
+            self.getcmd_patcher.stop()
+        except RuntimeError:
+            return

Don't forget to add a comment stating why this has been done and to remove it once support for Python 3.8 an above is added.

@purhan
purhan force-pushed the github-actions-ci branch from 258953b to 34aa5ff Compare May 31, 2021 12:21
Comment thread .github/workflows/ci.yml
@purhan purhan mentioned this pull request May 31, 2021
4 tasks
Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml Outdated
Comment thread docs/source/conf.py
u'Alessandro Bucciarelli, Federico Capoano',
'netengine',
'One line description of project.',
'Miscellaneous',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we update this since we are here or shall we do this later?

@purhan purhan Jun 1, 2021

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it may be better to do this in #56
Or we can do this here, what would you suggest changing this to?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok for #56

@pandafy pandafy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Add .coveragerc in this PR.
  • Convert all " to ' in Python code except for doc strings.
  • Swap out print statements with logger in this PR.

@purhan ensure that goals of #49 are met (check issue description)

@pandafy pandafy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Add .coveragerc in this PR.
  • Convert all " to ' in Python code except for doc strings.
  • Swap out print statements with logger in this PR.

@purhan ensure that goals of #49 are met (check issue description)

@purhan
purhan force-pushed the github-actions-ci branch from c79f20f to d34e2b6 Compare June 1, 2021 15:56
@purhan

purhan commented Jun 1, 2021

Copy link
Copy Markdown
Contributor Author

Note: We have to configure the coveralls bot to comment on PRs.

@nemesifier nemesifier left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made sure coveralls is enabled: https://coveralls.io/github/openwisp/netengine.
I left one minor request regarding link 404 verification, see below.

Comment thread run-qa-checks
Comment thread requirements-test.txt Outdated
Comment thread run-qa-checks
@purhan
purhan force-pushed the github-actions-ci branch from 8de4c27 to 4d33e47 Compare June 2, 2021 10:21

@pandafy pandafy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍🏼

Deferring merge to @nemesisdesign

@nemesifier nemesifier left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@purhan LGTM!

I don't think squashing everything in one commit will be good, can you squash commits so we have one commit closing each issue mentioned?

@purhan
purhan force-pushed the github-actions-ci branch from 4d33e47 to d2b8aeb Compare June 2, 2021 17:01
@purhan
purhan force-pushed the github-actions-ci branch from d2b8aeb to 11f8ea4 Compare June 2, 2021 17:02

@nemesifier nemesifier left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great 👍

@nemesifier
nemesifier merged commit 11f8ea4 into master Jun 2, 2021
@purhan
purhan deleted the github-actions-ci branch June 5, 2021 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants