build-tools icon indicating copy to clipboard operation
build-tools copied to clipboard

Update semantic-conventions Directory to Support PyPi Packaging

Open Kevin-Ngo opened this issue 1 year ago • 3 comments

Description

There are some cases where using the SemanticConvention model outside of a CLI would be useful, such as third-party scripts that perform validation on Semantics on top of the standard syntax validation found in the semconvgen models. That said, adding the package to PyPi makes it easily available for other applications/services to reference it as a dependency. In this PR, a description and package name is edited to allow easy publishing to PyPi.

Issue

https://github.com/open-telemetry/build-tools/issues/253

Testing

  • [x] Tested publishing the library on PyPi's test server
  • [x] Tested running pip install within a venv to install the library

Steps to Publish

  1. Obtain information needed from opentelemetry's PyPi account (API Token) [more information]
  2. Go to the semantic-conventions directory
cd semantic-conventions
  1. Install dependencies
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel twine
  1. Generate the wheels (distribution) (Note when they are asking for username/password, it should be as follows: "__token__"/{OPENTELEMETRY_ACCOUNT_API_TOKEN})
pip wheel --no-deps . --wheel-dir ./dist
  1. Upload the distribution
python3 -m twine upload --repository testpypi dist/* --verbose

Kevin-Ngo avatar Jan 08 '24 22:01 Kevin-Ngo

CLA Missing ID CLA Not Signed

  • :x: The email address for the commit (32c80e0904c665b079ac1ca7f0433994266cfbf0) is not linked to the GitHub account, preventing the EasyCLA check. Consult this Help Article and GitHub Help to resolve. (To view the commit's email address, add .patch at the end of this PR page's URL.) For further assistance with EasyCLA, please submit a support request ticket.

We will probably need some sort of OTel credentials to publish this package to PyPi. CC @open-telemetry/technical-committee

joaopgrassi avatar Jan 10 '24 16:01 joaopgrassi

Are we really sure we need this? We have enough compatibility problems and under-documentation with what Jinja templates can access. If we expose this, even more changes will be breaking changes.

(I copied this comment to the issue)

Oberon00 avatar Jan 10 '24 16:01 Oberon00