I am facing this issue by running flyctl deploy --remote-only -
-config fly.prod.toml as well as with local build.
-config fly.prod.toml
==> Verifying app config
Validating fly.prod.toml
✓ Configuration is valid
--> Verified app config
==> Building image
==> Building image with Depot
--> build: ()
[+] Building 16.9s (14/16)
=> [internal] load build definition from Dockerfile 1.2s
=> => transferring dockerfile: 465B 1.2s
=> [internal] load metadata for docker.io/library/python:3.13-slim 0.4s
=> [internal] load metadata for docker.io/library/python:3.13 0.2s
=> [internal] load .dockerignore 1.1s
=> => transferring context: 124B 1.1s
=> [builder 1/7] FROM docker.io/library/python:3.13@sha256:e5fc5242206917be77a48689fd25f693eb2ae17 0.0s
=> => resolve docker.io/library/python:3.13@sha256:e5fc5242206917be77a48689fd25f693eb2ae17b707f35c 0.0s
=> [internal] load build context 4.1s
=> => transferring context: 561.97kB 4.1s
=> [stage-1 1/4] FROM docker.io/library/python:3.13-slim@sha256:3de9a8d7aedbb7984dc18f2dff178a7850 0.0s
=> => resolve docker.io/library/python:3.13-slim@sha256:3de9a8d7aedbb7984dc18f2dff178a7850f16c1ae7 0.0s
=> CACHED [stage-1 2/4] WORKDIR /app 0.0s
=> CACHED [builder 2/7] WORKDIR /app 0.0s
=> CACHED [builder 3/7] RUN python -m venv .venv 0.0s
=> CACHED [builder 4/7] COPY pyproject.toml ./ 0.0s
=> CACHED [builder 5/7] COPY README.md ./ 0.0s
=> CACHED [builder 6/7] COPY src/ ./src/ 0.0s
=> ERROR [builder 7/7] RUN .venv/bin/pip install . 9.7s
------
> [builder 7/7] RUN .venv/bin/pip install .:
1.096 Processing /app
1.099 Installing build dependencies: started
9.630 Installing build dependencies: finished with status 'error'
9.633 error: subprocess-exited-with-error
9.633
9.633 × installing build dependencies did not run successfully.
9.633 │ exit code: 1
9.633 ╰─> [7 lines of output]
9.633 WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/hatchling/
9.633 WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/hatchling/
9.633 WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/hatchling/
9.633 WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/hatchling/
9.633 WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/hatchling/
9.633 ERROR: Could not find a version that satisfies the requirement hatchling (from versions: none)
9.633 ERROR: No matching distribution found for hatchling
9.633 [end of output]
9.633
9.633 note: This error originates from a subprocess, and is likely not a problem with pip.
9.676 ERROR: Failed to build 'file:///app' when installing build dependencies
------
==> Building image
==> Building image with Depot
--> build: ()
[+] Building 19.1s (14/16)
=> [internal] load build definition from Dockerfile 1.2s
=> => transferring dockerfile: 465B 1.1s
=> [internal] load metadata for docker.io/library/python:3.13-slim 0.2s
=> [internal] load metadata for docker.io/library/python:3.13 0.2s
=> [internal] load .dockerignore 1.2s
=> => transferring context: 124B 1.2s
=> [builder 1/7] FROM docker.io/library/python:3.13@sha256:e5fc5242206917be77a48689fd25f693eb2ae17 0.0s
=> => resolve docker.io/library/python:3.13@sha256:e5fc5242206917be77a48689fd25f693eb2ae17b707f35c 0.0s
=> [internal] load build context 6.8s
=> => transferring context: 561.97kB 6.7s
=> [stage-1 1/4] FROM docker.io/library/python:3.13-slim@sha256:3de9a8d7aedbb7984dc18f2dff178a7850 0.0s
=> => resolve docker.io/library/python:3.13-slim@sha256:3de9a8d7aedbb7984dc18f2dff178a7850f16c1ae7 0.0s
=> CACHED [stage-1 2/4] WORKDIR /app 0.0s
=> CACHED [builder 2/7] WORKDIR /app 0.0s
=> CACHED [builder 3/7] RUN python -m venv .venv 0.0s
=> CACHED [builder 4/7] COPY pyproject.toml ./ 0.0s
=> CACHED [builder 5/7] COPY README.md ./ 0.0s
=> CACHED [builder 6/7] COPY src/ ./src/ 0.0s
=> ERROR [builder 7/7] RUN .venv/bin/pip install . 9.4s
------
> [builder 7/7] RUN .venv/bin/pip install .:
0.814 Processing /app
0.817 Installing build dependencies: started
9.298 Installing build dependencies: finished with status 'error'
9.303 error: subprocess-exited-with-error
9.303
9.303 × installing build dependencies did not run successfully.
9.303 │ exit code: 1
9.303 ╰─> [7 lines of output]
9.303 WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/hatchling/
9.303 WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/hatchling/
9.303 WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/hatchling/
9.303 WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/hatchling/
9.303 WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/hatchling/
9.303 ERROR: Could not find a version that satisfies the requirement hatchling (from versions: none)
9.303 ERROR: No matching distribution found for hatchling
9.303 [end of output]
9.303
9.303 note: This error originates from a subprocess, and is likely not a problem with pip.
9.331 ERROR: Failed to build 'file:///app' when installing build dependencies
------
Error: failed to fetch an image or build from source: error building: failed to solve: process "/bin/sh -c .venv/bin/pip install ." did not complete successfully: exit code: 1