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

how to know which black version executed in Github action #3575

Closed
piramiday opened this issue Feb 18, 2023 · 5 comments
Closed

how to know which black version executed in Github action #3575

piramiday opened this issue Feb 18, 2023 · 5 comments
Labels
C: integrations Editor plugins and other integrations T: enhancement New feature or request

Comments

@piramiday
Copy link

Is this related to a problem? Please describe.
I am running the latest Github action and the latest PyPi black version.
I realize that the Github action can specify which black version to use, but I don't want to maintain that, too.
I would like to add to the logs which black version is responsible to checking my Python scripts.
How can I accomplish that?

Describe the solution you'd like

I tried executing something similar to black --version in a subsequent step but if was obviously failing due to black not being in the PATH.

Describe alternatives you've considered

I might as well pip install black in my action as opposed to using the official Github action.

@piramiday piramiday added the T: documentation Improvements to the docs (e.g. new topic, correction, etc) label Feb 18, 2023
@ichard26 ichard26 added T: enhancement New feature or request C: integrations Editor plugins and other integrations and removed T: documentation Improvements to the docs (e.g. new topic, correction, etc) labels Feb 19, 2023
@ichard26
Copy link
Collaborator

Seems mostly reasonable although this is probably going to be less useful soon-ish as we plan on changing the default so the action version == black version installed. See #3543.

@piramiday
Copy link
Author

I'm sorry, I did not know about that...
What will happen when that PR gets merged?
I see a reference to .git_archival.txt but I have no idea what it is and cannot find it in the repo.
Will the action take the version from the project requirements?

In any case, I would suggest:

  • print the explicit version in the logs,
  • possibly have a variable that could be read in subsequent steps.

@piramiday
Copy link
Author

the mentioned PR was merged but I still have no idea on how to proceed.
any suggestions?

@ichard26
Copy link
Collaborator

ichard26 commented Apr 8, 2023

That PR only changes the default version of Black used in the GitHub Action to match the action version. There's still no programmable way of detecting the version of Black used, but it can be inferred in most cases now.

@piramiday
Copy link
Author

inferred? how? that is definitely not enough information for me.

nevermind, I'll just stop using black's github action and pip install from my project's dependencies.

@piramiday piramiday closed this as not planned Won't fix, can't repro, duplicate, stale Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: integrations Editor plugins and other integrations T: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants