Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
hkage committed Feb 11, 2020
2 parents 18037c8 + 884e02b commit 50b3df3
Show file tree
Hide file tree
Showing 41 changed files with 3,312 additions and 636 deletions.
14 changes: 14 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[flake8]
max-line-length = 120
ignore = E731,W504
exclude =
dist
docs
setup.py
get-poetry.py
.tox
.git
.eggs
.venv
.vscode
.github
30 changes: 21 additions & 9 deletions .github/workflows/python_test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Test

on: [push]
on: [push, pull_request]

jobs:
build:


testing:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
Expand All @@ -17,13 +17,25 @@ jobs:
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Install and set up Poetry
run: |
python -m pip install --upgrade pip
pip install -r requirements/test.txt
- name: Lint with flake8
python get-poetry.py --preview -y
source $HOME/.poetry/env
poetry config virtualenvs.in-project true
- name: Set up cache
uses: actions/cache@v1
with:
path: .venv
key: ${{ runner.os }}-venv-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: |
make flake8
source $HOME/.poetry/env
poetry install
- name: Test with pytest
run: |
pytest
source $HOME/.poetry/env
poetry run pytest -q tests
- name: Lint with flake8
run: |
source $HOME/.poetry/env
poetry run flake8
5 changes: 5 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[MESSAGES CONTROL]
# disable:
# C0301: "Line too long", because it's already check by flake8
# I0011: "Locally disabling ...", because it was disabled for a reason
disable=C0301,I0011
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Development

## 0.3.0 (2020-02-11)

* Use [python-poetry](https://github.com/python-poetry/poetry) for requirements management
* Added commandline argument to list all available providers (#4)
* Added commandline argument to create a dump file (#5)
* Execute table truncation in one statement to avoid foreign key constraint errors (thanks to [W1ldPo1nter](https://github.com/W1ldPo1nter))

## 0.2.4 (2020-01-03)

* Fixed several issues with the usage of ``dict.keys`` and Python 3
Expand All @@ -19,7 +26,7 @@
## 0.2.1 (2019-12-20)

* Added field based, regular expression excludes (to skip data under certain conditions).
Currently only regular expressions are supported and the exlusion affects the whole row,
Currently only regular expressions are supported and the exclusion affects the whole row,
not just one single column.

## 0.2.0 (2019-12-20)
Expand Down
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3.8.1-slim

LABEL maintainer="[email protected]"

RUN apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y libpq-dev python3-pip \
&& pip install -U pip \
&& pip install pganonymize psycopg2-binary \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
5 changes: 4 additions & 1 deletion LICENSE.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
License
=======

The MIT License

Copyright (c) 2019, Rheinwerk Verlag GmbH
Copyright (c) 2019-2020, Rheinwerk Verlag GmbH

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
50 changes: 7 additions & 43 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,51 +41,9 @@ clean-pyc: ## remove Python file artifacts

clean-test: ## remove test and coverage artifacts
rm -fr .tox/
rm -f .coverage
rm -fr reports/

test: ## run tests quickly with the default Python
python setup.py test

test-all: ## run tests on every Python version with tox
tox

pylint: ## run style checks and static analysis with pylint
@-mkdir -p reports/
@-pylint $(PYTHON_PACKAGE) -r n --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" > reports/pylint.txt
@echo "See reports/pylint.txt"
@-pylint $(PYTHON_PACKAGE)

flake8: ## run style checks and static analysis with flake8
@-mkdir -p reports/
flake8 $(PYTHON_PACKAGE) $(TESTS_PACKAGE) --format='%(path)s:%(row)d: [%(code)s(%(code)s), ] %(text)s' --output-file=reports/flake8.txt --tee

docstrings: ## check docstring presence and style conventions with pydocstyle
pydocstyle $(PYTHON_PACKAGE)

lint: flake8 docstrings pylint

coverage: ## check code coverage quickly with the default Python
py.test --cov-report html:reports/htmlcov --cov-report xml:reports/coverage.xml
@echo "See reports/htmlcov/index.html"

metrics: ## print code metrics with radon
radon raw -s $(PYTHON_PACKAGE) $(TEST_PACKAGE)
radon cc -s $(PYTHON_PACKAGE) $(TEST_PACKAGE)
radon mi -s $(PYTHON_PACKAGE) $(TEST_PACKAGE)

docs: ## generate Sphinx HTML documentation, including API docs
rm -f docs/$(PYTHON_PACKAGE).rst
rm -f docs/modules.rst
sphinx-apidoc --no-toc -o docs/ $(PYTHON_PACKAGE)
$(MAKE) -C docs clean
$(MAKE) -C docs html
@echo "See docs/_build/html/index.html"

docs-open:
$(BROWSER) docs/_build/html/index.html

docs-all: docs docs-open
@poetry run flake8

release: clean ## package and upload a release
python setup.py sdist upload
Expand All @@ -98,3 +56,9 @@ dist: clean ## builds source and wheel package

install: clean ## install the package to the active Python's site-packages
python setup.py install

test:
@poetry run pytest --cov=poetry --cov-config .coveragerc tests/ -sq

test-all: ## run tests on every Python version with tox
@tox
Loading

0 comments on commit 50b3df3

Please sign in to comment.