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 semantic-conventions Directory to Support PyPi Packaging #255

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Kevin-Ngo
Copy link

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

#253

Testing

  • Tested publishing the library on PyPi's test server
  • 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 Kevin-Ngo requested review from a team as code owners January 8, 2024 22:54
Copy link

CLA Missing ID CLA Not Signed

@joaopgrassi
Copy link
Member

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

@Oberon00
Copy link
Member

Oberon00 commented Jan 10, 2024

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)

@@ -36,10 +36,10 @@ package_dir=
=src
packages=find_namespace:
install_requires =
dataclasses~=0.6
dataclasses~=0.6;python_version<'3.7'
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we support python < 3.7 at all, probably we need the Python version we currently run with in the container as minimum.

Copy link
Author

Choose a reason for hiding this comment

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

hmm, got it. I added that part just because dataclasses comes standard in 3.7, so we wouldn't have to install it in that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants