Skip to content

Commit

Permalink
Merge pull request #249 from cordada/deploy/v0.7.0
Browse files Browse the repository at this point in the history
Deploy release v0.7.0
  • Loading branch information
fpinto-cdd authored Jul 26, 2023
2 parents cccf112 + 31b6aba commit 4eb7356
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.6.1
current_version = 0.7.0
commit = True
tag = False

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ jobs:

steps:
- name: Check Out VCS Repository
uses: actions/checkout@v3.3.0
uses: actions/checkout@v3.5.3

- name: Set Up Python ${{ matrix.python_version }}
uses: actions/setup-python@v4.5.0
uses: actions/setup-python@v4.7.0
with:
python-version: "${{ matrix.python_version }}"

Expand Down Expand Up @@ -93,10 +93,10 @@ jobs:

steps:
- name: Check Out VCS Repository
uses: actions/checkout@v3.3.0
uses: actions/checkout@v3.5.3

- name: Set Up Python ${{ matrix.python_version }}
uses: actions/setup-python@v4.5.0
uses: actions/setup-python@v4.7.0
with:
python-version: "${{ matrix.python_version }}"

Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
make test-coverage-report
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3.1.2
uses: codecov/codecov-action@v3.1.4
with:
directory: ./test-reports/coverage/
fail_ci_if_error: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dependency-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:

steps:
- name: Check Out VCS Repository
uses: actions/checkout@v3.3.0
uses: actions/checkout@v3.5.3

- name: Dependency Review
uses: actions/dependency-review-action@v3.0.4
uses: actions/dependency-review-action@v3.0.6
with:
fail-on-severity: critical
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ jobs:

steps:
- name: Check Out VCS Repository
uses: actions/checkout@v3.3.0
uses: actions/checkout@v3.5.3

- name: Set Up Python
id: set_up_python
uses: actions/setup-python@v4.5.0
uses: actions/setup-python@v4.7.0
with:
python-version: "3.10.9"

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ jobs:

steps:
- name: Check Out VCS Repository
uses: actions/checkout@v3.3.0
uses: actions/checkout@v3.5.3

- name: Set Up Python
id: set_up_python
uses: actions/setup-python@v4.5.0
uses: actions/setup-python@v4.7.0
with:
python-version: "3.10.9"

Expand Down
15 changes: 15 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ History
unreleased (YYYY-MM-DD)
+++++++++++++++++++++++

0.7.0 (2023-06-09)
++++++++++++++++++

- (PR #242, 2023-07-10) Add improved `__repr__()` to `User` model
- (PR #243, 2023-07-10) Fix broken Make task `docker-compose-run-test`
- (PR #241, 2023-07-10) chore: Bump codecov/codecov-action from 3.1.2 to 3.1.4
- (PR #244, 2023-07-14) chore: Bump actions/setup-python from 4.5.0 to 4.7.0
- (PR #231, 2023-07-14) chore(deps): Bump flake8 from 3.8.4 to 6.0.0
- (PR #240, 2023-07-14) chore: Bump actions/checkout from 3.3.0 to 3.5.3
- (PR #237, 2023-07-14) chore: Bump actions/dependency-review-action from 3.0.4 to 3.0.6
- (PR #235, 2023-07-14) chore(deps): Bump coverage from 7.2.1 to 7.2.7
- (PR #247, 2023-07-25) chore(deps): Bump mypy from 1.1.1 to 1.4.1
- (PR #246, 2023-07-25) chore(deps): Bump setuptools from 67.6.0 to 68.0.0
- (PR #245, 2023-07-25) chore(deps): Bump twine from 4.0.1 to 4.0.2

0.6.1 (2023-06-09)
++++++++++++++++++

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,6 @@ python-pip-install: ## Install Pip

docker-compose-run-test: export COMPOSE_FILE = docker-compose.yml:docker-compose.test.yml
docker-compose-run-test: ## Run tests with Docker Compose
docker-compose run --rm -- app-python3.8
docker-compose run --rm -- app-python3.9
docker-compose run --rm -- app-python3.10
docker compose run --rm --env TOXENV=py38 -- app-python3.8
docker compose run --rm --env TOXENV=py39 -- app-python3.9
docker compose run --rm --env TOXENV=py310 -- app-python3.10
1 change: 1 addition & 0 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
- DATABASE_USERNAME=${DATABASE_USERNAME:-app}
- PYTHONBREAKPOINT
- PYTHONDONTWRITEBYTECODE=true
- TOXENV
depends_on:
- db-test
volumes:
Expand Down
2 changes: 1 addition & 1 deletion fd_dj_accounts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"""


__version__ = '0.6.1'
__version__ = '0.7.0'


default_app_config = 'fd_dj_accounts.apps.AccountsAppConfig'
11 changes: 11 additions & 0 deletions fd_dj_accounts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class User(base_models.BaseUser):
- Override :meth:`save` to make sure full validation is performed before
each and every save (including creation).
- Custom model manager.
- Custom :meth:`__repr__` that includes the user’s ``id`` in addition to the username.
.. seealso:: :class:`AnonymousUser`.
Expand Down Expand Up @@ -146,6 +147,16 @@ class Meta:
verbose_name = 'user'
verbose_name_plural = 'users'

def __repr__(self) -> str:
# fmt: off
return (
f"<{self.__class__.__name__}("
f"id={self.id!r},"
f" {self.USERNAME_FIELD}={self.get_username()!r}"
f")>"
)
# fmt: on

def save(self, *args: Any, **kwargs: Any) -> None:
"""Call :meth:`full_clean` before saving."""
self.full_clean()
Expand Down
4 changes: 2 additions & 2 deletions requirements_release.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-r requirements.txt

bumpversion==0.5.3
setuptools==67.6.0
twine==4.0.1
setuptools==68.0.0
twine==4.0.2
wheel==0.40.0
6 changes: 3 additions & 3 deletions requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-r requirements.txt

coverage==7.2.1
flake8==3.8.4
mypy==1.1.1
coverage==7.2.7
flake8==6.0.0
mypy==1.4.1
psycopg2==2.9.3 --no-binary psycopg2
tox==3.26.0
15 changes: 15 additions & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from uuid import UUID

from django.test import SimpleTestCase, TestCase

from fd_dj_accounts.models import AnonymousUser, User, UserManager, get_or_create_system_user
Expand Down Expand Up @@ -83,6 +85,19 @@ def test_create_superuser_raises_error_on_false_is_staff(self): # type: ignore

class UserTestCase(TestCase):

def test_repr(self) -> None:
user = User(
id=UUID('12caf218-0001-45d4-b4df-44ff87f19989'),
email_address='user@example.com',
)
self.assertEqual(
repr(user),
"<User("
"id=UUID('12caf218-0001-45d4-b4df-44ff87f19989'),"
" email_address='user@example.com'"
")>"
)

def test_model_manager(self): # type: ignore
self.assertIsInstance(User.objects, UserManager)

Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ envlist =
[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/fd_dj_accounts
passenv =
DATABASE_*
commands = coverage run --rcfile=setup.cfg runtests.py tests
deps =
-r{toxinidir}/requirements_test.txt
Expand Down

0 comments on commit 4eb7356

Please sign in to comment.