Skip to content

Commit 6f4ebc3

Browse files
committed
Merge branch 'development'
2 parents a2db061 + caf4204 commit 6f4ebc3

23 files changed

+401
-1952
lines changed

.flake8

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
[flake8]
22
max-line-length = 120
33
ignore = E731,W504
4-
exclude =
4+
exclude =
55
dist
66
docs
77
setup.py
8-
get-poetry.py
98
.tox
109
.git
1110
.eggs

.github/workflows/publish.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@v2
1212
- name: Set up Python
13-
uses: actions/setup-python@v2
13+
uses: actions/setup-python@v4
1414
with:
15-
python-version: '3.x'
15+
python-version: '3.10'
1616
- name: Install dependencies
1717
run: |
1818
python -m pip install --upgrade pip

.github/workflows/test.yml

+26-43
Original file line numberDiff line numberDiff line change
@@ -3,56 +3,39 @@ name: Test
33
on: [push]
44

55
jobs:
6-
7-
testing:
8-
6+
linting:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- uses: actions/setup-python@v4
11+
with:
12+
python-version: '3.10'
13+
- name: Install dependencies
14+
run: |
15+
python -m pip install --upgrade pip
16+
pip install tox
17+
- name: Lint
18+
run: tox -e flake8
19+
tests:
20+
needs: linting
921
runs-on: ubuntu-latest
10-
1122
strategy:
12-
max-parallel: 4
1323
matrix:
14-
python-version: ['2.7', '3.6', '3.7', '3.8', '3.9']
15-
24+
python-version: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10']
25+
env:
26+
PYTHON: ${{ matrix.python-version }}
1627
steps:
17-
- uses: actions/checkout@v2
18-
28+
- uses: actions/checkout@v3
1929
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v2
30+
id: setup-python
31+
uses: actions/setup-python@v4
2132
with:
2233
python-version: ${{ matrix.python-version }}
23-
24-
- name: Install poetry
25-
run: |
26-
curl -fsS -o get-poetry.py https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py
27-
python get-poetry.py -y
28-
29-
- name: Configure poetry
30-
run: |
31-
source $HOME/.poetry/env
32-
poetry config virtualenvs.in-project true
33-
34-
- name: Set up cache
35-
uses: actions/cache@v1
36-
id: cache
37-
with:
38-
path: .venv
39-
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
40-
41-
- name: Ensure cache is healthy
42-
if: steps.cache.outputs.cache-hit == 'true'
43-
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
44-
4534
- name: Install dependencies
4635
run: |
47-
source $HOME/.poetry/env
48-
poetry install
49-
50-
- name: Test with pytest
51-
run: |
52-
source $HOME/.poetry/env
53-
poetry run pytest -q tests
54-
55-
- name: Lint with flake8
36+
python -m pip install --upgrade pip
37+
pip install tox "coverage<5"
38+
- name: Run tests
5639
run: |
57-
source $HOME/.poetry/env
58-
poetry run flake8
40+
export TOXENV=$(echo "py${{ matrix.python-version }}" | sed 's/\.//g')
41+
tox -- -p no:warnings

.isort.cfg

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
[settings]
2-
line_length=120
3-
multi_line_output=0
4-
sections=FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,PGA,LOCALFOLDER
5-
default_section=THIRDPARTY
6-
known_pga=pganonymize
7-
no_lines_before=LOCALFOLDER
2+
combine_as_imports = true
3+
include_trailing_comma = true
4+
line_length = 120
5+
multi_line_output = 5
6+
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,PGA,LOCALFOLDER
7+
default_section = THIRDPARTY
8+
known_pga = pganonymize
9+
no_lines_before = LOCALFOLDER
810

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
## Development
44

