Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/build_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,12 @@ jobs:
"$GITHUB_REF_NAME" =~ ^[0-9]+\.x$ ]]; then
LIBRARY_VERSION=$(setuptools-scm --strip-dev)
else
# All else, maintain the dev version
LIBRARY_VERSION=$(setuptools-scm)
# use version string explicitly set in the project metadata, if exists
LIBRARY_VERSION=$(grep '^version = ' pyproject.toml | tr -d '"' | cut -d' ' -f3)
if [[ -z $LIBRARY_VERSION ]]; then
# All else, maintain the dev version
LIBRARY_VERSION=$(setuptools-scm)
fi
fi

echo "${LIBRARY_VERSION}" | tee version.txt
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ build-backend = "setuptools.build_meta"

[project]
name = "ddtrace"
# DEV: to directly override the version specifier, comment this...
dynamic = ["version"]
# ...and uncomment this
# version = "4.0.0.dev0"
description = "Datadog APM client library"
readme = "README.md"
license = { text = "LICENSE.BSD3" }
Expand Down
5 changes: 3 additions & 2 deletions tests/lib_injection/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@

import pytest

from ddtrace._version import __version__ as host_ddtrace_version
from ddtrace.version import get_version


HOST_DDTRACE_VERSION = get_version()
LIBS_INJECTION_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../lib-injection"))
LIBS_INJECTION_SRC_DIR = os.path.join(LIBS_INJECTION_DIR, "sources")
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
Expand Down Expand Up @@ -100,7 +101,7 @@ def ddtrace_injection_artifact():
# 5. Write the ddtrace version file
version_file_path = os.path.join(sources_dir_in_session_tmp, "version")
with open(version_file_path, "w") as f:
f.write(host_ddtrace_version)
f.write(HOST_DDTRACE_VERSION)

yield sources_dir_in_session_tmp

Expand Down
Loading