Skip to content

Commit

Permalink
Merge pull request #110 from un1t/feature/9.0
Browse files Browse the repository at this point in the history
Feature 9.0
  • Loading branch information
vinnyrose authored Sep 18, 2024
2 parents eee7785 + f4b476e commit ffce153
Show file tree
Hide file tree
Showing 22 changed files with 227 additions and 308 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lockThreads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'Lock Threads'

on:
schedule:
- cron: '0 0 * * *'
- cron: '25 4 * * *'
workflow_dispatch:

permissions:
Expand All @@ -16,7 +16,7 @@ jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v3
- uses: dessant/lock-threads@v5
with:
issue-inactive-days: '30'
issue-comment: >
Expand Down
75 changes: 16 additions & 59 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,64 +7,21 @@ on:
workflow_dispatch:

jobs:
build:
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
strategy:
matrix:
include:
- python: "3.6"
toxenv: py36-django32
os: ubuntu-20.04
- python: "3.7"
toxenv: py37-django32
- python: "3.8"
toxenv: py38-django32
- python: "3.9"
toxenv: py39-django32
- python: "3.10"
toxenv: py310-django32
- python: "pypy-3.10"
toxenv: pypy3-django32

- python: "3.8"
toxenv: py38-django41
- python: "3.9"
toxenv: py39-django41
- python: "3.10"
toxenv: py310-django41
- python: "3.11"
toxenv: py311-django41
- python: "pypy-3.10"
toxenv: pypy3-django41

- python: "3.8"
toxenv: py38-django42
- python: "3.9"
toxenv: py39-django42
- python: "3.10"
toxenv: py310-django42
- python: "3.11"
toxenv: py311-django42
- python: "pypy-3.10"
toxenv: pypy3-django42

- python: "3.10"
toxenv: py310-django50
- python: "3.11"
toxenv: py311-django50
- python: "3.12"
toxenv: py312-django50
- python: "pypy-3.10"
toxenv: pypy3-django50
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install Test Framework
run: pip install tox-gh-actions
- name: Run Tests
env:
TOXENV: ${{ matrix.toxenv }}
run: tox # setting TOXENV is equivalent to calling `tox -e [ENV]`
python-version: |
3.8
3.9
3.10
pypy-3.10
3.11
3.12
- name: Install test framework
run: pip install tox
- name: Run tests
run: tox r
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ env/*
.vscode/*
README.html
*.txt
.venv/*
14 changes: 0 additions & 14 deletions .isort.cfg

This file was deleted.

21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ 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]
## [9.0.0] - 2024-09-18
## Added
- pyproject.toml
- Documentation on how to use transaction test case when using pytest. PR [#108] from [@pavel-kalmykov](https://github.com/pavel-kalmykov).

### Changed
- 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.
- Updated lock thread version and update job to not run at contested times to avoid github rate limiting errors.
- Updated ci build action versions.
- Move isort and pytest settings to toml file.
- Simplify tox.ini and github actions CI job.
- Update a getattr call to remove unnecessary default of None so it will fail on an attribute error.
- Change from .format() to f-strings.

### Removed
- Removed setup.py/setup.cfg

## [8.1.0] - 2024-01-28
### Added
- Run tests for django 5.0 and python 3.12.
Expand Down Expand Up @@ -93,7 +110,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [0.1.4] - 2012-08-16
## [0.1.0] - 2012-08-14

[Unreleased]: https://github.com/un1t/django-cleanup/compare/8.1.0...HEAD
[Unreleased]: https://github.com/un1t/django-cleanup/compare/9.0.0...HEAD
[9.0.0]: https://github.com/un1t/django-cleanup/compare/8.1.0...9.0.0
[8.1.0]: https://github.com/un1t/django-cleanup/compare/8.0.0...8.1.0
[8.0.0]: https://github.com/un1t/django-cleanup/compare/7.0.0...8.0.0
[7.0.0]: https://github.com/un1t/django-cleanup/compare/6.0.0...7.0.0
Expand Down Expand Up @@ -131,6 +149,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[0.1.4]: https://github.com/un1t/django-cleanup/compare/0.1.0...0.1.4
[0.1.0]: https://github.com/un1t/django-cleanup/releases/tag/0.1.0

[#108]: https://github.com/un1t/django-cleanup/pull/108
[#100]: https://github.com/un1t/django-cleanup/pull/100
[#98]: https://github.com/un1t/django-cleanup/issues/98
[#96]: https://github.com/un1t/django-cleanup/issues/96
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
include README.rst
include LICENSE
include CHANGELOG.md
19 changes: 14 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ is set as the :code:`FileField`'s default value will not be deleted.

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

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

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

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

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

pytest
------
When writing tests with pytest_ use `@pytest.mark.django_db(transaction=True)`_ with the
:code:`transaction` argument set to :code:`True` to ensure that the behavior will be the same as
using a transaction test case.

License
=======
django-cleanup is free software under terms of the:
Expand Down Expand Up @@ -209,8 +214,12 @@ SOFTWARE.


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

.. |Version| image:: https://img.shields.io/pypi/v/django-cleanup.svg
:target: https://pypi.python.org/pypi/django-cleanup/
Expand Down
53 changes: 53 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name='django-cleanup'
authors = [
{name = "Ilya Shalyapin", email = "ishalyapin@gmail.com"}
]
description = "Deletes old files."
readme = "README.rst"
keywords = ["django"]
classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Utilities'
]
requires-python = ">=3.8"
dynamic = ["version"]

[project.urls]
Homepage = "https://github.com/un1t/django-cleanup"
Changelog = "https://github.com/un1t/django-cleanup/blob/master/CHANGELOG.md"

[tool.setuptools.dynamic]
version = {attr = "django_cleanup.__version__"}

[tool.isort]
sections = ["FUTURE", "STDLIB", "DJANGO", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
line_length = 100
default_section = "THIRDPARTY"
known_first_party = ["django_cleanup"]
known_third_party = ["easy_thumbnails", "sorl", "pytest"]
known_django = "django"
multi_line_output = 4
lines_after_imports = 2
combine_as_imports = true

[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "test.settings"
pythonpath = [".", "src"]
addopts = ["-v", "--cov-report=term-missing", "--cov=django_cleanup"]
markers = [
"cleanup_selected_config: marks test as using the CleanupSelectedConfig app config",
"django_storage: change django storage backends"
]
6 changes: 0 additions & 6 deletions pytest.ini

This file was deleted.

2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

70 changes: 0 additions & 70 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/django_cleanup/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
will delete files on model instance deletion.
'''

__version__ = '8.1.0'
__version__ = '9.0.0'
Loading

0 comments on commit ffce153

Please sign in to comment.