Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add circleci config and change the name of the package to avoid clashing #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
version: 2.1

orbs:
python: circleci/[email protected]
common: travelperk/[email protected]

workflows:
main:
jobs:
- test:
context: [aws, codeartifact]
- publish:
context: [aws, codeartifact]
requires:
- test
filters:
branches:
only:
- main

jobs:
test:
resource_class: small
docker:
- image: $AWS_ECR_ACCOUNT_URL_US/tk-python:v6.5-3.11.7
- name: postgres
image: postgres:14.10
command: -c fsync=off -c full_page_writes=off -c shared_buffers=1024MB -c autovacuum=off -c max_connections=200 -c max_locks_per_transaction=128
environment:
POSTGRES_PASSWORD: postgres
environment:
TEST_DB_HOST: postgres
TEST_DB_USER: postgres
TEST_DB_PASS: postgres
TEST_DB_NAME: postgres
steps:
- checkout
- run:
name: Install Python dependencies
command: "pip install tox==4.14.2"
- run:
name: Run tests
command: tox -e django-42

publish:
resource_class: small
docker:
- image: $AWS_ECR_ACCOUNT_URL_US/tk-python-ci:v6.5-3.11.7
steps:
- checkout
- run: python setup.py sdist bdist_wheel
- run: twine upload dist/* --skip-existing
4 changes: 3 additions & 1 deletion auditlog_tests/tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import datetime
import json
from unittest import mock

import django
from dateutil.tz import gettz
Expand Down Expand Up @@ -182,7 +183,8 @@ class MiddlewareTest(TestCase):
"""

def setUp(self):
self.middleware = AuditlogMiddleware()
self.get_response_mock = mock.Mock()
self.middleware = AuditlogMiddleware(get_response=self.get_response_mock)
self.factory = RequestFactory()
self.user = User.objects.create_user(
username="test", email="[email protected]", password="top_secret"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


setup(
name="django-auditlog",
name="tk-django-auditlog",
use_scm_version={"version_scheme": "post-release"},
setup_requires=["setuptools_scm"],
packages=[
Expand Down
6 changes: 4 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
{py36,py37,py38,py39}-django-{22,31,32}
{py36,py37,py38,py39,py311}-django-{22,31,32,42}
py38-docs
py38-qa

Expand All @@ -12,10 +12,11 @@ deps =
django-22: Django>=2.2,<2.3
django-31: Django>=3.1,<3.2
django-32: Django>=3.2,<3.3
django-42: Django>=4.2,<4.3
# Test requirements
coverage
codecov
psycopg2-binary>=2.8,<2.9
psycopg2-binary
passenv=
TEST_DB_HOST
TEST_DB_USER
Expand All @@ -28,6 +29,7 @@ basepython =
py38: python3.8
py37: python3.7
py36: python3.6
py311: python3.11

[testenv:py38-docs]
changedir = docs/source
Expand Down
Loading