a year ago
Deploying a python project that leverages dynamic __version__ resolution, build will fail.
This is perhaps caused due due to the builder not fetching git tags? git fetch --tags or git fetch --all solves the issue at least locally.
- This does not occur in CI.
- Does not occur with
docker build .(given that tags are fetched)
Relevant logs
```RuntimeError: Error getting the version from source versioningit: NotSdistError: /opt/prefect does not contain a PKG-INFO file
versioningit could not find a version for the project in /opt/prefect!
You may be installing from a shallow clone, in which case you need to unshallow it first.
Alternatively, you may be installing from a Git archive, which is not supported by default. Install from a git+https://... URL instead.
7 Replies
a year ago
I would assume this is because the .git folder is not downloaded when we build your app.
# Use the Dockerfile explicitly
builder = "DOCKERFILE"
# Ensure git history is preserved
buildCommand = """
git config --global --add safe.directory /opt/prefect
git fetch --unshallow --tags || true
"""
[deploy]
# Running prefect server after build
startCommand = "prefect server start"
restartPolicyType = "ON_FAILURE"Also tried using a railway.toml without luck
a year ago
Sorry but there is no way to have Railway download the .git folder.
a year ago
!s
Status changed to Solved brody • about 1 year ago