Skip to content

Commit

Permalink
Merge branch 'release/8.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
marteinn committed Dec 30, 2023
2 parents e417bc3 + 0e153f8 commit 60cd4ef
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 22 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
django: ["3.2", "4.0", "4.1"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
django: ["3.2", "4.2.8", "5.0"]
exclude:
- python-version: "3.7"
django: "4.0"
- python-version: "3.7"
django: "4.1"
- python-version: "3.12"
django: "3.2"
- python-version: "3.8"
django: "5.0"
- python-version: "3.9"
django: "5.0"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -54,6 +56,20 @@ jobs:
pip install isort
isort . --check-only
lint-ruff:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
ruff .
publish:
runs-on: ubuntu-latest
needs: [test, lint-black, lint-isort]
Expand Down
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,29 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
### Changed
### Fixed
### Removed

## [8.0.0] - 2023-12-30

### Added
- Add support for python 3.12 (@marteinn)
- Add support for django 4.2 (@marteinn)
- Add support for django 5.0 (@marteinn)

### Fixed
- Add pyproject.toml
- Add ruff linter
- Upgrade python version to 3.12 in example
- Fix install issue with netcat in example

### Removed
- Drop support for django 4.0
- Drop support for django 4.1 (@marteinn)
- Drop support for python 3.7 (@marteinn)

## [7.0.1] - 2023-01-07

### Added
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015-2023 Fröjd Interactive
Copyright (c) 2015-2024 Fröjd Interactive

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions django_react_templatetags/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"""

__title__ = "django_react_templatetags"
__version__ = "7.0.1"
__build__ = 701
__version__ = "8.0.0"
__build__ = 702
__author__ = "Martin Sandström"
__license__ = "MIT"
__copyright__ = "Copyright 2015-2022 Fröjd Interactive"
__copyright__ = "Copyright 2015-2024 Fröjd Interactive"
6 changes: 3 additions & 3 deletions django_react_templatetags/tests/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_multiple_tags(self):
).render(self.mocked_context)

self.assertTrue('<div id="Component_' in out)
self.assertEquals(len(self.mocked_context.get("REACT_COMPONENTS")), 2)
self.assertEqual(len(self.mocked_context.get("REACT_COMPONENTS")), 2)

def test_component_name_from_variable(self):
"The react_render inserts with a component id as a variable"
Expand Down Expand Up @@ -80,7 +80,7 @@ def test_print_tag(self):

self.assertTrue("ReactDOM.render(" in out)
self.assertTrue("React.createElement(Component" in out)
self.assertEquals(len(self.mocked_context.get("REACT_COMPONENTS")), 0)
self.assertEqual(len(self.mocked_context.get("REACT_COMPONENTS")), 0)

@override_settings(REACT_COMPONENT_PREFIX="ReactNamespace.")
def test_print_tag_prefix(self):
Expand Down Expand Up @@ -165,7 +165,7 @@ class NoRepresentation(object):
self.mocked_context["component_data"] = instance

with self.assertRaises(TypeError) as err:
out = Template(
Template(
"{% load react %}"
'{% react_render component="Component" data=component_data %}'
"{% react_print %}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ class MyObj(RepresentationMixin, object):
with self.assertRaises(NotImplementedError) as err:
instance.to_react_representation()

self.assertEquals(
self.assertEqual(
str(err.exception), "Missing property to_react_representation in class"
)
4 changes: 2 additions & 2 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

### Requirements

- Python 3.7+
- Django 3.2+
- Python 3.8+
- Django 3.2, 5.0 and 4.2


### Installation
Expand Down
4 changes: 2 additions & 2 deletions example_django_react_templatetags/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM python:3.8-slim
FROM python:3.12-slim
MAINTAINER Frojd

ENV PYTHONUNBUFFERED=1 \
REQUIREMENTS=requirements.txt

RUN apt-get update \
&& apt-get install -y netcat gcc libpq-dev \
&& apt-get install -y netcat-traditional gcc libpq-dev \
&& apt-get install -y binutils libproj-dev \
&& apt-get install -y gettext \
&& rm -rf /var/lib/apt/lists/*
Expand Down
26 changes: 26 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[tool.ruff]
line-length = 88

# Never enforce `E501` (line length violations).
ignore = ["E501"]

exclude = [
"venv",
"*/migrations/*",
]

[tool.black]
exclude = '''
/(
\.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
| migrations
)/
'''
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.0",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Topic :: Utilities",
"Programming Language :: JavaScript",
],
Expand Down

0 comments on commit 60cd4ef

Please sign in to comment.