5+
## 0.9.0 (2022-11-23)
6+
7+
* [#46](https://github.com/rheinwerk-verlag/pganonymize/pull/46): Broken Python 2.7 compatibility
8+
* [#45](https://github.com/rheinwerk-verlag/pganonymize/pull/45): Add partial masked provider ([Tilley](https://github.com/Tilley/))
9+
* [#44](https://github.com/rheinwerk-verlag/pganonymize/pull/44): Pass kwargs through to faker functions from schema ([Tilley](https://github.com/Tilley/))
10+
511
## 0.8.0 (2022-03-15)
612

713
* [#39](https://github.com/rheinwerk-verlag/pganonymize/issues/39): Renamed project to "pganonymize"

CONTRIBUTING.rst

+2-10
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,11 @@ version:
2222
$ git clone [email protected]:rheinwerk-verlag/postgresql-anonymizer.git
2323
$ cd postgresql-anonymizer
2424
25-
We are using `poetry`_ for development, you may need to install it first:
25+
For the development use a virtualenv or install the requirements directly:
2626

2727
.. code-block:: sh
2828
29-
$ sudo pip install poetry
30-
31-
Now you can install all development requirements and activate the virtualenv:
32-
33-
.. code-block:: sh
34-
35-
$ poetry install
36-
$ poetry shell
29+
$ sudo pip install -r requirements.txt
3730
3831
Coding style
3932
------------
@@ -54,7 +47,6 @@ Before creating a pull request make sure to check:
5447

5548
.. _issue: https://github.com/rheinwerk-verlag/postgresql-anonymizer/issues
5649
.. _new issue: https://github.com/rheinwerk-verlag/postgresql-anonymizer/issues/new
57-
.. _poetry: https://python-poetry.org/
5850
.. _EditorConfig: https://editorconfig.org/
5951
.. _tests: https://github.com/rheinwerk-verlag/postgresql-anonymizer/tree/development/tests
6052
.. _Sphinx documentation: https://github.com/rheinwerk-verlag/postgresql-anonymizer/tree/development/docs

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ clean-test: ## remove test and coverage artifacts
4343
rm -fr .tox/
4444

4545
flake8: ## run style checks and static analysis with flake8
46-
@poetry run flake8
46+
@flake8
4747

4848
release: clean ## package and upload a release
4949
python setup.py sdist upload
@@ -58,7 +58,7 @@ install: clean ## install the package to the active Python's site-packages
5858
python setup.py install
5959

6060
test:
61-
@poetry run pytest --cov=poetry --cov-config .coveragerc tests/ -sq
61+
@pytest
6262

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

README.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ anonymization. The tool requires a direct PostgreSQL connection to perform the a
1010

1111
|python| |license| |pypi| |downloads| |build| |health|
1212

13+
.. image:: docs/_static/demo.gif
14+
1315
.. contents::
1416

1517
Features
@@ -31,6 +33,8 @@ Features
3133
+----------------+----------------------+-------------------------+----------------------------------+
3234
| ``password`` | dsf82hFxcM | ``mask`` | XXXXXXXXXX |
3335
+----------------+----------------------+-------------------------+----------------------------------+
36+
| ``credit_card``| 1234-567-890 | ``partial_mask`` | 1??????????0 |
37+
+----------------+----------------------+-------------------------+----------------------------------+
3438
| ``email`` | [email protected] | ``md5`` | 0cba00ca3da1b283a57287bcceb17e35 |
3539
+----------------+----------------------+-------------------------+----------------------------------+
3640
| ``email`` | [email protected] | ``faker.unique.email`` | [email protected] |
@@ -156,7 +160,7 @@ After that you can pass a schema file to the container, using Docker volumes, an
156160
157161
158162
.. _uuid4: https://www.postgresql.org/docs/current/datatype-uuid.html
159-
.. _documentation: https://python-postgresql-anonymizer.readthedocs.io/en/latest/
163+
.. _documentation: https://pganonymize.readthedocs.io/en/latest/
160164
.. _schema documentation: https://python-postgresql-anonymizer.readthedocs.io/en/latest/schema.html
161165
.. _YAML sample schema: https://github.com/rheinwerk-verlag/pganonymize/blob/master/sample_schema.yml
162166

docs/_static/demo.gif

110 KB
Loading

docs/deploy.rst

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
Deploy
22
======
33

4-
To create a new release you will have to install ``twine`` first::
4+
A new release (PyPi package) will be created automatically if a tag was created using `Github actions`_. If the release
5+
has to be uploaded manually, you will have to install ``twine`` first:
6+
7+
.. code-block:: bash
58
69
$ pip install twine
710
8-
Then you have to create a new distribution file::
11+
Then you have to create a new distribution file:
12+
13+
.. code-block:: bash
914
1015
$ make dist
1116
12-
Finally you can upload the file to PyPi::
17+
Finally you can upload the file to PyPi:
18+
19+
.. code-block:: bash
1320
1421
$ twine upload dist/*
22+
23+
.. _Github actions: https://github.com/rheinwerk-verlag/pganonymize/actions

0 commit comments

Comments
 (0)