Skip to content

Commit

Permalink
Updated dependencies and added dockerfile (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
wcn00 committed Jan 14, 2022
1 parent 5c7110e commit d0e0657
Show file tree
Hide file tree
Showing 7 changed files with 248 additions and 161 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 0.12.1
### Fixed
- Updated dependencies to address undefined dll symbol _PyUnicode_DecodeUnicodeEscape
- Added ability to test in docker.

## 0.12.0
### Added
- Support for the "map" and "fixed" avro types.
Expand Down
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM python:3.9.9-bullseye

# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE=1

# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED=1

WORKDIR /app
COPY pyproject.toml poetry.lock /app/

RUN apt-get update -qq && apt-get install -y --no-install-recommends \
git vim iputils-ping curl \
&& pip install poetry \
&& poetry config experimental.new-installer false \
&& poetry config virtualenvs.create false \
&& poetry install --no-root


ENV PYTHONPATH=/app
WORKDIR /app
COPY ./ /app/
CMD poetry run pytest tests
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.PHONY: help
help:
@cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

.PHONY: build
build: ## Build docker image
docker build -f Dockerfile -t avro-to-python-types .

.PHONY: test
test: build ## Build docker image
docker run -t --rm \
-v /$(PWD):/app \
avro-to-python-types


.PHONY: test_debug
test_debug: build ## Build docker image
docker run -t --rm \
-v /$(PWD):/app \
-p 9009:9009 \
--entrypoint poetry \
avro-to-python-types \
run python -m debugpy --listen :9009 --wait-for-client -m pytest tests

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ class ExampleUser(TypedDict, total=False):

To run unit tests, run `poetry run pytest`.

You can also run tests in docker via `make test`

## Requirements

Python 3.9 or greater.
2 changes: 1 addition & 1 deletion avro_to_python_types/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.12.0"
__version__ = "0.12.1"
from .typed_dict_from_schema import (
typed_dict_from_schema_file,
typed_dict_from_schema_string,
Expand Down
349 changes: 190 additions & 159 deletions poetry.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "avro-to-python-types"
version = "0.12.0"
version = "0.12.1"
description = "A library for converting avro schemas to python types."
readme = "README.md"
authors = ["Dan Green-Leipciger"]
Expand Down Expand Up @@ -36,6 +36,7 @@ fastavro = "^1.4.4"
pytest = "^6.2.5"
snapshottest = "^0.6.0"
black = "^20.8b1"
debugpy = "^1.5.1"

[tool.poetry.scripts]
sync-example = 'examples:generate_types_from_schemas'
Expand Down

0 comments on commit d0e0657

Please sign in to comment.