Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
hkage committed Dec 4, 2020
2 parents 50b3df3 + 0ff4684 commit d2fb3bd
Show file tree
Hide file tree
Showing 10 changed files with 533 additions and 1,722 deletions.
31 changes: 24 additions & 7 deletions .github/workflows/python_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,55 @@ name: Test
on: [push, pull_request]

jobs:

testing:

runs-on: ubuntu-latest

strategy:
max-parallel: 4
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install and set up Poetry

- name: Install poetry
run: |
curl -fsS -o get-poetry.py https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py
python get-poetry.py -y
- name: Configure poetry
run: |
python get-poetry.py --preview -y
source $HOME/.poetry/env
poetry config virtualenvs.in-project true
- name: Set up cache
uses: actions/cache@v1
id: cache
with:
path: .venv
key: ${{ runner.os }}-venv-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}

- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv

- name: Install dependencies
run: |
source $HOME/.poetry/env
poetry install
- name: Test with pytest
run: |
source $HOME/.poetry/env
poetry run pytest -q tests
- name: Lint with flake8
run: |
source $HOME/.poetry/env
Expand Down
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[settings]
line_length=120
multi_line_output=4
multi_line_output=0
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Development

## 0.3.1 (2020-12-04)

* [#13](https://github.com/rheinwerk-verlag/postgresql-anonymizer/pull/13>): Fixed a syntax error if no truncated tables are defined ([ray-man](https://github.com/ray-man>))

## 0.3.0 (2020-02-11)

* Use [python-poetry](https://github.com/python-poetry/poetry) for requirements management
Expand Down
19 changes: 12 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ Features
| ``ip`` | 157.50.1.20 | ``set`` | 127.0.0.1 |
+----------------+----------------------+-----------------------+----------------------------------+

See the documentation (https://python-postgresql-anonymizer.readthedocs.io/en/latest/) for a more
detailed description of the provided anonymization methods.
See the `documentation`_ for a more detailed description of the provided anonymization methods.

Installation
------------
Expand Down Expand Up @@ -71,6 +70,10 @@ Usage
--dump-file DUMP_FILE
Create a database dump file with the given name

Despite the database connection values, you will have to define a YAML schema file, that includes
all anonymization rules for that database. Take a look at the `schema documentation`_ or the
`YAML sample schema`_.

Example call::

$ pganonymize --schema=myschema.yml \
Expand All @@ -83,9 +86,9 @@ Example call::
Database dump
~~~~~~~~~~~~~

With the ``--dump-file`` argument it is possible to create a database dump file after anonymizing the database.
Please note, that the ``pg_dump`` command from the ``postgresql-client-common`` library is necessary to create
the dump file for t he connected database, e.g. under Linux::
With the ``--dump-file`` argument it is possible to create a dump file after anonymizing the database. Please note,
that the ``pg_dump`` command from the ``postgresql-client-common`` library is necessary to create the dump file for the
database, e.g. under Linux::

sudo apt-get install postgresql-client-common

Expand Down Expand Up @@ -119,7 +122,7 @@ Now you can install all requirements and activate the virtualenv::
Docker
------

If you want to run the anonymizher within a Docker container you first have to build the image::
If you want to run the anonymizer within a Docker container you first have to build the image::

$ docker build -t pganonymizer .

Expand All @@ -137,7 +140,9 @@ After that you can pass a schema file to the container, using Docker volumes, an
-v


.. _Faker: https://faker.readthedocs.io/en/master/providers.html
.. _documentation: https://python-postgresql-anonymizer.readthedocs.io/en/latest/
.. _schema documentation: https://python-postgresql-anonymizer.readthedocs.io/en/latest/schema.html
.. _YAML sample schema: https://github.com/rheinwerk-verlag/postgresql-anonymizer/blob/master/sample_schema.yml

.. |license| image:: https://img.shields.io/badge/license-MIT-green.svg
:target: https://github.com/rheinwerk-verlag/postgresql-anonymizer/blob/master/LICENSE.rst
Expand Down
Loading

0 comments on commit d2fb3bd

Please sign in to comment.