widgetti / ipyvue

Jupyter widgets base for Vue libraries
MIT License
68 stars 18 forks source link

build: add github actions #54

Closed 12rambau closed 2 years ago

12rambau commented 2 years ago

the problem with pre-commit is that there are still people installing locally without them pip install -e ./ and thus pushing PR that do not respects the repository requirements. With Github actions at least you're notified.

I copy what was in the pre-commit:

I also added:

do you think it could make sense to add a codecov report ?

Also requirements are not set for the repository, could you add a requirements.txt file that could be used in the tests ?

12rambau commented 2 years ago

The build doesn't seem to complete successfully: https://github.com/12rambau/ipyvue/actions. This can be solved by installing Jupyter lab 3.

flake8 and black can be run by pre-commit: pre-commit run --all-files. This ensures we use the same versions as in the pre-commit hook.

This I know it's just that on one of my repository I saw people going around by creating strange installation

package-lock.json should not change for this PR

mariobuikhuizen commented 2 years ago

Thanks for the changes!

I see a few issues:

I like the black badge!

flake8 and black can be run by pre-commit: pre-commit run --all-files. This ensures we use the same versions as in the pre-commit hook.

This I know it's just that on one of my repository I saw people going around by creating strange installation

I don't understand from this text why we shouldn't use pre-commit run --all-files for the linting , so we don't have potential linting inconsistencies when versions of the linters don't match between dev and CI.

12rambau commented 2 years ago

I don't understand from this text why we shouldn't use pre-commit run --all-files for the linting , so we don't have potential linting inconsistencies when versions of the linters don't match between dev and CI.

My bad I didn't understand the question in the first place. Using the github actions instead of pre-commit, it will display the errors as PR annotation when pre-commit will just display it in the build report.

flak8 is still using the same .flake8 parameter file and black is "uncompromising" so I won't be afraid of inconsistencies :smile:

looking at the files I don't see any merge conflict and according to github (at least from my side) the branch "has no conflict with the base branch".

mariobuikhuizen commented 2 years ago

My bad I didn't understand the question in the first place. Using the github actions instead of pre-commit, it will display the errors as PR annotation when pre-commit will just display it in the build report.

Or my bad ๐Ÿ˜„, I meant running pre-commit run --all-files in the github action. Something like this in unit.yml:

...
 - name: Linting
   run: pre-commit install && pre-commit run --all-files
...

looking at the files I don't see any merge conflict and according to github (at least from my side) the branch "has no conflict with the base branch".

I also don't quite understand why, but I see this in this PR:

Screenshot 2021-12-07 at 19 35 58

Also, If I do a checkout this branch and try to rebase, I get the following:

$ git rebase upstream/master
Auto-merging .github/workflows/unit.yml
CONFLICT (content): Merge conflict in .github/workflows/unit.yml
error: could not apply cb0b18b... build: use the dev installation
Resolve all conflicts manually, mark them as resolved with
...

With the conflict being:

...
      - name: Install dependencies
<<<<<<< HEAD
        run: pip install -r requirements.txt
=======
        run: pip install .[dev]
>>>>>>> cb0b18b (build: use the dev installation)
      - name: Test formatting
...
12rambau commented 2 years ago

This is black magic ! Capture dโ€™eฬcran 2021-12-07 aฬ€ 20 56 49

The problem is that the issue you saw was corrected in the merge. My guess is that I made a mistake between https://github.com/mariobuikhuizen/ipyvue/pull/54/commits/876dd22fea47be139e834b156dcdbcc3a56c8a6a and https://github.com/mariobuikhuizen/ipyvue/pull/54/commits/fea8c169bc16dd95bdb73eb40498cd1054750a35 as I renamed .github to github. Maybe the legacy conflict propagated.

I opened a ticket so that Github can at least explain why we are not seeing the same thing: https://support.github.com/ticket/personal/0/1419769

12rambau commented 2 years ago

@mariobuikhuizen I received a message from Github, apparently my fork was out of sync with your repo for a while causing problem when i tried to merge.

They told me that the situation was resolved, can you confirm ?

mariobuikhuizen commented 2 years ago

Nope ๐Ÿ˜ž

Screenshot 2021-12-09 at 12 20 06
mariobuikhuizen commented 2 years ago

oh .. I didn't notice it was on rebase and merge. Squash and merge works:

Screenshot 2021-12-09 at 12 24 11

Sorry ๐Ÿ˜…

12rambau commented 2 years ago

hooray !

Is there anything you still want me to modify ?

I meant running pre-commit run --all-files in the github action

For this one, THis is what I understand. If you run pre-commit in the actions then the issues encountered by black and flake8 will be reported in the terminal. With the github actions I use, they will be reported as comments directly in the PRs/code