Skip to content

Commit

Permalink
Semconvgen: Clean up requirements, build. (#51)
Browse files Browse the repository at this point in the history
* Clean up requirements.

* Fix YAML syntax.

* Properly setup Python.
  • Loading branch information
Oberon00 authored Jul 14, 2021
1 parent c7067fa commit 50bf502
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 31 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/semconvgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
13 changes: 6 additions & 7 deletions semantic-conventions/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
&& pip install -U ./semconvgen-*.whl \
&& apk del build-dependencies \
&& rm *.whl
ENTRYPOINT ["gen-semconv"]
3 changes: 3 additions & 0 deletions semantic-conventions/dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
black==19.10b0
mypy==0.770
pytest==6.1.1
12 changes: 0 additions & 12 deletions semantic-conventions/requirements.txt

This file was deleted.

15 changes: 5 additions & 10 deletions semantic-conventions/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
gen-semconv = opentelemetry.semconv.main:main
Original file line number Diff line number Diff line change
Expand Up @@ -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__()
Expand Down

0 comments on commit 50bf502

Please sign in to comment.