Skip to content

Commit c227fd8

Browse files
committed
Merge branch 'chore/modernize' into 'master'
Modernize the tooling, add tests See merge request internal/django-birdbath!13
2 parents bc2cc58 + 7f6565a commit c227fd8

18 files changed

+253
-62
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ venv/
2222
.envrc
2323
build
2424
dist
25+
*.egg-info/

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
default_language_version:
2+
python: python3
3+
repos:
4+
- repo: https://github.com/astral-sh/ruff-pre-commit
5+
rev: 'v0.6.9'
6+
hooks:
7+
- id: ruff
8+
args: [--fix, --exit-non-zero-on-fix]
9+
- id: ruff-format

LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2024, Torchbox Ltd.
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
3. Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

MANIFEST.in

Lines changed: 0 additions & 5 deletions
This file was deleted.

Makefile

Lines changed: 0 additions & 13 deletions
This file was deleted.

birdbath/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1+
"""
2+
A simple tool for giving Django database data a good wash. Anonymise user data, delete stuff you
3+
don't need in your development environment, or whatever it is you need to do.
4+
"""
5+
6+
__version__ = "2.0.0"
7+
18
default_app_config = "birdbath.apps.BirdBathConfig"

birdbath/management/commands/run_birdbath.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def handle(self, *args, **options):
4242
processor = import_string(processor_path)()
4343
try:
4444
processor.run()
45-
except Exception as e:
45+
except Exception as e: # noqa: BLE001
4646
errors.append(e)
4747

4848
if errors:

birdbath/processors/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from django.db import models
44
from django.utils.crypto import get_random_string
55
from django.utils.functional import cached_property
6-
76
from faker import Faker
87

98
LOWERCASE_STRING = "".join(string.ascii_lowercase)

pyproject.toml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
[build-system]
2+
requires = ["flit_core >=3.2,<4"]
3+
build-backend = "flit_core.buildapi"
4+
5+
[project]
6+
name = "django-birdbath"
7+
authors = [{name = "Torchbox", email = "[email protected]"}]
8+
dynamic = ["version", "description"]
9+
readme = "README.md"
10+
license = {file = "LICENSE"}
11+
classifiers = [
12+
"License :: OSI Approved :: BSD License",
13+
"Programming Language :: Python :: 3",
14+
"Programming Language :: Python :: 3.9",
15+
"Programming Language :: Python :: 3.10",
16+
"Programming Language :: Python :: 3.11",
17+
"Programming Language :: Python :: 3.12",
18+
]
19+
keywords = ["django", "anonymization", "data cleaning"]
20+
dependencies = [
21+
"Faker >=8",
22+
]
23+
requires-python = ">=3.9"
24+
25+
[project.urls]
26+
Home = "https://git.torchbox.com/internal/django-birdbath"
27+
28+
[project.optional-dependencies]
29+
dev = [
30+
"django~=4.2",
31+
"pre-commit>=3.8.0",
32+
"pytest~=8.3",
33+
"pytest-django~=4.9",
34+
"ruff==0.6.9",
35+
"wagtail~=5.2",
36+
]
37+
38+
[tool.flit.module]
39+
name = "birdbath"
40+
41+
[tool.flit.sdist]
42+
include = ["LICENSE", "CHANGELOG.md", "README.md"]
43+
44+
[tool.ruff]
45+
target-version = "py39"
46+
47+
exclude = [
48+
".github",
49+
]
50+
51+
# E501: Line too long
52+
lint.ignore = ["E501"]
53+
54+
lint.select = [
55+
"E", # pycodestyle errors
56+
"F", # pyflakes
57+
"I", # isort
58+
"T20", # flake8-print
59+
"BLE", # flake8-blind-except
60+
"C4", # flake8-comprehensions
61+
"UP", # pyupgrade
62+
]

setup.cfg

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)