Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from Jun 2, 2021

Conversation

purhan
Copy link
Contributor

@purhan purhan commented May 28, 2021

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

Copy link
Member

@pandafy pandafy left a comment

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.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@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

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
Copy link
Member

@pandafy pandafy left a comment

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.

.github/workflows/ci.yml Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
run-qa-checks Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
@pandafy
Copy link
Member

pandafy commented May 31, 2021

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.

@pandafy pandafy moved this from Needs Review to In progress in [GSoC 2021] Netengine & add SNMP to OpenWISP May 31, 2021
@purhan purhan moved this from In progress to Needs Review in [GSoC 2021] Netengine & add SNMP to OpenWISP May 31, 2021
@purhan purhan mentioned this pull request May 31, 2021
4 tasks
.github/workflows/ci.yml Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
u'Alessandro Bucciarelli, Federico Capoano',
'netengine',
'One line description of project.',
'Miscellaneous',
Copy link
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?

Copy link
Contributor Author

@purhan purhan Jun 1, 2021

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
Member

Choose a reason for hiding this comment

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

Ok for #56

Copy link
Member

@pandafy pandafy left a comment

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)

Copy link
Member

@pandafy pandafy left a comment

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
Copy link
Contributor Author

purhan commented Jun 1, 2021

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

Copy link
Member

@nemesifier nemesifier left a comment

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.

run-qa-checks Show resolved Hide resolved
requirements-test.txt Outdated Show resolved Hide resolved
run-qa-checks Show resolved Hide resolved
Copy link
Member

@pandafy pandafy left a comment

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

Copy link
Member

@nemesifier nemesifier left a comment

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?

Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

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

Great 👍

[GSoC 2021] Netengine & add SNMP to OpenWISP automation moved this from Needs Review to Reviewer approved Jun 2, 2021
@nemesifier nemesifier merged commit 11f8ea4 into master Jun 2, 2021
[GSoC 2021] Netengine & add SNMP to OpenWISP automation moved this from Reviewer approved to Done 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
No open projects
3 participants