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

fix: pre-commit ci workflow #3917

Merged
merged 8 commits into from
Oct 15, 2024
Merged

fix: pre-commit ci workflow #3917

merged 8 commits into from
Oct 15, 2024

Conversation

kostasrim
Copy link
Contributor

@kostasrim kostasrim commented Oct 14, 2024

  • fix pip install to run under venv
  • fix fakeredis python installation

Signed-off-by: kostas <kostas@dragonflydb.io>
@kostasrim kostasrim self-assigned this Oct 14, 2024
@@ -26,6 +26,17 @@ jobs:
lsblk -l
echo "sda rotational = $(cat /sys/block/sda/queue/rotational)"
echo "sdb rotational = $(cat /sys/block/sdb/queue/rotational)"
- name: Create virtual environment
Copy link
Collaborator

Choose a reason for hiding this comment

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

I meant that you need to change the current Install dependencies step line 22 to run in virtual env

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep yep, I was distracted with the gh runner 😛

@@ -21,17 +21,26 @@ jobs:
- uses: actions/setup-python@v5
- name: Install dependencies
run: |
python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
Copy link
Collaborator

Choose a reason for hiding this comment

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

why?

Copy link
Contributor Author

@kostasrim kostasrim Oct 14, 2024

Choose a reason for hiding this comment

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

The > python -m pip install --upgrade pip
is not needed. Will remove

- name: Install dependencies
run: |
source venv/bin/activate
pip install pre-commit
Copy link
Collaborator

Choose a reason for hiding this comment

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

why again?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because among different run commands you need to source again

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(I am testing this not 100% sure about this)

@kostasrim kostasrim requested a review from adiholden October 14, 2024 12:38
@@ -39,18 +36,18 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For some reason this caused a broken installation of python. I fell back to the one provided by ubuntu (3.10 for 22.04)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I dont understand we used python 3.10 before in this step
Did you try to remove the cache-dependency-path and see if this worked?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I think the cache-dependency-path was the problem but I did not try removing it and keeping the actions/setup. We want the the python version that comes with the system and the best way to do that is apt install and not relying on some action to fetch the dependency

python -m pip freeze --local
python -m venv venv
source venv/bin/activate
pip install pre-commit
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not using python -m?
why did you remove python -m pip freeze --local

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. Does it really matter if I use python -m or pip install directly ?
  2. Because it's irrelevant -- it freezes the current state of the virtual env such that it can be recreated somewhere else. We dont't need that here

@kostasrim kostasrim requested a review from adiholden October 15, 2024 06:38
@romange
Copy link
Collaborator

romange commented Oct 15, 2024

This #3924 fixes the problem. Really no need for all this virtual env stuff in our CI

@kostasrim
Copy link
Contributor Author

This #3924 fixes the problem. Really no need for all this virtual env stuff in our CI

---break-system-packages

Can break the system

@adiholden adiholden merged commit d2a8312 into main Oct 15, 2024
12 checks passed
@adiholden adiholden deleted the kpr2 branch October 15, 2024 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants