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

Set up GitHub Actions CI #145

Closed
orhun opened this issue Sep 12, 2023 · 14 comments
Closed

Set up GitHub Actions CI #145

orhun opened this issue Sep 12, 2023 · 14 comments
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@orhun
Copy link
Member

orhun commented Sep 12, 2023

Is your feature request related to a problem? Please describe.
It would be nice to check the builds with every push.

Describe the solution you'd like
Create a GitHub Actions workflow file (.github/workflows/ci.yml) to check the builds.

Describe alternatives you've considered
None.

Additional context
See: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

@orhun orhun added help wanted Extra attention is needed good first issue Good for newcomers labels Sep 12, 2023
@KacperNapierski
Copy link
Contributor

Hi,
Could you tell me how would you like your CI to looks like? Do you have any tests that you would like to utilize or just basic linter+ codeql utility? Would you like to build it somewhere? for QA?

@orhun
Copy link
Member Author

orhun commented Sep 13, 2023

Hey!

Do you have any tests that you would like to utilize or just basic linter+ codeql utility?

We don't really have any tests, I just like to see if the code builds + if there are any lint (PEP?) warnings so yes.

Would you like to build it somewhere? for QA?

As a start, we can only check the code and the next step would be this.

@KacperNapierski
Copy link
Contributor

I wil try to do this. Can you assign me to the task? In case of any questions I will just write here

@orhun
Copy link
Member Author

orhun commented Sep 13, 2023

Sure, thanks!

@KacperNapierski
Copy link
Contributor

KacperNapierski commented Sep 13, 2023

So, I started building workflow. I encounterd few hardships.

  1. First is default linter settings, that makes failes the test
    I left here all the issues that it detected

