-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update docs, tests and demo. Port changes from develop branch (#34).
- Loading branch information
Showing
39 changed files
with
440 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Created by .ignore support plugin (hsz.mobi) | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
*.so | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
*.manifest | ||
*.spec | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
htmlcov/ | ||
.tox/ | ||
*.mo | ||
*.pot | ||
*.log | ||
docs/_build/ | ||
.env | ||
.idea | ||
/docs | ||
.dockerignore | ||
.gitattributes | ||
.gitignore | ||
docker-compose.yml | ||
Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
FROM python:3.6 | ||
|
||
LABEL github="https://github.com/nigma/django-easy-pdf" | ||
|
||
ENV PYTHONUNBUFFERED 1 | ||
ENV LANG=en_US.UTF-8 | ||
ENV PIP_NO_CACHE_DIR off | ||
ENV PIP_DISABLE_PIP_VERSION_CHECK on | ||
|
||
RUN mkdir -p /app /app/docs | ||
WORKDIR /app | ||
|
||
RUN set -eux \ | ||
&& DEPS=' \ | ||
bash \ | ||
gettext \ | ||
' \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends $DEPS \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY requirements.txt /app/ | ||
COPY requirements-dev.txt /app/ | ||
COPY docs/requirements.txt /app/docs/ | ||
|
||
RUN set -eux \ | ||
&& pip3 install --no-cache-dir -U pip setuptools wheel | ||
|
||
RUN set -eux \ | ||
pip3 install --no-cache-dir --timeout 1000 -r requirements.txt -r requirements-dev.txt \ | ||
&& pip3 install --no-cache-dir --timeout 1000 -r docs/requirements.txt | ||
|
||
COPY . /app/ | ||
|
||
EXPOSE 8000 | ||
|
||
CMD ["python", "demo.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
.PHONY: all help clean clean-build clean-pyc demo lint mypy test test-all docs release sdist dist upload docker-build docker-demo docker-shell | ||
|
||
all: docker-demo | ||
|
||
help: | ||
@echo "clean-build - remove build artifacts" | ||
@echo "clean-pyc - remove Python file artifacts" | ||
@echo "lint - check style with flake8" | ||
@echo "mypy - check types with mypy" | ||
@echo "test - run tests quickly with the default Python" | ||
@echo "testall - run tests on every Python version with tox" | ||
@echo "docs - generate Sphinx HTML documentation, including API docs" | ||
@echo "sdist - package" | ||
@echo "dist - package sdist and wheel" | ||
@echo "upload - upload to PyPI" | ||
@echo "release - package and upload a release" | ||
@echo "docker-demo - build and run demo using Docker image" | ||
|
||
clean: clean-build clean-pyc | ||
|
||
clean-build: | ||
rm -fr build/ | ||
rm -fr dist/ | ||
rm -fr *.egg-info | ||
|
||
clean-pyc: | ||
find . -name '*.pyc' -exec rm -f {} + | ||
find . -name '*.pyo' -exec rm -f {} + | ||
find . -name '*~' -exec rm -f {} + | ||
|
||
lint: | ||
flake8 easy_pdf tests | ||
|
||
mypy: | ||
mypy --ignore-missing-imports --strict-optional easy_pdf tests --verbose | ||
|
||
test: | ||
python tests/manage.py test | ||
|
||
test-all: | ||
tox | ||
|
||
docs: | ||
$(MAKE) -C docs clean | ||
$(MAKE) -C docs html | ||
sphinx-build -b linkcheck ./docs _build/ | ||
sphinx-build -b html ./docs _build/ | ||
|
||
release: lint test docs clean dist upload | ||
|
||
sdist: clean | ||
python setup.py sdist | ||
ls -l dist | ||
|
||
dist: clean | ||
python setup.py sdist bdist_wheel | ||
|
||
upload: | ||
twine upload -s dist/* | ||
|
||
demo: | ||
python demo.py | ||
|
||
# Docker workflow | ||
|
||
docker-build: | ||
docker build -t django-easy-pdf . | ||
|
||
docker-demo: docker-build | ||
docker run --rm -it -p 8000:8000 -v `pwd`/easy_pdf:/app/easy_pdf -v `pwd`/docs:/app/docs -v `pwd`/dist:/app/dist -v `pwd`/tests:/app/tests django-easy-pdf make demo | ||
|
||
docker-shell: docker-build | ||
docker run --rm -it -v `pwd`/easy_pdf:/app/easy_pdf -v `pwd`/docs:/app/docs -v `pwd`/dist:/app/dist -v `pwd`/tests:/app/tests django-easy-pdf bash | ||
|
||
docker-%: docker-build | ||
docker run --rm -it -v `pwd`/easy_pdf:/app/easy_pdf -v `pwd`/docs:/app/docs -v `pwd`/dist:/app/dist -v `pwd`/tests:/app/tests django-easy-pdf make $* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.