diff --git a/.github/workflows/semconvgen.yml b/.github/workflows/semconvgen.yml index f2aca2fa..de26d13f 100644 --- a/.github/workflows/semconvgen.yml +++ b/.github/workflows/semconvgen.yml @@ -18,7 +18,9 @@ jobs: - name: install dependencies run: | pip install -U pip setuptools wheel - pip install -r semantic-conventions/requirements.txt + pip install -r semantic-conventions/dev-requirements.txt + - name: install + run: pip install -U -e ./semantic-conventions/ - name: run tests run: pytest -v @@ -27,6 +29,11 @@ jobs: needs: tests steps: - uses: actions/checkout@v1 + - uses: actions/setup-python@v2 + - name: Build the wheel + run: | + pip install -U pip setuptools wheel + pip wheel --no-deps ./semantic-conventions/ --wheel-dir semantic-conventions/ - name: Build the Docker image run: docker build semantic-conventions/. -t semconvgen - name: Push the Docker image diff --git a/semantic-conventions/Dockerfile b/semantic-conventions/Dockerfile index a78a5096..25404f40 100644 --- a/semantic-conventions/Dockerfile +++ b/semantic-conventions/Dockerfile @@ -3,12 +3,11 @@ ARG PYTHON_VERSION=3.8.5 FROM python:${PYTHON_VERSION}-alpine${ALPINE_VERSION} LABEL maintainer="The OpenTelemetry Authors" -ADD . /semconvgen/ -WORKDIR semconvgen +ADD *.whl /semconvgen/ +WORKDIR /semconvgen RUN rm -f README.md RUN apk --update add --virtual build-dependencies build-base \ - && pip install -r requirements.txt \ - && apk del build-dependencies - -RUN python setup.py install -ENTRYPOINT ["gen-semconv"] \ No newline at end of file + && pip install -U ./semconvgen-*.whl \ + && apk del build-dependencies \ + && rm *.whl +ENTRYPOINT ["gen-semconv"] diff --git a/semantic-conventions/dev-requirements.txt b/semantic-conventions/dev-requirements.txt new file mode 100644 index 00000000..f69da9c9 --- /dev/null +++ b/semantic-conventions/dev-requirements.txt @@ -0,0 +1,3 @@ +black==19.10b0 +mypy==0.770 +pytest==6.1.1 diff --git a/semantic-conventions/requirements.txt b/semantic-conventions/requirements.txt deleted file mode 100644 index 6201369e..00000000 --- a/semantic-conventions/requirements.txt +++ /dev/null @@ -1,12 +0,0 @@ -black==19.10b0 -dataclasses==0.6 -mypy==0.770 -mypy-extensions==0.4.3 -ruamel.yaml==0.16.10 -ruamel.yaml.clib==0.2.0 -typed-ast==1.4.1 -typing-extensions==3.7.4.2 -Jinja2==2.11.2 -pytest==6.1.1 -ipdb==0.13.4 -mistune==2.0.0a6 \ No newline at end of file diff --git a/semantic-conventions/setup.cfg b/semantic-conventions/setup.cfg index 969cc85c..9f58aeb4 100644 --- a/semantic-conventions/setup.cfg +++ b/semantic-conventions/setup.cfg @@ -18,19 +18,14 @@ package_dir= =src packages=find_namespace: install_requires = - black==19.10b0 - dataclasses==0.6 - mypy==0.770 - mypy-extensions==0.4.3 - ruamel.yaml==0.16.10 - ruamel.yaml.clib==0.2.0 - typed-ast==1.4.1 - typing-extensions==3.7.4.2 - Jinja2==2.11.2 + dataclasses~=0.6 + ruamel.yaml~=0.16 + Jinja2~=2.11 + mistune==2.0.0a6 [options.packages.find] where = src [options.entry_points] console_scripts = - gen-semconv = opentelemetry.semconv.main:main \ No newline at end of file + gen-semconv = opentelemetry.semconv.main:main diff --git a/semantic-conventions/src/opentelemetry/semconv/model/semantic_attribute.py b/semantic-conventions/src/opentelemetry/semconv/model/semantic_attribute.py index 5a2e11ae..e6fe9a6c 100644 --- a/semantic-conventions/src/opentelemetry/semconv/model/semantic_attribute.py +++ b/semantic-conventions/src/opentelemetry/semconv/model/semantic_attribute.py @@ -500,7 +500,7 @@ def __str__(self): class TextWithLinks(str): parts: List[Union[str, MdLink]] raw_text: str - md_link = re.compile("\[([^\[\]]+)\]\(([^)]+)") + md_link = re.compile(r"\[([^\[\]]+)\]\(([^)]+)") def __init__(self, text): super().__init__()