[*] Installed flake8 package version: /home/runner/.local/bin/flake8 --version 6.1.0 (mccabe: 0.7.0, pycodestyle: 2.11.0, pyflakes: 3.1.0) CPython 3.10.12 on Linux /home/runner/.local/bin/flake8 . ./graphenex/__main__.py:14:7: E[27](https://github.com/KacperNapierski/grapheneX/actions/runs/6175133159/job/16761384110#step:3:28)5 missing whitespace after keyword ./graphenex/__main__.py:18:7: E275 missing whitespace after keyword ./graphenex/__main__.py:23:21: E1[28](https://github.com/KacperNapierski/grapheneX/actions/runs/6175133159/job/16761384110#step:3:29) continuation line under-indented for visual indent ./graphenex/core/cli/commands.py:53:80: E501 line too long (85 > 79 characters) ./graphenex/core/cli/commands.py:111:80: E501 line too long (83 > 79 characters) ./graphenex/core/cli/commands.py:112:17: E128 continuation line under-indented for visual indent ./graphenex/core/cli/commands.py:112:80: E501 line too long (83 > 79 characters) ./graphenex/core/cli/commands.py:135:80: E501 line too long (87 > 79 characters) ./graphenex/core/cli/commands.py:151:70: W[29](https://github.com/KacperNapierski/grapheneX/actions/runs/6175133159/job/16761384110#step:3:30)1 trailing whitespace ./graphenex/core/cli/commands.py:158:80: E501 line too long (83 > 79 characters) ./graphenex/core/cli/commands.py:161:1: W293 blank line contains whitespace ./graphenex/core/cli/commands.py:238:17: E722 do not use bare 'except' ./graphenex/core/cli/commands.py:240:74: W291 trailing whitespace ./graphenex/core/cli/commands.py:254:17: E722 do not use bare 'except' ./graphenex/core/cli/commands.py:258:72: E502 the backslash is redundant between brackets ./graphenex/core/cli/commands.py:259:21: E128 continuation line under-indented for visual indent ./graphenex/core/cli/commands.py:262:80: E501 line too long (90 > 79 characters) ./graphenex/core/cli/commands.py:269:80: E501 line too long (85 > 79 characters) ./graphenex/core/cli/commands.py:290:80: E501 line too long (91 > 79 characters) ./graphenex/core/cli/commands.py:298:80: E501 line too long (87 > 79 characters) ./graphenex/core/cli/commands.py:[30](https://github.com/KacperNapierski/grapheneX/actions/runs/6175133159/job/16761384110#step:3:31)8:80: E501 line too long (85 > 79 characters) ./graphenex/core/cli/commands.py:[31](https://github.com/KacperNapierski/grapheneX/actions/runs/6175133159/job/16761384110#step:3:32)3:80: E501 line too long (86 > 79 characters) ./graphenex/core/cli/commands.py:314:25: E128 continuation line under-indented for visual indent ./graphenex/core/cli/commands.py:[32](https://github.com/KacperNapierski/grapheneX/actions/runs/6175133159/job/16761384110#step:3:33)0:80: E501 line too long (86 > 79 characters) ./graphenex/core/cli/commands.py:[33](https://github.com/KacperNapierski/grapheneX/actions/runs/6175133159/job/16761384110#step:3:34)1:1: W293 blank line contains whitespace ./graphenex/core/cli/commands.py:3[34](https://github.com/KacperNapierski/grapheneX/actions/runs/6175133159/job/16761384110#step:3:35):64: E502 the backslash is redundant between brackets ./graphenex/core/cli/commands.py:3[35](https://github.com/KacperNapierski/grapheneX/actions/runs/6175133159/job/16761384110#step:3:36):17: E128 continuation line under-indented for visual indent ./graphenex/core/cli/commands.py:349:13: E722 do not use bare 'except' ./graphenex/core/cli/commands.py:373:80: E501 line too long (80 > 79 characters) ./graphenex/core/cli/commands.py:381:29: E722 do not use bare 'except' ./graphenex/core/cli/commands.py:382:71: E502 the backslash is redundant between brackets ./graphenex/core/cli/commands.py:383:33: E128 continuation line under-indented for visual indent ./graphenex/core/cli/commands.py:398:80: E501 line too long (83 > 79 characters) ./graphenex/core/cli/commands.py:399:80: E501 line too long (85 > 79 characters) ./graphenex/core/cli/commands.py:406:1: W293 blank line contains whitespace ./graphenex/core/cli/commands.py:420:32: E231 missing whitespace after ':' ./graphenex/core/cli/commands.py:481:1: E302 expected 2 blank lines, found 1 ./graphenex/core/cli/commands.py:482:9: E117 over-indented ./graphenex/core/cli/commands.py:489:80: E501 line too long (86 > 79 characters) ./graphenex/core/cli/commands.py:491:80: E501 line too long (87 > 79 characters) ./graphenex/core/cli/commands.py:494:1: E302 expected 2 blank lines, found 1 ./graphenex/core/cli/commands.py:499:80: E501 line too long (84 > 79 characters) ./graphenex/core/cli/commands.py:501:80: E501 line too long (83 > 79 characters) ./graphenex/core/cli/help.py:16:80: E501 line too long (85 > 79 characters) ./graphenex/core/cli/help.py:23:22: W291 trailing whitespace ./graphenex/core/cli/help.py:28:14: W291 trailing whitespace ./graphenex/core/cli/help.py:35:57: W291 trailing whitespace ./graphenex/core/cli/help.py:47:13: E128 continuation line under-indented for visual indent ./graphenex/core/cli/help.py:51:13: E128 continuation line under-indented for visual indent ./graphenex/core/cli/help.py:55:13: E128 continuation line under-indented for visual indent ./graphenex/core/cli/help.py:59:13: E128 continuation line under-indented for visual indent ./graphenex/core/cli/help.py:63:13: E128 continuation line under-indented for visual indent ./graphenex/core/cli/shell.py:32:1: W293 blank line contains whitespace ./graphenex/core/hrd/__init__.py:24:76: W292 no newline at end of file ./graphenex/core/hrd/exec.py:40:1: W293 blank line contains whitespace ./graphenex/core/utils/helpers.py:55:80: E501 line too long (112 > 79 characters) ./graphenex/core/utils/helpers.py:56:80: E501 line too long (104 > 79 characters) ./graphenex/core/utils/helpers.py:57:80: E501 line too long (104 > 79 characters) ./graphenex/core/utils/helpers.py:58:80: E501 line too long (99 > 79 characters) ./graphenex/core/utils/helpers.py:94:9: E722 do not use bare 'except' ./graphenex/core/utils/logcl.py:28:80: E501 line too long (80 > 79 characters) ./graphenex/core/utils/logcl.py:57:68: W291 trailing whitespace ./graphenex/core/utils/logcl.py:65:9: E722 do not use bare 'except' ./graphenex/core/utils/sysinfo.py:37:80: E501 line too long (83 > 79 characters) ./graphenex/core/utils/sysinfo.py:39:80: E501 line too long (132 > 79 characters) ./graphenex/core/web/__init__.py:20:1: F403 'from graphenex.core.web.views import *' used; unable to detect undefined names ./graphenex/core/web/__init__.py:20:1: F401 'graphenex.core.web.views.*' imported but unused ./graphenex/core/web/__init__.py:20:1: E402 module level import not at top of file ./graphenex/core/web/__init__.py:21:1: F403 'from graphenex.core.web.providers import *' used; unable to detect undefined names ./graphenex/core/web/__init__.py:21:1: F401 'graphenex.core.web.providers.*' imported but unused ./graphenex/core/web/__init__.py:21:1: E402 module level import not at top of file ./graphenex/core/web/__init__.py:28:5: F841 local variable 'log' is assigned to but never used ./graphenex/core/web/__init__.py:42:80: E501 line too long (85 > 79 characters) ./graphenex/core/web/__init__.py:45:80: E501 line too long (80 > 79 characters) ./graphenex/core/web/__init__.py:46:9: E722 do not use bare 'except' ./graphenex/core/web/__init__.py:49:80: E501 line too long (89 > 79 characters) ./graphenex/core/web/__init__.py:51:80: E501 line too long (91 > 79 characters) ./graphenex/core/web/__init__.py:59:80: E501 line too long (85 > 79 characters) ./graphenex/core/web/providers.py:10:1: W391 blank line at end of file ./graphenex/core/web/views.py:8:1: F401 'flask_socketio.disconnect' imported but unused ./graphenex/core/web/views.py:[36](https://github.com/KacperNapierski/grapheneX/actions/runs/6175133159/job/16761384110#step:3:37):1: W293 blank line contains whitespace ./graphenex/core/web/views.py:209:9: E[72](https://github.com/KacperNapierski/grapheneX/actions/runs/6175133159/job/16761384110#step:3:73)2 do not use bare 'except'

Do you want me to change some settings like max line length or exclude come parts of the code?

  1. Graphenex install works fine, but later with python3 -m pip install graphenex and graphenex there is an import error:
    ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py).
    Have you ever encountered error like that?

