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

CI Bump black version #28

Merged
merged 6 commits into from
Jul 15, 2022
Merged

CI Bump black version #28

merged 6 commits into from
Jul 15, 2022

Conversation

merveenoyan
Copy link
Collaborator

@merveenoyan merveenoyan commented Jul 13, 2022

This PR bumps black version. I only did this atm because I couldn't find out a way on how to modify a github actions workflow file from my own fork (it does make sense that I shouldn't do it 😅).
I did google it, it feels like a secret information only 10x devs know about and never tell anyone else.

@merveenoyan
Copy link
Collaborator Author

It's weird that I remember putting pip wheel metadata files to .gitignore yet it still creates and adds them automatically.

@BenjaminBossan
Copy link
Collaborator

I couldn't find out a way on how to modify a github actions workflow file from my own fork

Could you explain what you mean here, I don't get it :D

@merveenoyan
Copy link
Collaborator Author

@BenjaminBossan Sorry it's my assumptions again.

So the problem with black and other formatting libraries is that we use a specific pinned version in our pre-commit configurations, meanwhile on github workflow file, it installs whatever's latest (see below)
https://github.com/skops-dev/skops/actions/runs/2664820958/workflow#L32
Which causes tests to be sort of flaky. I wanted to open a PR to that file from my own fork but couldn't figure it out (and it makes sense that you shouldn't be able to modify it from your fork.) Am I allowed to edit it from a different branch in the original repository?

@adrinjalali
Copy link
Member

This PR should also bump the version on the CI, which you can change here:

pip install pytest black isort pytest-cov

It should also run the new black on the whole codebase and include the changes in a separate commit in this PR (this can also be a separate PR if we want to add it to git ignore revisions)

@BenjaminBossan
Copy link
Collaborator

I wanted to open a PR to that file from my own fork but couldn't figure it out (and it makes sense that you shouldn't be able to modify it from your fork.)

I'm not sure why it wouldn't work. But in the end, do you need your own fork? You can push to this repo directly.

@adrinjalali
Copy link
Member

It would work from the fork, please DON'T push to this repo 🙈

@BenjaminBossan
Copy link
Collaborator

It would work from the fork, please DON'T push to this repo see_no_evil

For my better understanding, what is the problem with creating branches on this repo directly and base PRs on those branches?

@adrinjalali
Copy link
Member

These are my reasons for advocating no branches on the main repo:

  • Creating branches on the repo means there's a difference between people who have the rights to create those branches vs people who don't. And for the sake of creating a community, it's really important to have the same process for everybody contributing to a project so that we don't end up having "insider" vs "outsider" contributors.
  • Forcing this on ourselves makes sure we have a CI which works with contributions from other forks, so that when somebody from the community tries to contribute, our CI doesn't break.
  • It keeps the main repo's branches clean and meaningful. Feature branches don't have a place in the main repo if the platform allows forks and PRs from forks. The main repo's branches are only used for major long term features which require a branch in the main repo and several PRs into them, or the release branches.
  • Branch names become irrelevant since we don't care about how a contributor (or us) names their branches on their own fork, they can do as they wish, and have as many as they wish.

@BenjaminBossan
Copy link
Collaborator

Got it, thanks for explaining. Maybe we should have a central place to write things like this or our discussion about squashing down?

@adrinjalali
Copy link
Member

People at HF aren't on the same page when it comes to these topics, so I rather make it project specific. But I agree we should have this somewhere, in our contributing guidelines.

The work on this project started being much faster once I went on holiday then the conference this week, I haven't had a chance to add documentation or README for these issues :D :P

@merveenoyan
Copy link
Collaborator Author

I'm sorry for being a rookie, I thought forks weren't allowed to modify it. I couldn't see .github because I didn't fetch the upstream on my main, it was added later. I thought it was intentionally made like that. 😅
Ekran Resmi 2022-07-14 14 42 47

@merveenoyan
Copy link
Collaborator Author

I can simply modify github actions, no worries

Copy link
Collaborator

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for making the update.

On a related note: It has always annoyed me how easy it is for the versions of the dev tools to get out of sync. There is a version for CI, a version for pre-commit hooks, a version for your dev environment. Ideally, there would be a single requirements file that specifies the versions for all those, but I don't know of any way to achieve that :/

Copy link
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

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

There might be a way to use _min_dependencies.py to get the version in both scripts, but we can figure that out later.

.github/workflows/build-test.yml Outdated Show resolved Hide resolved
@@ -32,7 +32,10 @@ jobs:
- name: Install dependencies
run: |
pip install .[docs]
pip install pytest black isort pytest-cov
Copy link
Member

Choose a reason for hiding this comment

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

we also need a comment here, and on the pre-commit config file that these two versions should be upgraded together so that we don't forget and they are kept in sync.

Co-authored-by: Adrin Jalali <adrin.jalali@gmail.com>
@adrinjalali adrinjalali changed the title Bump black version CI Bump black version Jul 15, 2022
@adrinjalali adrinjalali merged commit 41716e5 into skops-dev:main Jul 15, 2022
@merveenoyan merveenoyan deleted the pin_versions branch July 15, 2022 11:53
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