From 5ccd0f72dbf48e754c132cf6e2eb268ac8adf02b Mon Sep 17 00:00:00 2001 From: KwongTN <5886584+kwongtn@users.noreply.github.com> Date: Mon, 29 Jul 2024 03:44:53 +0000 Subject: [PATCH 01/11] Fix setuptools to =40.8.0 +setuptools>=40.8.0,<72 wheel>=0.33.1 flake8>=3.8.3 tox>=2.3.1 From 34a4c7bb98daac8ef249a847dd8c0aaaffd29460 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 29 Jul 2024 07:15:25 +0200 Subject: [PATCH 02/11] Makefile: Use pytest instead of setup.py test --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7f34b4a4..552a09a9 100644 --- a/Makefile +++ b/Makefile @@ -139,7 +139,7 @@ test-all: clean-pyc $(TOX) test: - $(PYTHON) setup.py test + $(PYTEST) cov: (cd $(TESTDIR); $(PYTEST) -x --cov="$(PROJ)" --cov-report=html) From 5a21c38679f416dff525754a6f27d7909877e7c8 Mon Sep 17 00:00:00 2001 From: KwongTN <5886584+kwongtn@users.noreply.github.com> Date: Mon, 29 Jul 2024 05:45:51 +0000 Subject: [PATCH 03/11] Attempt to use pytest directly --- setup.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/setup.py b/setup.py index 96d596f6..b0d077ac 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,6 @@ import sys import setuptools -import setuptools.command.test NAME = 'django-celery-beat' PACKAGE = 'django_celery_beat' @@ -103,19 +102,6 @@ def reqs(*f): # -*- %%% -*- - -class pytest(setuptools.command.test.test): - user_options = [('pytest-args=', 'a', 'Arguments to pass to pytest')] - - def initialize_options(self): - setuptools.command.test.test.initialize_options(self) - self.pytest_args = [] - - def run_tests(self): - import pytest - sys.exit(pytest.main(self.pytest_args)) - - setuptools.setup( name=NAME, packages=setuptools.find_packages(exclude=[ From ea3e72ba06eb7fb08908864f9839b9c666ada3a1 Mon Sep 17 00:00:00 2001 From: KwongTN <5886584+kwongtn@users.noreply.github.com> Date: Mon, 29 Jul 2024 05:47:58 +0000 Subject: [PATCH 04/11] Add python -m --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 552a09a9..f93b1769 100644 --- a/Makefile +++ b/Makefile @@ -139,7 +139,7 @@ test-all: clean-pyc $(TOX) test: - $(PYTEST) + $(PYTHON) -m $(PYTEST) cov: (cd $(TESTDIR); $(PYTEST) -x --cov="$(PROJ)" --cov-report=html) From aa5349fa281f2ccba7e8cbfcebef867cfda4b5ce Mon Sep 17 00:00:00 2001 From: KwongTN <5886584+kwongtn@users.noreply.github.com> Date: Mon, 29 Jul 2024 13:49:28 +0800 Subject: [PATCH 05/11] Update setup.py Co-authored-by: Christian Clauss --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b0d077ac..262946d5 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import codecs import os import re -import sys +import pytest import setuptools From d2dfcd0ade081eeef7ab60c42dfcac4a9b866af2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 05:49:35 +0000 Subject: [PATCH 06/11] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 262946d5..cfc6e0ab 100644 --- a/setup.py +++ b/setup.py @@ -3,8 +3,8 @@ import codecs import os import re -import pytest +import pytest import setuptools NAME = 'django-celery-beat' From 330be654cf40a0db0f737349e08c5ed593c992b2 Mon Sep 17 00:00:00 2001 From: KwongTN <5886584+kwongtn@users.noreply.github.com> Date: Mon, 29 Jul 2024 05:51:54 +0000 Subject: [PATCH 07/11] Add pytest installation to workflow --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 234cb667..b937a53c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,7 +43,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install tox tox-gh-actions + python -m pip install tox tox-gh-actions pytest - name: Test with tox run: tox env: From 8d30439553ba9da0cc3ab14f88ddfb7cc95170ff Mon Sep 17 00:00:00 2001 From: KwongTN <5886584+kwongtn@users.noreply.github.com> Date: Mon, 29 Jul 2024 05:55:47 +0000 Subject: [PATCH 08/11] Remove pytest from setup.py --- setup.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/setup.py b/setup.py index cfc6e0ab..9b3d609a 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,6 @@ import os import re -import pytest import setuptools NAME = 'django-celery-beat' @@ -120,7 +119,6 @@ def reqs(*f): python_requires='>=3.8', install_requires=reqs('default.txt') + reqs('runtime.txt'), tests_require=reqs('test.txt') + reqs('test-django.txt'), - cmdclass={'test': pytest}, classifiers=classifiers, entry_points={ 'celery.beat_schedulers': [ From 65d5743818a447a7f775128bfac50c729bb54c75 Mon Sep 17 00:00:00 2001 From: KwongTN <5886584+kwongtn@users.noreply.github.com> Date: Mon, 29 Jul 2024 06:20:32 +0000 Subject: [PATCH 09/11] Unlock setuptools --- requirements/pkgutils.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/pkgutils.txt b/requirements/pkgutils.txt index 5e1e9110..eec7d2ca 100644 --- a/requirements/pkgutils.txt +++ b/requirements/pkgutils.txt @@ -1,4 +1,4 @@ -setuptools>=40.8.0,<72 +setuptools>=40.8.0 wheel>=0.33.1 flake8>=3.8.3 tox>=2.3.1 From 03d421cc4417b9c120c9c03c06c9404a9c9c7e2f Mon Sep 17 00:00:00 2001 From: KwongTN <5886584+kwongtn@users.noreply.github.com> Date: Mon, 29 Jul 2024 06:25:49 +0000 Subject: [PATCH 10/11] Remove tests_require --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 9b3d609a..42dbe3e6 100644 --- a/setup.py +++ b/setup.py @@ -118,7 +118,6 @@ def reqs(*f): license='BSD', python_requires='>=3.8', install_requires=reqs('default.txt') + reqs('runtime.txt'), - tests_require=reqs('test.txt') + reqs('test-django.txt'), classifiers=classifiers, entry_points={ 'celery.beat_schedulers': [ From 1f013413bbbeaa03f9c377297c865ac633ceae6a Mon Sep 17 00:00:00 2001 From: KwongTN <5886584+kwongtn@users.noreply.github.com> Date: Mon, 29 Jul 2024 06:34:34 +0000 Subject: [PATCH 11/11] Move pytest to tox.ini --- .github/workflows/test.yml | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b937a53c..234cb667 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,7 +43,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install tox tox-gh-actions pytest + python -m pip install tox tox-gh-actions - name: Test with tox run: tox env: diff --git a/tox.ini b/tox.ini index d044e399..d812ee48 100644 --- a/tox.ini +++ b/tox.ini @@ -80,5 +80,5 @@ usedevelop = true commands = pip install --upgrade https://github.com/celery/celery/zipball/main#egg=celery pip install --upgrade https://github.com/celery/kombu/zipball/main#egg=kombu - pip install Django + pip install Django pytest pytest -x --cov=django_celery_beat --cov-report=xml --no-cov-on-fail