@jxdv
Copy link
Member

jxdv commented Sep 13, 2023

That ImportError is expected. It is a dependency of some library used in grapheneX. I am still not sure which one it is. You'll find steps how to get rid of that one in: #127 / #121.

As for the linter issues, Can you format the output to be more readable? I could create a PR for those, or you can make one yourself.

@KacperNapierski
Copy link
Contributor

Thanks for tips

That ImportError is expected. It is a dependency of some library used in grapheneX. I am still not sure which one it is. You'll find steps how to get rid of that one in: #127 / #121.

Tomorrow I will try to get those workarounds for windows and linux. I thought of making it more concise, but with those issues I will see how it will goes.

As for the linter issues, Can you format the output to be more readable? I could create a PR for those, or you can make one yourself.

Unfortunetly, those are logs from github action. Not sure if it can be imported in cleaner way. If I will have some free time I think of making clean and readible table with those issues sorted by the files. I think if I should put it here or create new issue to grab.

@KacperNapierski
Copy link
Contributor

Lists of errors/warnings/etc that Flake8 detected collected by file

/graphene/main.py

issue location (line:indent)
missing whitespace after keyword 14:7, 18:7
continuation line under-indented for visual indent 23:21

graphenex/core/cli/commands.py

issue location (line:indent)
line too long (line.len > 79 characters) 53:80, 111:80, 112:80, 135:80, 158:80, 262:80, 269:80, 290:80, 298:80, 308:80, 313:80, 320:80, 373:80, 398:80, 399:80, 489:80, 491:80, 499:80, 501:80
continuation line under-indented for visual indent 112:17, 259:21, 314:25, 335:17, 383:33
trailing whitespace 151:70, 240:74, 331:1, 406:1
blank line contains whitespace 161:1
do not use bare 'except' 238:17, 254:17, 349:13, 381:29
the backslash is redundant between brackets 258:72, 334:64, 382:71
missing whitespace after ':' 420:32
expected 2 blank lines, found 1 481:1, 494:1
over-indented 482:9

