Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
hkage committed Jul 18, 2024
2 parents 5fa9230 + 0130ab1 commit 96ebfa9
Show file tree
Hide file tree
Showing 31 changed files with 517 additions and 368 deletions.
35 changes: 19 additions & 16 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,24 @@ on:

jobs:
publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: production
url: https://pypi.org/project/pganonymize/
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Build
run: python setup.py sdist bdist_wheel
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
78 changes: 43 additions & 35 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,57 @@ name: Test
on: [push]

jobs:
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:
matrix:
python-version: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10']
env:
PYTHON: ${{ matrix.python-version }}
image:
- 'python:2.7-buster'
- 'python:3.6-bullseye'
- 'python:3.7-bookworm'
- 'python:3.8-bookworm'
- 'python:3.9-bookworm'
- 'python:3.10-bookworm'
- 'python:3.11-bookworm'
- 'python:3.12-bookworm'
container:
image: ${{ matrix.image }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- uses: actions/checkout@v4
- name: Set environment variables
run: |
python -m pip install --upgrade pip
pip install --use-pep517 tox "coverage<5"
- name: Run tests
echo "PYTHON=$(echo '${{ matrix.image }}' | sed -r 's/^python:([0-9]+)\.([0-9]+).*$/\1.\2/g')" >> $GITHUB_ENV
echo "TOXFACTOR=$(echo '${{ matrix.image }}' | sed -r 's/^python:([0-9]+)\.([0-9]+).*$/py\1\2/g')" >> $GITHUB_ENV
- name: Install psycopg2 requirements
run: |
export TOXENV=$(echo "py${{ matrix.python-version }}" | sed 's/\.//g')
tox -- -p no:warnings
apt update
apt-get -y install python-dev
if: matrix.image == 'python:2.7-buster'
- name: Install psycopg2 requirements
run: |
apt update
apt-get -y install python3-dev
if: matrix.image != 'python:2.7-buster'
- name: Install importlib-metadata for older Python versions
run: pip install "importlib-metadata<3"
if: >-
matrix.image == 'python:2.7-buster' ||
matrix.image == 'python:3.6-bullseye' ||
matrix.image == 'python:3.7-bookworm'
- name: Install test utilities
run: pip install "tox<4" tox-factor "coverage<5"
- name: Lint with flake8
run: tox -e flake8
if: matrix.image == 'python:3.12-bookworm'
- name: Test via tox
run: tox -- -p no:warnings
- name: Generate coverage report
run: coverage html
run: coverage xml
if: ${{ success() }}
- name: Upload coverage data
uses: actions/upload-artifact@v3
- name: Upload coverage report
uses: codecov/codecov-action@v4
with:
name: coverage
path: htmlcov
if-no-files-found: ignore
files: coverage.xml
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}
if: ${{ success() }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ coverage.xml

# Sphinx documentation
docs/_build/
docs/_api

# PyBuilder
target/

# IDEs
.idea/
.vscode/
.vscode/
118 changes: 118 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Changelog

## Development

## 0.12.0 (2024-07-18)

* [#64 Fix typos](https://github.com/rheinwerk-verlag/pganonymize/pull/64) ([kianmeng](https://github.com/kianmeng))
* [#62 Allow to configure parallel option](https://github.com/rheinwerk-verlag/pganonymize/pull/62) ([fblackburn1](https://github.com/fblackburn1))
* [#58 Support pg dump password](https://github.com/rheinwerk-verlag/pganonymize/pull/58) ([fblackburn1](https://github.com/fblackburn1))
* [#53 Python 2.7 tests are failing](https://github.com/rheinwerk-verlag/pganonymize/issues/53)
* [#56 Add Trusted Publisher Management workflow](https://github.com/rheinwerk-verlag/pganonymize/issues/56)

## 0.11.0 (2024-02-29)

* [#52 Add update_json provider](https://github.com/rheinwerk-verlag/pganonymize/pull/52) ([bobslee](https://github.com/bobslee))

## 0.10.0 (2022-11-29)

* [#49 Configure psycopg2 to support UUID objects](https://github.com/rheinwerk-verlag/pganonymize/pull/49)
* [#48 Add support for localized "Faker" data](https://github.com/rheinwerk-verlag/pganonymize/pull/48)

## 0.9.0 (2022-11-23)

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

## 0.8.0 (2022-03-15)

* [#39 Renamed project to "pganonymize"](https://github.com/rheinwerk-verlag/pganonymize/issues/39)
* [#38 Allow environment variables in schema definition](https://github.com/rheinwerk-verlag/pganonymize/pull/38) ([nurikk](https://github.com/nurikk))

## 0.7.0 (2021-11-30)

* [#34 Subprocess "run" being used on Python2.7](https://github.com/rheinwerk-verlag/pganonymize/issues/34)
* [#35 parmap no longer supports Python 2.7](https://github.com/rheinwerk-verlag/pganonymize/issues/35)
* Dropped Python 3.5 support
* Pinned libraries Python 2.7
* [#32 Fixed pg_dump arguments](https://github.com/rheinwerk-verlag/pganonymize/pull/32) ([korsar182](https://github.com/korsar182))
* Simplified provider registration (no metaclass usage anymore)

## 0.6.1 (2021-07-13)

* Added missing dependencies for the `setup.py`

## 0.6.0 (2021-07-13)

* [#28 Add json support](https://github.com/rheinwerk-verlag/pganonymize/pull/25) ([nurikk](https://github.com/nurikk))
* [#27 Better anonymisation](https://github.com/rheinwerk-verlag/pganonymize/pull/25) ([nurikk](https://github.com/nurikk))
* [#25 Remove column specification for `cursor.copy_from` call](https://github.com/rheinwerk-verlag/pganonymize/pull/25) ([nurikk](https://github.com/nurikk))

## 0.5.0 (2021-06-30)

* [#22 Fix table and column name quotes in `cursor.copy_from` call](https://github.com/rheinwerk-verlag/pganonymize/pull/22) ([nurikk](https://github.com/nurikk))
* [#23 Allow uniq faker](https://github.com/rheinwerk-verlag/pganonymize/pull/23) ([nurikk](https://github.com/nurikk))

## 0.4.1 (2021-05-27)

* [#19 Make chunk size in the table definition dynamic](https://github.com/rheinwerk-verlag/pganonymize/pull/19) ([halilkaya](https://github.com/halilkaya))

## 0.4.0 (2021-05-05)

* [#18 Specify (SQL WHERE) search_condition, to filter the table for rows to be anonymized](https://github.com/rheinwerk-verlag/pganonymize/pull/18) (`bobslee <https://github.com/bobslee>`_)
* [#17 Fix anonymizing error if there is a JSONB column in a table](https://github.com/rheinwerk-verlag/pganonymize/pull/17) ([koptelovav](https://github.com/koptelovav))

## 0.3.3 (2021-04-16)

* [#16 Preserve column and table cases during the copy process](https://github.com/rheinwerk-verlag/pganonymize/issues/16)

## 0.3.2 (2021-01-25)

* [#15 Fix for exclude bug](https://github.com/rheinwerk-verlag/pganonymize/pull/15) ([abhinavvaidya90](https://github.com/abhinavvaidya90))

## 0.3.1 (2020-12-04)

* [#13 Fixed a syntax error if no truncated tables are defined](https://github.com/rheinwerk-verlag/pganonymize/pull/13) ([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
* 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

## 0.2.3 (2020-01-02)

* Fixed the wrong cStringIO import for Python 3
* Removed Travis-CI file in favor of the Github actions

## 0.2.2 (2020-01-02)

* Hide the progressbar completely if verbose is set to ``False``
* Restructured the requirement files and added flake8 to Travis CI

## 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 exclusion affects the whole row,
not just one single column.

## 0.2.0 (2019-12-20)

* Added provider classes
* Added new providers:
* choice - returns a random list element
* mask - replaces the original value with a static sign

## 0.1.1 (2019-12-18)

Changed setup.py

## 0.1.0 (2019-12-16)

Initial release of the prototype
Loading

0 comments on commit 96ebfa9

Please sign in to comment.