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

Move Docker image to hatch + compile #3965

Merged
merged 4 commits into from Oct 23, 2023
Merged

Move Docker image to hatch + compile #3965

merged 4 commits into from Oct 23, 2023

Conversation

cooperlees
Copy link
Collaborator

@cooperlees cooperlees commented Oct 22, 2023

  • Move to hatch to build wheel
  • Install wheel into venv we copy with colorama, d + uvloop

Fixes #3928

Test:

  • Build image
    • docker build -t black_compiled .
  • See we can get black to execute:
crl-m1:black cooper$ docker run --rm black_compiled black --version
black, 23.10.1.dev3+g5add198.d20231022 (compiled: yes)
Python (CPython) 3.11.6
  • Check size: TODO: Update when compiled
crl-m1:black cooper$ docker image ls
REPOSITORY                     TAG               IMAGE ID       CREATED          SIZE
black_compiled                 latest            56d4237e8dde   2 minutes ago    186MB

- Move to hatch to build wheel
- Install wheel into venv we copy with colorama + d

Fixes #3928

Test:
- See we can get black to execute: TODO: Update when compiled is working
```
crl-m1:black cooper$ docker run --rm black_compiled black --version
black, 23.10.1.dev1+g882d879.d20231022 (compiled: no)
Python (CPython) 3.11.6
```
- Check size: TODO: Update when compiled
```
crl-m1:black cooper$ docker image ls | grep black_compiled
black_compiled                 latest            9db38fb7f1d0   4 minutes ago    180MB
```
@cooperlees cooperlees marked this pull request as draft October 22, 2023 19:56
@cooperlees cooperlees added C: packaging Installation and packaging of Black C: cleanup Refactoring and removing dust :) labels Oct 22, 2023
@cooperlees
Copy link
Collaborator Author

cooperlees commented Oct 22, 2023

I expect no little size regression as I just built locally from main:

REPOSITORY                     TAG               IMAGE ID       CREATED          SIZE
black_setuptools               latest            8a9722873d1d   5 seconds ago    190MB

It's 4mb larger, so when docker hub strips fat + compress on upload it should be same-ish. Which is good.

@JelleZijlstra JelleZijlstra merged commit d291c23 into main Oct 23, 2023
44 of 45 checks passed
@JelleZijlstra JelleZijlstra deleted the compile_docker branch October 23, 2023 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: cleanup Refactoring and removing dust :) C: packaging Installation and packaging of Black
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[black docker] Let's compile black in the containers
2 participants