graphenex/core/cli/help.py

issue location (line:indent)
line too long (line.len > 79 characters) 16:80
trailing whitespace 23:22, 28:14, 35:57
continuation line under-indented for visual indent 47:13, 51:13, 55:13, 59:13, 63:13

graphenex/core/cli/shell.py

issue location (line:indent)
blank line contains whitespace 32:1

graphenex/core/hrd/init.py

issue location (line:indent)
no newline at end of file 24:76

graphenex/core/hrd/exec.py

issue location (line:indent)
blank line contains whitespace 40:1

graphenex/core/utils/helpers.py

issue location (line:indent)
line too long (line.len > 79 characters) 55:80, 56:80, 57:80, 58:80
do not use bare 'except' 94:9

graphenex/core/utils/logcl.py

issue location (line:indent)
line too long (line.len > 79 characters) 28:80
trailing whitespace 57:68
do not use bare 'except' 65:9

graphenex/core/utils/sysinfo.py

issue location (line:indent)
line too long (line.len > 79 characters) 37:80, 39:80

graphenex/core/web/init.py

issue location (line:indent)
line too long (line.len > 79 characters) 42:80, 45:80, 49:80, 51:80, 59:80
'from graphenex.core.web.views import *' used; unable to detect undefined names 20:1
'graphenex.core.web.views.*' imported but unused 20:1
module level import not at top of file 20:1, 21:1
'from graphenex.core.web.providers import *' used; unable to detect undefined names 21:1
'graphenex.core.web.providers.*' imported but unused 21:1
local variable 'log' is assigned to but never used 28:5
do not use bare 'except' 46:9

graphenex/core/web/providers.py

issue location (line:indent)
blank line at end of file 10:1

graphenex/core/web/views.py

issue location (line:indent)
'flask_socketio.disconnect' imported but unused 8:1
blank line contains whitespace 36:1
do not use bare 'except' 209:9

@jxdv
Copy link
Member

jxdv commented Sep 14, 2023

Great, Can you create PR for this, once you fix these issues? @KacperNapierski

Please do not remove / move imports in web/init.py otherwise Web UI will stop working:

from graphenex.core.web.views import *
from graphenex.core.web.providers import *

@KacperNapierski
Copy link
Contributor

I will take on this after finishing CI workflow. Linux one works and builds automaticaly, but I'm still fighting with automating windows.

@jxdv jxdv mentioned this issue Sep 18, 2023
3 tasks
@KacperNapierski
Copy link
Contributor

Both linux and windows CI are working now. After linter errors are corrected I will make changes in actions order to linter first and then separate and simultaneous windows and linux builds. Should I PR or first help with #147 and then PR all changes?

@orhun
Copy link
Member Author

orhun commented Sep 19, 2023

I think you can create 2 separate PRs for fixing the lints and adding the CI workflow.

@KacperNapierski KacperNapierski mentioned this issue Sep 19, 2023
8 tasks
@jxdv
Copy link
Member

jxdv commented Sep 22, 2023

This issue can be closed. #149 has been merged 💯

@orhun
Copy link
Member Author

orhun commented Sep 23, 2023

Thanks a lot @KacperNapierski @jxd1337 💖

@orhun orhun closed this as completed Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants