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

Update package metadata opentelemetry-api #2867

Merged
merged 12 commits into from
Aug 25, 2022
33 changes: 18 additions & 15 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
This document explains how to publish all OT modules at version x.y.z. Ensure that you’re following semver when choosing a version number.

Release Process:
* [Checkout a clean repo](#checkout-a-clean-repo)
* [Update versions](#update-versions)
* [Create a new branch](#create-a-new-branch)
* [Open a Pull Request](#open-a-pull-request)
* [Create a Release](#Create-a-Release)
* [Move stable tag](#Move-stable-tag)
* [Update main](#Update-main)
* [Update docs](#Update-docs)
* [Check PyPI](#Check-PyPI)
* [Troubleshooting](#troubleshooting)
- [Checkout a clean repo](#checkout-a-clean-repo)
- [Update versions](#update-versions)
- [Create a new branch](#create-a-new-branch)
- [Open a Pull Request](#open-a-pull-request)
- [Create a Release](#create-a-release)
- [Check PyPI](#check-pypi)
- [Move stable tag](#move-stable-tag)
- [Update main](#update-main)
- [Hotfix procedure](#hotfix-procedure)
- [Troubleshooting](#troubleshooting)
- [Publish failed](#publish-failed)

## Checkout a clean repo
To avoid pushing untracked changes, check out the repo in a new dir
Expand Down Expand Up @@ -81,11 +82,13 @@ A `hotfix` is defined as a small change developed to correct a bug that should b
2. On your local machine, remove the `dev0` tags from the version number and increment the patch version number.
3. On your local machine, update `CHANGELOG.md` with the date of the hotfix change.
4. With administrator privileges for PyPi, manually publish the affected packages.
a. Install [twine](https://pypi.org/project/twine/)
b. Navigate to where the `setup.py` file exists for the package you want to publish.
c. Run `python setup.py sdist bdist_wheel`. You may have to install [wheel](https://pypi.org/project/wheel/) as well.
d. Validate your built distributions by running `twine check dist/*`.
e. Upload distributions to PyPi by running `twine upload dist/*`.
1. Install [twine](https://pypi.org/project/twine/) and [build](https://pypi.org/project/build/)
2. Navigate to where the `setup.py` or `pyproject.toml` file exists for the package you want to publish.
3. To build the package:
- If a `setup.py` file exists, run `python setup.py sdist bdist_wheel`. You may have to install [wheel](https://pypi.org/project/wheel/) as well.
- Otherwise, run `python -m build`.
4. Validate your built distributions by running `twine check dist/*`.
5. Upload distributions to PyPi by running `twine upload dist/*`.
5. Note that since hotfixes are manually published, the build scripts for publish after creating a release are not run.

## Troubleshooting
Expand Down
9 changes: 0 additions & 9 deletions opentelemetry-api/MANIFEST.in

This file was deleted.

66 changes: 66 additions & 0 deletions opentelemetry-api/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "opentelemetry-api"
description = "OpenTelemetry Python API"
readme = "README.rst"
license = "Apache-2.0"
requires-python = ">=3.7"
authors = [
{ name = "OpenTelemetry Authors", email = "[email protected]" },
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Typing :: Typed",
]
dependencies = [
"Deprecated >= 1.2.6",
"setuptools >= 16.0",
]
dynamic = [
"version",
]

[project.optional-dependencies]
test = []

[project.entry-points.opentelemetry_context]
contextvars_context = "opentelemetry.context.contextvars_context:ContextVarsRuntimeContext"

[project.entry-points.opentelemetry_environment_variables]
api = "opentelemetry.environment_variables"

[project.entry-points.opentelemetry_meter_provider]
default_meter_provider = "opentelemetry.metrics:NoOpMeterProvider"

[project.entry-points.opentelemetry_propagator]
baggage = "opentelemetry.baggage.propagation:W3CBaggagePropagator"
tracecontext = "opentelemetry.trace.propagation.tracecontext:TraceContextTextMapPropagator"

[project.entry-points.opentelemetry_tracer_provider]
default_tracer_provider = "opentelemetry.trace:NoOpTracerProvider"

[project.urls]
Homepage = "https://github.com/open-telemetry/opentelemetry-python/tree/main/opentelemetry-api"

[tool.hatch.version]
path = "src/opentelemetry/version.py"

[tool.hatch.build.targets.sdist]
include = [
srikanthccv marked this conversation as resolved.
Show resolved Hide resolved
"/src",
"/tests",
]

[tool.hatch.build.targets.wheel]
packages = ["src/opentelemetry"]
srikanthccv marked this conversation as resolved.
Show resolved Hide resolved
66 changes: 0 additions & 66 deletions opentelemetry-api/setup.cfg

This file was deleted.

27 changes: 0 additions & 27 deletions opentelemetry-api/setup.py

This file was deleted.

4 changes: 3 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
set -ev

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

BASEDIR=$(dirname $(readlink -f $(dirname $0)))
DISTDIR=dist
Expand All @@ -24,6 +24,8 @@ DISTDIR=dist
# packaged. Verify the intent by looking for a setup.py.
if [ -f setup.py ]; then
python3 setup.py sdist --dist-dir "$BASEDIR/dist/" clean --all
else if [ -f pyproject.toml ]; then
HATCH_BUILD_CLEAN=1 python3 -m build --outdir "$BASEDIR/dist/"
fi
)
done
Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[tox]
isolated_build = True
skipsdist = True
skip_missing_interpreters = True
envlist =
Expand Down Expand Up @@ -42,7 +43,7 @@ envlist =
py3{7,8,9,10}-opentelemetry-exporter-otlp-proto-http
pypy3-opentelemetry-exporter-otlp-proto-http

py3{6,7,8,9,10}-opentelemetry-exporter-prometheus
py3{7,8,9,10}-opentelemetry-exporter-prometheus
pypy3-opentelemetry-exporter-prometheus

; opentelemetry-exporter-zipkin
Expand Down Expand Up @@ -287,7 +288,7 @@ commands_pre =
-e {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-grpc \
-e {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-http \
-e {toxinidir}/exporter/opentelemetry-exporter-otlp
docker-compose up -d
docker-compose up -d
commands =
pytest {posargs}
commands_post =
Expand Down