Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
hkage committed Nov 23, 2022
2 parents a2db061 + caf4204 commit 6f4ebc3
Show file tree
Hide file tree
Showing 23 changed files with 401 additions and 1,952 deletions.
3 changes: 1 addition & 2 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[flake8]
max-line-length = 120
ignore = E731,W504
exclude =
exclude =
dist
docs
setup.py
get-poetry.py
.tox
.git
.eggs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
69 changes: 26 additions & 43 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,39 @@ name: Test
on: [push]

jobs:

testing:

linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Lint
run: tox -e flake8
tests:
needs: linting
runs-on: ubuntu-latest

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

python-version: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10']
env:
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
id: setup-python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- 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: |
source $HOME/.poetry/env
poetry config virtualenvs.in-project true
- name: Set up cache
uses: actions/cache@v1
id: cache
with:
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
python -m pip install --upgrade pip
pip install tox "coverage<5"
- name: Run tests
run: |
source $HOME/.poetry/env
poetry run flake8
export TOXENV=$(echo "py${{ matrix.python-version }}" | sed 's/\.//g')
tox -- -p no:warnings
14 changes: 8 additions & 6 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[settings]
line_length=120
multi_line_output=0
sections=FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,PGA,LOCALFOLDER
default_section=THIRDPARTY
known_pga=pganonymize
no_lines_before=LOCALFOLDER
combine_as_imports = true
include_trailing_comma = true
line_length = 120
multi_line_output = 5
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,PGA,LOCALFOLDER
default_section = THIRDPARTY
known_pga = pganonymize
no_lines_before = LOCALFOLDER

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Development

## 0.9.0 (2022-11-23)

* [#46](https://github.com/rheinwerk-verlag/pganonymize/pull/46): Broken Python 2.7 compatibility
* [#45](https://github.com/rheinwerk-verlag/pganonymize/pull/45): Add partial masked provider ([Tilley](https://github.com/Tilley/))
* [#44](https://github.com/rheinwerk-verlag/pganonymize/pull/44): Pass kwargs through to faker functions from schema ([Tilley](https://github.com/Tilley/))

## 0.8.0 (2022-03-15)

* [#39](https://github.com/rheinwerk-verlag/pganonymize/issues/39): Renamed project to "pganonymize"
Expand Down
12 changes: 2 additions & 10 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,11 @@ version:
$ git clone [email protected]:rheinwerk-verlag/postgresql-anonymizer.git
$ cd postgresql-anonymizer
We are using `poetry`_ for development, you may need to install it first:
For the development use a virtualenv or install the requirements directly:

.. code-block:: sh
$ sudo pip install poetry
Now you can install all development requirements and activate the virtualenv:

.. code-block:: sh
$ poetry install
$ poetry shell
$ sudo pip install -r requirements.txt
Coding style
------------
Expand All @@ -54,7 +47,6 @@ Before creating a pull request make sure to check:

.. _issue: https://github.com/rheinwerk-verlag/postgresql-anonymizer/issues
.. _new issue: https://github.com/rheinwerk-verlag/postgresql-anonymizer/issues/new
.. _poetry: https://python-poetry.org/
.. _EditorConfig: https://editorconfig.org/
.. _tests: https://github.com/rheinwerk-verlag/postgresql-anonymizer/tree/development/tests
.. _Sphinx documentation: https://github.com/rheinwerk-verlag/postgresql-anonymizer/tree/development/docs
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ clean-test: ## remove test and coverage artifacts
rm -fr .tox/

flake8: ## run style checks and static analysis with flake8
@poetry run flake8
@flake8

release: clean ## package and upload a release
python setup.py sdist upload
Expand All @@ -58,7 +58,7 @@ 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
@pytest

test-all: ## run tests on every Python version with tox
@tox
6 changes: 5 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ anonymization. The tool requires a direct PostgreSQL connection to perform the a

|python| |license| |pypi| |downloads| |build| |health|

.. image:: docs/_static/demo.gif

.. contents::

Features
Expand All @@ -31,6 +33,8 @@ Features
+----------------+----------------------+-------------------------+----------------------------------+
| ``password`` | dsf82hFxcM | ``mask`` | XXXXXXXXXX |
+----------------+----------------------+-------------------------+----------------------------------+
| ``credit_card``| 1234-567-890 | ``partial_mask`` | 1??????????0 |
+----------------+----------------------+-------------------------+----------------------------------+
| ``email`` | [email protected] | ``md5`` | 0cba00ca3da1b283a57287bcceb17e35 |
+----------------+----------------------+-------------------------+----------------------------------+
| ``email`` | [email protected] | ``faker.unique.email`` | [email protected] |
Expand Down Expand Up @@ -156,7 +160,7 @@ After that you can pass a schema file to the container, using Docker volumes, an
.. _uuid4: https://www.postgresql.org/docs/current/datatype-uuid.html
.. _documentation: https://python-postgresql-anonymizer.readthedocs.io/en/latest/
.. _documentation: https://pganonymize.readthedocs.io/en/latest/
.. _schema documentation: https://python-postgresql-anonymizer.readthedocs.io/en/latest/schema.html
.. _YAML sample schema: https://github.com/rheinwerk-verlag/pganonymize/blob/master/sample_schema.yml
Expand Down
Binary file added docs/_static/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 12 additions & 3 deletions docs/deploy.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
Deploy
======

To create a new release you will have to install ``twine`` first::
A new release (PyPi package) will be created automatically if a tag was created using `Github actions`_. If the release
has to be uploaded manually, you will have to install ``twine`` first:

.. code-block:: bash
$ pip install twine
Then you have to create a new distribution file::
Then you have to create a new distribution file:

.. code-block:: bash
$ make dist
Finally you can upload the file to PyPi::
Finally you can upload the file to PyPi:

.. code-block:: bash
$ twine upload dist/*
.. _Github actions: https://github.com/rheinwerk-verlag/pganonymize/actions
Loading

0 comments on commit 6f4ebc3

Please sign in to comment.