Skip to content

Commit

Permalink
Django 5.1 compatibilty, and Dropped Django 3.2 / Postgres 12 support (
Browse files Browse the repository at this point in the history
…#10)

* Initialize template from version 80d7f1ffae8953435935d7f1ef7d1e526a4be755

* Update template to version 2794ea47b0220081dc869d01199ee490dda00762

* Lock reqs

* Update version and release notes

* Update author
  • Loading branch information
wesleykendall authored Aug 25, 2024
1 parent 0824e46 commit dda3810
Show file tree
Hide file tree
Showing 22 changed files with 304 additions and 768 deletions.
43 changes: 21 additions & 22 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ orbs:
docker:
- image: opus10/circleci-python-library:2024-04-17
environment:
# Ensure makefile commands are not wrapped in "docker-compose run"
# Ensure makefile commands are not wrapped in "docker compose run"
EXEC_WRAPPER: ''
TOX_PARALLEL_NO_SPINNER: 1
DATABASE_URL: postgres://root@localhost/circle_test?sslmode=disable
- image: cimg/postgres:<<parameters.pg_version>>
environment:
Expand Down Expand Up @@ -40,14 +39,14 @@ jobs:
test_pg_min:
executor:
name: opus10/python
pg_version: "12.15"
pg_version: "13.16"
steps:
- opus10/test

test_pg_max:
executor:
name: opus10/python
pg_version: "16.0"
pg_version: "16.4"
steps:
- opus10/test

Expand All @@ -69,16 +68,6 @@ jobs:
- run: make dependencies
- run: make type-check || true

check_changelog:
executor: opus10/python
steps:
- checkout
- restore_cache:
key: v4-{{ checksum "poetry.lock" }}
- run: make dependencies
- run: git tidy-log origin/main..
- run: make tidy-lint

deploy:
executor: opus10/python
steps:
Expand All @@ -94,14 +83,22 @@ workflows:
version: 2
on_commit:
jobs:
- test_pg_min
- test_pg_max
- lint
- type_check
- check_changelog:
- test_pg_min:
filters:
branches:
ignore: main
tags:
only: /.*/
- test_pg_max:
filters:
tags:
only: /.*/
- lint:
filters:
tags:
only: /.*/
- type_check:
filters:
tags:
only: /.*/
- deploy:
context: python-library
requires:
Expand All @@ -111,4 +108,6 @@ workflows:
- type_check
filters:
branches:
only: main
ignore: /.*/
tags:
only: /.*/
15 changes: 0 additions & 15 deletions .git-tidy/commit.tpl

This file was deleted.

22 changes: 0 additions & 22 deletions .git-tidy/commit.yaml

This file was deleted.

28 changes: 0 additions & 28 deletions .git-tidy/log.tpl

This file was deleted.

11 changes: 0 additions & 11 deletions .gitcommit.tpl

This file was deleted.

22 changes: 14 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
# Changelog

## 1.5.0 (2024-08-24)

#### Changes

- Django 5.1 compatibilty, and Dropped Django 3.2 / Postgres 12 support by [@wesleykendall](https://github.com/wesleykendall) in [#10](https://github.com/Opus10/django-pgactivity/pull/10).

## 1.4.1 (2024-04-06)

### Trivial
#### Trivial

- Fix ReadTheDocs builds. [Wesley Kendall, 8b3c49e]

## 1.4.0 (2023-11-26)

### Feature
#### Feature

- Django 5.0 compatibility [Wesley Kendall, 12efd20]

Support and test against Django 5 with psycopg2 and psycopg3.

## 1.3.1 (2023-10-09)

### Trivial
#### Trivial

- Added Opus10 branding to docs [Wesley Kendall, 877178b]

## 1.3.0 (2023-10-08)

### Feature
#### Feature

- Add Python 3.12 support and use Mkdocs for documentation [Wesley Kendall, ec98a78]

Expand All @@ -32,21 +38,21 @@

## 1.2.0 (2023-06-08)

### Feature
#### Feature

- Added Python 3.11, Django 4.2, and Psycopg 3 support [Wesley Kendall, 72af215]

Adds Python 3.11, Django 4.2, and Psycopg 3 support along with tests for multiple Postgres versions. Drops support for Django 2.2.

## 1.1.1 (2022-10-25)

### Trivial
#### Trivial

- Use ``None`` to reset ``pgactivity.timeout``. [Wesley Kendall, fcabcb7]

## 1.1.0 (2022-10-24)

### Feature
#### Feature

- Simplify management command and nest ``pgactivity.timeout``. [Wesley Kendall, b7d359d]

Expand All @@ -57,7 +63,7 @@

## 1.0.0 (2022-10-18)

### Api-Break
#### Api-Break

- Initial release of ``django-pgactivity`` [Wesley Kendall, 593bda7]

Expand Down
26 changes: 1 addition & 25 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,6 @@ If your code fails the linter checks, fix common errors with:

make lint-fix

## Committing

This project uses [git-tidy](https://github.com/Opus10/git-tidy) to produce structured commits with git trailers. Information from commit messages is used to generate release notes and bump the version properly.

To do a structured commit with `git-tidy`, do:

make tidy-commit

All commits in a pull request must be tidy commits that encapsulate a change. Ideally entire features or bug fixes are encapsulated in a single commit. Squash all of your commits into a tidy commit with:

make tidy-squash

To check if your commits pass linting, do:

make tidy-lint

Note, the above command lints every commit since branching from main. You can also run `make shell` and run `git tidy` commands inside the docker environment to do other flavors of `git tidy` commands.

## Documentation

[Mkdocs Material](https://squidfunk.github.io/mkdocs-material/) documentation can be built with:
Expand All @@ -62,10 +44,4 @@ A shortcut for serving them is:

## Releases and Versioning

Anything that is merged into the main branch will be automatically deployed to PyPI. Documentation will be published to a ReadTheDocs at `https://django-pgactivity.readthedocs.io/`.

The following files will be generated and should *not* be edited by a user:

- `CHANGELOG.md` - Contains an automatically-generated change log for each release.

This project uses [Semantic Versioning](http://semver.org) by analyzing `Type:` trailers on git commit messages (trailers are added when using `git tidy-commit`). In order to bump the minor version, use "feature" or "bug" as the type. In order to bump the major version, use "api-break". The patch version will be updated automatically if none of these tags are present.
The version number and release notes are manually updated by the maintainer during the release process. Do not edit these.
37 changes: 7 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ else ifeq (${OS}, Darwin)
endif

# Docker run mounts the local code directory, SSH (for git), and global git config information
DOCKER_RUN_CMD?=$(DOCKER_CMD)-compose run --name $(PACKAGE_NAME) $(DOCKER_RUN_ARGS) -d app
DOCKER_RUN_CMD?=$(DOCKER_CMD) compose run --name $(PACKAGE_NAME) $(DOCKER_RUN_ARGS) -d app

# Print usage of main targets when user types "make" or "make help"
.PHONY: help
Expand Down Expand Up @@ -66,14 +66,15 @@ endif
# Pull the latest container and start a detached run
.PHONY: docker-start
docker-start:
$(DOCKER_CMD)-compose pull
$(DOCKER_CMD) compose pull
$(DOCKER_RUN_CMD)


# Lock dependencies
.PHONY: lock
lock:
$(EXEC_WRAPPER) poetry lock --no-update
$(EXEC_WRAPPER) poetry export --with dev --without-hashes -f requirements.txt > docs/requirements.txt


# Install dependencies
Expand All @@ -82,13 +83,6 @@ dependencies:
$(EXEC_WRAPPER) poetry install --no-ansi


# Set up git configuration
.PHONY: git-setup
git-setup:
$(EXEC_WRAPPER) git tidy --template -o .gitcommit.tpl
$(EXEC_WRAPPER) git config --local commit.template .gitcommit.tpl


# Sets up the local database
.PHONY: db-setup
db-setup:
Expand All @@ -109,18 +103,18 @@ conda-create:
# Sets up a Conda development environment
.PHONY: conda-setup
conda-setup: EXEC_WRAPPER=conda run -n ${PACKAGE_NAME} --no-capture-output
conda-setup: conda-create lock dependencies git-setup db-setup
conda-setup: conda-create lock dependencies db-setup


# Sets up a Docker development environment
.PHONY: docker-setup
docker-setup: docker-teardown docker-start lock dependencies git-setup
docker-setup: docker-teardown docker-start lock dependencies


# Spin down docker resources
.PHONY: docker-teardown
docker-teardown:
$(DOCKER_CMD)-compose down --remove-orphans
$(DOCKER_CMD) compose down --remove-orphans


# Run a shell
Expand Down Expand Up @@ -159,6 +153,7 @@ lint:
$(EXEC_WRAPPER) ruff format . --check
$(EXEC_WRAPPER) ruff check ${MODULE_NAME}
$(EXEC_WRAPPER) bash -c 'make docs'
$(EXEC_WRAPPER) diff <(poetry export --with dev --without-hashes -f requirements.txt) docs/requirements.txt >/dev/null 2>&1 || exit 1


# Fix common linting errors
Expand All @@ -172,21 +167,3 @@ lint-fix:
.PHONY: type-check
type-check:
$(EXEC_WRAPPER) pyright $(MODULE_NAME)


# Lint commit messages
.PHONY: tidy-lint
tidy-lint:
$(EXEC_WRAPPER) git tidy-lint origin/main..


# Perform a tidy commit
.PHONY: tidy-commit
tidy-commit:
$(EXEC_WRAPPER) git tidy-commit


# Perform a tidy squash
.PHONY: tidy-squash
tidy-squash:
$(EXEC_WRAPPER) git tidy-squash origin/main
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def my_operation():

## Compatibility

`django-pgactivity` is compatible with Python 3.8 - 3.12, Django 3.2 - 5.0, Psycopg 2 - 3, and Postgres 12 - 16.
`django-pgactivity` is compatible with Python 3.8 - 3.12, Django 4.2 - 5.1, Psycopg 2 - 3, and Postgres 13 - 16.

## Documentation

Expand Down
Loading

0 comments on commit dda3810

Please sign in to comment.