Skip to content

Commit ffce153

Browse files
authored
Merge pull request #110 from un1t/feature/9.0
Feature 9.0
2 parents eee7785 + f4b476e commit ffce153

22 files changed

+227
-308
lines changed

.github/workflows/lockThreads.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: 'Lock Threads'
22

33
on:
44
schedule:
5-
- cron: '0 0 * * *'
5+
- cron: '25 4 * * *'
66
workflow_dispatch:
77

88
permissions:
@@ -16,7 +16,7 @@ jobs:
1616
action:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: dessant/lock-threads@v3
19+
- uses: dessant/lock-threads@v5
2020
with:
2121
issue-inactive-days: '30'
2222
issue-comment: >

.github/workflows/main.yml

Lines changed: 16 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -7,64 +7,21 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
build:
11-
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
12-
strategy:
13-
matrix:
14-
include:
15-
- python: "3.6"
16-
toxenv: py36-django32
17-
os: ubuntu-20.04
18-
- python: "3.7"
19-
toxenv: py37-django32
20-
- python: "3.8"
21-
toxenv: py38-django32
22-
- python: "3.9"
23-
toxenv: py39-django32
24-
- python: "3.10"
25-
toxenv: py310-django32
26-
- python: "pypy-3.10"
27-
toxenv: pypy3-django32
28-
29-
- python: "3.8"
30-
toxenv: py38-django41
31-
- python: "3.9"
32-
toxenv: py39-django41
33-
- python: "3.10"
34-
toxenv: py310-django41
35-
- python: "3.11"
36-
toxenv: py311-django41
37-
- python: "pypy-3.10"
38-
toxenv: pypy3-django41
39-
40-
- python: "3.8"
41-
toxenv: py38-django42
42-
- python: "3.9"
43-
toxenv: py39-django42
44-
- python: "3.10"
45-
toxenv: py310-django42
46-
- python: "3.11"
47-
toxenv: py311-django42
48-
- python: "pypy-3.10"
49-
toxenv: pypy3-django42
50-
51-
- python: "3.10"
52-
toxenv: py310-django50
53-
- python: "3.11"
54-
toxenv: py311-django50
55-
- python: "3.12"
56-
toxenv: py312-django50
57-
- python: "pypy-3.10"
58-
toxenv: pypy3-django50
10+
test:
11+
runs-on: ubuntu-latest
5912
steps:
60-
- uses: actions/checkout@v2
61-
- name: Setup Python
62-
uses: actions/setup-python@v2
13+
- uses: actions/checkout@v4
14+
- name: Setup python
15+
uses: actions/setup-python@v5
6316
with:
64-
python-version: ${{ matrix.python }}
65-
- name: Install Test Framework
66-
run: pip install tox-gh-actions
67-
- name: Run Tests
68-
env:
69-
TOXENV: ${{ matrix.toxenv }}
70-
run: tox # setting TOXENV is equivalent to calling `tox -e [ENV]`
17+
python-version: |
18+
3.8
19+
3.9
20+
3.10
21+
pypy-3.10
22+
3.11
23+
3.12
24+
- name: Install test framework
25+
run: pip install tox
26+
- name: Run tests
27+
run: tox r

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ env/*
1212
.vscode/*
1313
README.html
1414
*.txt
15+
.venv/*

.isort.cfg

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

CHANGELOG.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
## [9.0.0] - 2024-09-18
9+
## Added
10+
- pyproject.toml
11+
- Documentation on how to use transaction test case when using pytest. PR [#108] from [@pavel-kalmykov](https://github.com/pavel-kalmykov).
12+
13+
### Changed
14+
- Update to remove specific version references, since there haven't been significant changes the approach on versioning will change. The version will no longer update when only tests or supported versions are updated.
15+
- Updated lock thread version and update job to not run at contested times to avoid github rate limiting errors.
16+
- Updated ci build action versions.
17+
- Move isort and pytest settings to toml file.
18+
- Simplify tox.ini and github actions CI job.
19+
- Update a getattr call to remove unnecessary default of None so it will fail on an attribute error.
20+
- Change from .format() to f-strings.
21+
22+
### Removed
23+
- Removed setup.py/setup.cfg
24+
825
## [8.1.0] - 2024-01-28
926
### Added
1027
- Run tests for django 5.0 and python 3.12.
@@ -93,7 +110,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
93110
## [0.1.4] - 2012-08-16
94111
## [0.1.0] - 2012-08-14
95112

96-
[Unreleased]: https://github.com/un1t/django-cleanup/compare/8.1.0...HEAD
113+
[Unreleased]: https://github.com/un1t/django-cleanup/compare/9.0.0...HEAD
114+
[9.0.0]: https://github.com/un1t/django-cleanup/compare/8.1.0...9.0.0
97115
[8.1.0]: https://github.com/un1t/django-cleanup/compare/8.0.0...8.1.0
98116
[8.0.0]: https://github.com/un1t/django-cleanup/compare/7.0.0...8.0.0
99117
[7.0.0]: https://github.com/un1t/django-cleanup/compare/6.0.0...7.0.0
@@ -131,6 +149,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
131149
[0.1.4]: https://github.com/un1t/django-cleanup/compare/0.1.0...0.1.4
132150
[0.1.0]: https://github.com/un1t/django-cleanup/releases/tag/0.1.0
133151

152+
[#108]: https://github.com/un1t/django-cleanup/pull/108
134153
[#100]: https://github.com/un1t/django-cleanup/pull/100
135154
[#98]: https://github.com/un1t/django-cleanup/issues/98
136155
[#96]: https://github.com/un1t/django-cleanup/issues/96

MANIFEST.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
include README.rst
2-
include LICENSE
31
include CHANGELOG.md

README.rst

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ is set as the :code:`FileField`'s default value will not be deleted.
1111

1212
Compatibility
1313
-------------
14-
- Django 3.2, 4.1, 4.2, 5.0 (`See Django Supported Versions <https://www.djangoproject.com/download/#supported-versions>`_)
15-
- Python 3.6+
14+
- This app follows Django's `supported versions`_ and `Python version support`_.
1615
- Compatible with `sorl-thumbnail <https://github.com/jazzband/sorl-thumbnail>`_
1716
- Compatible with `easy-thumbnail <https://github.com/SmileyChris/easy-thumbnails>`_
1817

@@ -164,10 +163,10 @@ Install, setup and use pyenv_ to install all the required versions of cPython
164163
(see the `tox.ini <https://github.com/un1t/django-cleanup/blob/master/tox.ini>`_).
165164

166165
Setup pyenv_ to have all versions of python activated within your local django-cleanup repository.
167-
Ensuring that the python 3.12 that was installed is first priority.
166+
Ensuring that the latest supported python version that was installed is first priority.
168167

169-
Install tox_ on python 3.12 and run the :code:`tox` command from your local django-cleanup
170-
repository.
168+
Install tox_ on the latest supported python version and run the :code:`tox` command from your local
169+
django-cleanup repository.
171170

172171
How to write tests
173172
==================
@@ -181,6 +180,12 @@ For details on why this is required see `here
181180
actually committed, thus your :code:`on_commit()` callbacks will never be run. If you need to
182181
test the results of an :code:`on_commit()` callback, use a :code:`TransactionTestCase` instead.
183182

183+
pytest
184+
------
185+
When writing tests with pytest_ use `@pytest.mark.django_db(transaction=True)`_ with the
186+
:code:`transaction` argument set to :code:`True` to ensure that the behavior will be the same as
187+
using a transaction test case.
188+
184189
License
185190
=======
186191
django-cleanup is free software under terms of the:
@@ -209,8 +214,12 @@ SOFTWARE.
209214

210215

211216
.. _django.test.TransactionTestCase: https://docs.djangoproject.com/en/stable/topics/testing/tools/#django.test.TransactionTestCase
217+
.. _pytest: https://docs.pytest.org
212218
.. _pyenv: https://github.com/pyenv/pyenv
213219
.. _tox: https://tox.readthedocs.io/en/latest/
220+
.. _supported versions: https://www.djangoproject.com/download/#supported-versions
221+
.. _Python version support: https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django
222+
.. _@pytest.mark.django_db(transaction=True): https://pytest-django.readthedocs.io/en/latest/helpers.html#pytest.mark.django_db
214223

215224
.. |Version| image:: https://img.shields.io/pypi/v/django-cleanup.svg
216225
:target: https://pypi.python.org/pypi/django-cleanup/

pyproject.toml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name='django-cleanup'
7+
authors = [
8+
{name = "Ilya Shalyapin", email = "[email protected]"}
9+
]
10+
description = "Deletes old files."
11+
readme = "README.rst"
12+
keywords = ["django"]
13+
classifiers = [
14+
'Development Status :: 5 - Production/Stable',
15+
'Environment :: Web Environment',
16+
'Framework :: Django',
17+
'Intended Audience :: Developers',
18+
'License :: OSI Approved :: MIT License',
19+
'Operating System :: OS Independent',
20+
'Programming Language :: Python',
21+
'Programming Language :: Python :: Implementation :: CPython',
22+
'Programming Language :: Python :: Implementation :: PyPy',
23+
'Topic :: Utilities'
24+
]
25+
requires-python = ">=3.8"
26+
dynamic = ["version"]
27+
28+
[project.urls]
29+
Homepage = "https://github.com/un1t/django-cleanup"
30+
Changelog = "https://github.com/un1t/django-cleanup/blob/master/CHANGELOG.md"
31+
32+
[tool.setuptools.dynamic]
33+
version = {attr = "django_cleanup.__version__"}
34+
35+
[tool.isort]
36+
sections = ["FUTURE", "STDLIB", "DJANGO", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
37+
line_length = 100
38+
default_section = "THIRDPARTY"
39+
known_first_party = ["django_cleanup"]
40+
known_third_party = ["easy_thumbnails", "sorl", "pytest"]
41+
known_django = "django"
42+
multi_line_output = 4
43+
lines_after_imports = 2
44+
combine_as_imports = true
45+
46+
[tool.pytest.ini_options]
47+
DJANGO_SETTINGS_MODULE = "test.settings"
48+
pythonpath = [".", "src"]
49+
addopts = ["-v", "--cov-report=term-missing", "--cov=django_cleanup"]
50+
markers = [
51+
"cleanup_selected_config: marks test as using the CleanupSelectedConfig app config",
52+
"django_storage: change django storage backends"
53+
]

pytest.ini

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

setup.cfg

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

setup.py

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

src/django_cleanup/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
will delete files on model instance deletion.
55
'''
66

7-
__version__ = '8.1.0'
7+
__version__ = '9.0.0'

0 commit comments

Comments
 (0)