Skip to content
Open
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
7 changes: 6 additions & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,13 @@ jobs:
false
fi

- name: Set up uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3

- name: Install towncrier
run: pip install towncrier==25.8.0
run: |
uv sync --locked --only-group towncrier
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we set this one time? instead of having it in every job

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each job runs in it's own vm so I dont think it's possible.. maybe it could be moved to a template that each workflow imports but i'm not sure its worth it

@emdneto emdneto Nov 13, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely, but i noticed in -contrib we are running the commands through uv run --no-sync instead of doing this. Just wanted a common approach. anyway, don't want to block the PR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah youre right.. we can get rid of this step completely and do

uv run --only-group towncrier towncrier


- name: Check for changelog fragment
env:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/prepare-patch-release.yml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we set UV_LOCKED at the top level of our workflows?

That should cascade all the way down to scripts and such, and we can de-duplicate --locked from all the commands.

Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ jobs:
# zizmor: ignore[artipacked] Credentials are required by the branch push below.
persist-credentials: true

- name: Set up uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3

- name: Install dependencies
run: pip install toml towncrier
run: |
uv sync --locked --only-group toml --only-group towncrier
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"

- run: |
if [[ ! $GITHUB_REF_NAME =~ ^release/v[0-9]+\.[0-9]+\.x-0\.[0-9]+bx$ ]]; then
Expand Down
21 changes: 18 additions & 3 deletions .github/workflows/prepare-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ jobs:
with:
persist-credentials: false

- name: Set up uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3

- name: Install toml
run: pip install toml
run: |
uv sync --locked --only-group toml
Comment thread
emdneto marked this conversation as resolved.
Resolved
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"

- name: Verify prerequisites
env:
Expand Down Expand Up @@ -50,8 +55,13 @@ jobs:
# zizmor: ignore[artipacked] Credentials are required by the branch pushes below.
persist-credentials: true

- name: Set up uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3

- name: Install dependencies
run: pip install toml towncrier
run: |
uv sync --locked --only-group toml --only-group towncrier
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"

- name: Create release branch
env:
Expand Down Expand Up @@ -138,8 +148,13 @@ jobs:
# zizmor: ignore[artipacked] Credentials are required by the branch push below.
persist-credentials: true

- name: Set up uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3

- name: Install dependencies
run: pip install toml towncrier
run: |
uv sync --locked --only-group toml --only-group towncrier
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"

- name: Set environment variables
env:
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ jobs:
with:
persist-credentials: false

- name: Set up uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3

- name: Install toml
run: pip install toml
run: |
uv sync --locked --only-group toml
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"

- name: Set environment variables
run: |
Expand Down Expand Up @@ -86,7 +91,7 @@ jobs:

- name: Install twine
run: |
pip install twine
uv sync --locked --only-group twine

# The step below publishes to testpypi in order to catch any issues
# with the package configuration that would cause a failure to upload
Expand Down
4 changes: 2 additions & 2 deletions .github/zizmor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ rules:
use-trusted-publishing:
ignore:
# TestPyPI and PyPI publishing use existing tokens until trusted publishers are configured.
- release.yml:97
- release.yml:104
- release.yml:107
- release.yml:114
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -251,5 +251,20 @@ dev = [
"pre-commit",
"datamodel-code-generator[http]",
"datamodel-code-generator[ruff]",
{ include-group = "towncrier" },
]
build = [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

every single pyproject.toml in opentelemetry-python uses hatchling, we don't need setuptools and wheel anymore.

We also don't need build and pip anymore because we are going to use uv in the release.. So this group only needs to be hatchling..

"build",
"pip",
"setuptools",
"wheel",
]
toml = [
"toml",
]
towncrier = [
"towncrier",
]
twine = [
"twine",
]
8 changes: 5 additions & 3 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@

set -ev

# Get the latest versions of packaging tools
python3 -m pip install --upgrade pip build setuptools wheel

BASEDIR=$(dirname "$(readlink -f "$(dirname $0)")")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should quote the variable expansion here:

BASEDIR=$(dirname "$(readlink -f "$(dirname "$0")")")

DISTDIR=dist

# Get the versions of packaging tools recorded in the lockfile
uv sync --locked --only-group build --project "$BASEDIR"
PATH="$BASEDIR/.venv/bin:$PATH"
export PATH

(
cd $BASEDIR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing here:

cd "$BASEDIR"

mkdir -p $DISTDIR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here:

mkdir -p "$DISTDIR"
rm -rf "${DISTDIR:?}/"*

Expand Down
377 changes: 376 additions & 1 deletion uv.lock

Large diffs are not rendered by default.

Loading