-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Binary releases #362
Comments
I'm not opposed to this but it depends on how much additional manual work I'd have to do during releases. Accepting PRs. |
I have a PR ready to go into homebrew/homebrew-core so Black can be installed on MacOS via brew bump-formula-pr black --url={new_version_pythonhosted_url} (see homebrew's contributing info) |
Yes, I will be happy to upgrade brew as part of new releases. This is great! |
Great, done! (#29382) If/when that PR gets merged I can submit a Black PR documenting that it can be installed with brew. |
You can also generate a self-contained binary that runs great on Linux (even without Python) with PyInstaller with one command:
|
I've managed to make a Windows exe. Here's how I did it from scratch:
When I run tests, I got 70 run, 3 failed, 1 skipped. Not sure if this is expected or needs to be looked into? Since pyinstaller can't cross-compile, next step would be to find a CI that supports Windows, like AppVeyor. Attached built exe for anyone interested. |
We do run appveyor and it's passing on master. What are the failed tests you see? |
Might be relevant: I use the following script to send a homebrew release update PR for doitlive. It takes care of passing the #!/bin/sh
# Sends a PR to homebrew-core for a new version of doitlive
# Usage: ./release_homebrew.sh https://files.pythonhosted.org/packages/8c/41/b08e2883c256d52f63f00f622cf8a33d3bf36bb5714af337e67476f8b3fe/doitlive-2.8.0.tar.gz
# Validate argument
[ "$#" -eq 1 ] || { echo 'ERROR: Must pass a URL'; exit 1; }
echo $1 | grep -q '^https://files\.pythonhosted\.org' || { echo 'ERROR: URL must start with https://files.pythonhosted.org'; exit 1; }
URL=$1
# Create a temporary directory
WORK_DIR=`mktemp -d`
# check if tmp dir was created
if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
echo "Could not create temp dir"
exit 1
fi
# deletes the temp directory
function cleanup {
echo "Cleaning up..."
rm -rf "$WORK_DIR"
echo "Done."
}
# remove temporary directory after exiting
trap cleanup EXIT
OUTPUT_PATH="$WORK_DIR/doitlive.tar.gz"
curl $URL -o $OUTPUT_PATH
SHA256=`shasum -a 256 $OUTPUT_PATH | head -1 | grep -o '^\S\+'`
echo "URL: $URL"
echo "SHA: $SHA256"
brew update
echo '*** Sending PR to homebrew-core... ***'
brew bump-formula-pr --strict --sha256=$SHA256 --url=$URL doitlive https://github.com/sloria/doitlive/blob/dev/release_homebrew.sh Replace "doitlive" with "black" and the script should just work. |
The tests failing on Windows are
But these tests were run using |
I'm trying to set up binary releases for linux using Travis CI, but I've noticed that the build is failing for 3.6, even on the latest master. Has something changed with one of the dependencies perhaps? Here's the build: and the error messages:
|
Indeed it looks like the tests don't respect |
Black is now available as a Homebrew formula (#29382)! As mentioned above, |
@cxong I merged your two pull requests. Thank you! Now, operationally, is there something I need to do manually to mark a particular commit a release, or is a tag on the master branch enough to trigger a release build? |
Binaries are built for releases. Both travis and appveyor require github auth tokens which are specific to the repo; the one I used for my fork won't work for ambv/black. I provided instructions in the pull requests; for travis follow this: https://docs.travis-ci.com/user/deployment/releases/ and for appveyor follow this: https://www.appveyor.com/docs/deployment/github/ For travis you can see it attempted to do the release but the auth token was the one for my fork: https://travis-ci.org/ambv/black/jobs/433723373#L594 |
For information: I use Black like this, when my repo doesn't have the right version of python: It's a tiny docker container I made, which only embeds the minimal requirements. So you need to have docker installed, which is not the solution for everyone. But if you already have docker, you can use Black with this single command line, executed from the folder you want to reformat. There are probably many ways to improve this container, like to pass the other command line arguments, but for many cases it works as is. |
Regarding deployment of the Windows exe, is the |
Linux and Windows are (once again) covered by #1743, so Mac OS is the only one left. I personally didn't add Mac OS support as I don't own a Mac machine so there was no way to test my config. |
I'm interested in adopting black for our dev team, but we are currently on python 2.7 and 3.5, so we cannot easily use black as we'll need to set up python 3.6+. This is not very convenient for a large dev team.
It would be more convenient if this project also distributed binaries for each release. Build for Windows, macOS and Linux. This can be done using CI.
The text was updated successfully, but these errors were encountered: