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
18 changes: 6 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
build:
env:
# We use these variables to convert between tox and GHA version literals
py36: 3.6
py37: 3.7
py38: 3.8
py39: 3.9
Expand All @@ -34,7 +33,7 @@ jobs:
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
python-version: [ py36, py37, py38, py39, py310, pypy3 ]
python-version: [ py37, py38, py39, py310, pypy3 ]
package: ["api", "sdk", "semantic", "getting", "shim", "exporter", "protobuf", "propagator"]
os: [ ubuntu-20.04, windows-2019 ]
steps:
Expand All @@ -55,13 +54,8 @@ jobs:
.tox
~/.cache/pip
key: v3-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }}-core
# tox fails on windows and Python3.6 when tox dir is reused between builds so we remove it
srikanthccv marked this conversation as resolved.
Show resolved Hide resolved
- name: fix for windows + py3.6
if: ${{ matrix.os == 'windows-2019' && matrix.python-version == 'py36' }}
shell: pwsh
run: Remove-Item .\.tox\ -Force -Recurse -ErrorAction Ignore
- name: Windows does not let git check out files with long names
if: ${{ matrix.os == 'windows-2019'}}
if: ${{ matrix.os == 'windows-2019'}}
run: git config --system core.longpaths true
- name: run tox
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- --benchmark-json=${{ env.RUN_MATRIX_COMBINATION }}-benchmark.json
Expand Down Expand Up @@ -117,17 +111,17 @@ jobs:
run: tox -e ${{ matrix.tox-environment }}

# Contrib unit test suite in order to ensure changes in core do not break anything in contrib.
# We only run contrib unit tests on the oldest supported Python version (3.6) as running the same tests
# on all versions is somewhat redundant.
# We only run contrib unit tests on the oldest supported Python version (3.7) as running the same tests
# on all versions is somewhat redundant.
contrib-build:
env:
# We use these variables to convert between tox and GHA version literals
py36: 3.6
py37: 3.7
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
python-version: [ py36 ]
python-version: [ py37 ]
package: ["instrumentation", "exporter"]
os: [ ubuntu-20.04]
steps:
Expand Down
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.

68 changes: 68 additions & 0 deletions opentelemetry-api/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
[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.6"
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.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Typing :: Typed",
]
dependencies = [
"aiocontextvars; python_version<'3.7'",
"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
67 changes: 0 additions & 67 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
43 changes: 22 additions & 21 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,64 +1,65 @@
[tox]
isolated_build = True
skipsdist = True
skip_missing_interpreters = True
envlist =
; Environments are organized by individual package, allowing
; for specifying supported Python versions per package.
py3{6,7,8,9,10}-opentelemetry-api
py3{7,8,9,10}-opentelemetry-api
pypy3-opentelemetry-api

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

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

py3{6,7,8,9,10}-opentelemetry-semantic-conventions
py3{7,8,9,10}-opentelemetry-semantic-conventions
pypy3-opentelemetry-semantic-conventions

; docs/getting-started
py3{6,7,8,9,10}-opentelemetry-getting-started
py3{7,8,9,10}-opentelemetry-getting-started
pypy3-opentelemetry-getting-started

py3{6,7,8,9,10}-opentelemetry-opentracing-shim
py3{7,8,9,10}-opentelemetry-opentracing-shim
pypy3-opentelemetry-opentracing-shim

py3{6,7,8,9,10}-opentelemetry-exporter-jaeger-combined
py3{7,8,9,10}-opentelemetry-exporter-jaeger-combined

py3{6,7,8,9,10}-opentelemetry-exporter-jaeger-proto-grpc
py3{7,8,9,10}-opentelemetry-exporter-jaeger-proto-grpc

py3{6,7,8,9,10}-opentelemetry-exporter-jaeger-thrift
py3{7,8,9,10}-opentelemetry-exporter-jaeger-thrift

py3{6,7,8,9,10}-opentelemetry-exporter-opencensus
py3{7,8,9,10}-opentelemetry-exporter-opencensus
; exporter-opencensus intentionally excluded from pypy3

; opentelemetry-exporter-otlp
py3{6,7,8,9,10}-opentelemetry-exporter-otlp-combined
py3{7,8,9,10}-opentelemetry-exporter-otlp-combined
; intentionally excluded from pypy3

py3{6,7,8,9,10}-opentelemetry-exporter-otlp-proto-grpc
py3{7,8,9,10}-opentelemetry-exporter-otlp-proto-grpc
; intentionally excluded from pypy3

py3{6,7,8,9,10}-opentelemetry-exporter-otlp-proto-http
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
py3{6,7,8,9,10}-opentelemetry-exporter-zipkin-combined
py3{7,8,9,10}-opentelemetry-exporter-zipkin-combined
pypy3-opentelemetry-exporter-zipkin-combined

py3{6,7,8,9,10}-opentelemetry-exporter-zipkin-proto-http
py3{7,8,9,10}-opentelemetry-exporter-zipkin-proto-http
pypy3-opentelemetry-exporter-zipkin-proto-http

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

py3{6,7,8,9,10}-opentelemetry-propagator-b3
py3{7,8,9,10}-opentelemetry-propagator-b3
pypy3-opentelemetry-propagator-b3

py3{6,7,8,9,10}-opentelemetry-propagator-jaeger
py3{7,8,9,10}-opentelemetry-propagator-jaeger
pypy3-opentelemetry-propagator-jaeger

lint
Expand Down Expand Up @@ -111,7 +112,7 @@ changedir =

commands_pre =
; Install without -e to test the actual installation
py3{6,7,8,9,10}: python -m pip install -U pip setuptools wheel
py3{7,8,9,10}: python -m pip install -U pip setuptools wheel
; Install common packages for all the tests. These are not needed in all the
; cases but it saves a lot of boilerplate in this file.
opentelemetry: pip install {toxinidir}/opentelemetry-api {toxinidir}/opentelemetry-semantic-conventions {toxinidir}/opentelemetry-sdk {toxinidir}/tests/opentelemetry-test-utils
Expand Down Expand Up @@ -286,7 +287,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