-
Notifications
You must be signed in to change notification settings - Fork 31
feat: add pylint github action #216
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
base: main
Are you sure you want to change the base?
Conversation
Amazing PR! By having a multi job pipeline, we can comprehensive CI that validates code quality and correctness on every pull request |
This comment was marked as resolved.
This comment was marked as resolved.
To add to this @piyush588 @nadineloepfe, I've been doing some type hinting and some of the errors can (not very often) be quite varied and sometimes are based on historical style choices. I would propose just doing a pylint and mypy 'check' but not a requirement to for all to pass to approve, at least until we have completed more linting/type code improvements. |
This comment was marked as resolved.
This comment was marked as resolved.
Hi all, I took a look at this from the meeting this morning and would be happy to help. |
Hi @aceppaluni , |
Hi @piyush588 Of course! I sent you a message in discord :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Sorry it took me a while to review this - I had to do some research.
I think this is mostly ready to go, we should add: continue-on-error: true
until we have refined our linting a bit more.
@nadineloepfe, I would suggest creating an integrated workflow in an additional issue as we have other workflows coming in, some may not be necessary to merge, and this could require more research
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left some comments to make the pipeline more robust and easier to read - please let me know if you have any questions!
.github/workflows/ci.yml
Outdated
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Install Pylint
.github/workflows/ci.yml
Outdated
run: | | ||
python -m pip install --upgrade pip | ||
pip install pylint | ||
# Running pylint on pull requests while ignoring: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd remove the comments here
.github/workflows/ci.yml
Outdated
run: | | ||
git fetch origin main | ||
changed_files=$(git diff --name-only origin/main...HEAD | grep '\.py$' || true) | ||
echo "Changed Python files:" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to "Linting the following files" for clarity
.github/workflows/ci.yml
Outdated
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.10"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be removed as we just setup python version once, so this can just be a step like " name: Set up Python 3.10.."
.github/workflows/ci.yml
Outdated
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we stick to uv for the entire workflow? else we're mixing uv and pip
@exploreriii Also, I’m seeing the message: |
CHANGELOG.md... this is in the project root, find the file and in the added section just add eg Yes, you have a conflict because your branch is not as updated as main. Main just changed, specifically the file test.yml. That means your branch thinks test.yml should be version B, but main thinks it should be version A. When you merge your project (B) into main (A), this causes the issue: which file should be the outcome: the main's version (A) or your outcome (B)? So you first need to update your branch with the recent changes from main Review README_upstream for rebase instructions |
Signed-off-by: Piyush Kumar <[email protected]>
Signed-off-by: Piyush Kumar <[email protected]>
Signed-off-by: Piyush Kumar <[email protected]>
Signed-off-by: Piyush Kumar <[email protected]>
Signed-off-by: Piyush Kumar <[email protected]>
Signed-off-by: Piyush Kumar <[email protected]>
87c0e47
to
84e572d
Compare
.github/workflows/ci.yml
Outdated
run: uv pip install -e . | ||
|
||
- name: Run integration tests | ||
run: uv run pytest -m integration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- name: Run integration tests
env:
OPERATOR_ID: ${{ steps.solo.outputs.accountId }}
OPERATOR_KEY: ${{ steps.solo.outputs.privateKey }}
ADMIN_KEY: ${{ steps.solo.outputs.privateKey }}
PUBLIC_KEY: ${{ steps.solo.outputs.publicKey }}
NETWORK: solo
run: |
uv run pytest -m integration
needs to be changed back to this or the CI will fail
Signed-off-by: Piyush Kumar <[email protected]>
Signed-off-by: Piyush Kumar <[email protected]>
Signed-off-by: Piyush Kumar <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a new release so please change your changelog, ensure it is not under added for v0.1.4, it should be in the unreleased added (which will be for v0.1.5)
Signed-off-by: Piyush Kumar <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the ci.yml
Signed-off-by: Piyush Kumar <[email protected]>
Signed-off-by: Piyush Kumar <[email protected]>
Seen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this will fail but your code is good!
The issue is we discovered 3.10 unit tests are failing, so pinning it to 3.10 will cause a failure
We have an issue open to fix the comp issues, in which case I would recommend either setting it to a general version that uv will select:
- name: Setup Python
run: uv python install
or, waiting until 3.10 is fixed and then proceed - but we should also make it run for 3.10, 3.11, 3.12 (which is one of the open issues)
In which case, i would recommend generalising it for now and we will add to it in the future as we have open issues
also please rebase |
Description:
This PR introduces a GitHub Actions workflow that runs Pylint on only the Python files changed in a pull request.
What the Workflow Does
Triggers only on pull requests targeting the main branch
Detects .py files changed in the PR compared to main
Runs Pylint only on those files
Ignores the following warnings to reduce noise:
W0212: Access to a protected member
E0611: No name in module
E0401: Import error
Related issue(s):
Fixes #190
Notes for reviewer:
Checklist