From 132e0ed3185dd96ab1c293b03d6a3a64be76fa12 Mon Sep 17 00:00:00 2001 From: Jens Nistler Date: Mon, 12 Aug 2024 15:37:31 +0200 Subject: [PATCH 1/8] django 5.0+ compatibility --- actstream/actions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actstream/actions.py b/actstream/actions.py index 76f84512..4b2be684 100644 --- a/actstream/actions.py +++ b/actstream/actions.py @@ -115,7 +115,7 @@ def action_handler(verb, **kwargs): if hasattr(verb, '_proxy____args'): verb = verb._proxy____args[0] # _args is the new attribute in Django >= 5.0 - if hasattr(verb, '_args'): + elif hasattr(verb, '_args'): verb = verb._args[0] newaction = apps.get_model('actstream', 'action')( From 02744236bd9694ecd83d13bbc11ae749664adc23 Mon Sep 17 00:00:00 2001 From: Jens Nistler Date: Mon, 12 Aug 2024 15:37:40 +0200 Subject: [PATCH 2/8] remove unused tox.ini --- tox.ini | 72 --------------------------------------------------------- 1 file changed, 72 deletions(-) delete mode 100644 tox.ini diff --git a/tox.ini b/tox.ini deleted file mode 100644 index b34ca7cc..00000000 --- a/tox.ini +++ /dev/null @@ -1,72 +0,0 @@ -[tox] -envlist = - py{37,38,39,310}-django32-{mysql,postgres,sqlite} - py{38,39,310}-django40-{mysql,postgres,sqlite} - py{38,39,310,311}-django41-{mysql,postgres,sqlite} - py{38,39,310,311,312}-django42-{mysql,postgres,sqlite} - py{310,311,312}-django50-{mysql,postgres,sqlite} -toxworkdir=/tmp/.tox - -[testenv] -commands = python -m pytest -s --cov --cov-append actstream/ runtests/testapp runtests/testapp_nested/ - -deps = - django-rest-framework - rest-framework-generic-relations - drf-spectacular - coverage - pytest - pytest-cov - pytest-django - setuptools - coverage>=4.5.1 - django32: Django>=3.2,<4.0 - django40: Django>=4.0,<4.1 - django41: Django>=4.1,<4.2 - django42: Django>=4.2,<5.0 - django50: Django>=5.0,<5.1 - mysql: mysqlclient>=2.0.0 - mysql: django-mysql>=2.4.1 - postgres: psycopg2-binary>=2.8 - -setenv = - ; GITHUB_WORKFLOW=true ; Set this to force enable mysql/postgres dbs - mysql: DATABASE_ENGINE=mysql - postgres: DATABASE_ENGINE=postgresql - -; Pass this to force enable mysql/postgres dbs -passenv = - GITHUB_WORKFLOW - MYSQL_HOST - MYSQL_NAME - MYSQL_USER - MYSQL_PASSWORD - MYSQL_PORT - POSTGRES_HOST - POSTGRES_NAME - POSTGRES_PORT - POSTGRES_USER - POSTGRES_PASSWORD - SQLITE_NAME - -usedevelop = True - -[testenv:ipdb] -deps = {[testenv]deps} ipdb ipython -commands = {[testenv]commands} --pdb --pdbcls=IPython.terminal.debugger:TerminalPdb - -[testenv:report] -deps = coverage -skip_install = true -commands = - coverage report - coverage html - -[travis:env] -DJANGO = - 4.0: django40 - 3.2: django32 -DATABASE = - mysql: mysql - postgresql: postgresql - sqlite: sqlite From d092b1d29b155da45e2378783216307b1406fd96 Mon Sep 17 00:00:00 2001 From: Jens Nistler Date: Mon, 12 Aug 2024 15:38:07 +0200 Subject: [PATCH 3/8] update github actions, add support for django 5.0/5.1 and newer python releases --- .github/workflows/workflow.yaml | 56 ++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index ee198e2b..a4398b35 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -30,31 +30,47 @@ jobs: strategy: fail-fast: false matrix: - python-version: + python: - 3.8 - 3.9 - "3.10" - - "3.11" - - "3.12" + - 3.11 + - 3.12 django: - 3.2 - 4.0 - 4.1 - 4.2 - 5.0 + - 5.1 database: - sqlite - mysql - postgres exclude: - - python-version: 3.8 - django: 5.0 - - python-version: 3.9 - django: 5.0 - - python-version: "3.11" + # django 3.2 + - python: 3.11 django: 3.2 - - python-version: "3.12" + - python: 3.12 django: 3.2 + # django 4.0 + - python: 3.11 + django: 4.0 + - python: 3.12 + django: 4.0 + # django 4.1 + - python: 3.12 + django: 4.1 + # django 5.0 + - python: 3.8 + django: 5.0 + - python: 3.9 + django: 5.0 + # django 5.1 + - python: 3.8 + django: 5.1 + - python: 3.9 + django: 5.1 # additional service containers to run services: @@ -98,10 +114,10 @@ jobs: - uses: actions/checkout@v4 # install python - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.python }} # upgrade pip - name: Update pip @@ -109,7 +125,7 @@ jobs: # install environment specific dependencies - name: Install coverage - run: pip install coverage>=5.3 setuptools + run: pip install coverage>=7.6.0 setuptools - name: Install Django 3.2 if: matrix.django == 3.2 @@ -126,17 +142,19 @@ jobs: - name: Install Django 5.0 if: matrix.django == 5.0 run: pip install "Django>=5.0,<5.1" + - name: Install Django 5.1 + if: matrix.django == 5.1 + run: pip install "Django>=5.1,<5.2" - name: Install MySQL libs if: matrix.database == 'mysql' - run: pip install mysqlclient>=2.0.1 django-mysql>=3.9.0 + run: pip install mysqlclient>=2.2.4 django-mysql>=4.14.0 - name: Install postgres libs if: matrix.database == 'postgres' - run: pip install psycopg2-binary>=2.8.6 + run: pip install psycopg2-binary>=2.9.9 - name: Install Django ReST framework libraries run: pip install -U django-rest-framework rest-framework-generic-relations drf-spectacular - # install our package - name: Install package run: pip install -e . @@ -146,13 +164,13 @@ jobs: run: coverage run runtests/manage.py test -v3 --noinput actstream testapp testapp_nested env: DATABASE_ENGINE: ${{ matrix.database }} - # COVERAGE_FILE: ".coverage.${{ matrix.python_version }}" + COVERAGE_FILE: ".coverage-python${{ matrix.python }}-django${{ matrix.django }}-${{ matrix.database }}" - name: Store coverage file - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: coverage - path: .coverage #.${{ matrix.python_version }} + name: "coverage-python${{ matrix.python }}-django${{ matrix.django }}-${{ matrix.database }}" + path: ".coverage-python${{ matrix.python }}-django${{ matrix.django }}-${{ matrix.database }}" - name: Coveralls uses: AndreMiras/coveralls-python-action@develop From cac4b88aee9b1e70608e6fb5367935d7f505eb85 Mon Sep 17 00:00:00 2001 From: Jens Nistler Date: Mon, 12 Aug 2024 15:43:25 +0200 Subject: [PATCH 4/8] documentation --- docs/changelog.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 3d2cab4f..a7e0c0a6 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -6,7 +6,9 @@ Changelog 2.0.1 ----- - - Adds support for Django 5.0 + - Added support for Django 5.0 and 5.1 + - Added support for Python 3.10, 3.11 and 3.12 + - Updated GitHub actions 2.0.0 ----- From 6eaabec41592d2e8aa0f24d61a83583b46a2e28c Mon Sep 17 00:00:00 2001 From: Jens Nistler Date: Tue, 13 Aug 2024 16:22:24 +0200 Subject: [PATCH 5/8] revert change to artifact upload --- .github/workflows/workflow.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index a4398b35..0385aa6a 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -164,13 +164,13 @@ jobs: run: coverage run runtests/manage.py test -v3 --noinput actstream testapp testapp_nested env: DATABASE_ENGINE: ${{ matrix.database }} - COVERAGE_FILE: ".coverage-python${{ matrix.python }}-django${{ matrix.django }}-${{ matrix.database }}" + # COVERAGE_FILE: ".coverage.${{ matrix.python_version }}" - name: Store coverage file - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: - name: "coverage-python${{ matrix.python }}-django${{ matrix.django }}-${{ matrix.database }}" - path: ".coverage-python${{ matrix.python }}-django${{ matrix.django }}-${{ matrix.database }}" + ame: coverage + path: .coverage #.${{ matrix.python_version }} - name: Coveralls uses: AndreMiras/coveralls-python-action@develop From 10126ddbd95eebdf3bb9afa9723b74838a4ceec3 Mon Sep 17 00:00:00 2001 From: Jens Nistler Date: Tue, 13 Aug 2024 16:22:52 +0200 Subject: [PATCH 6/8] fix missing letter --- .github/workflows/workflow.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 0385aa6a..9be9d5c4 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -169,7 +169,7 @@ jobs: - name: Store coverage file uses: actions/upload-artifact@v3 with: - ame: coverage + name: coverage path: .coverage #.${{ matrix.python_version }} - name: Coveralls From 8dac622706a234d73bba48837a9d688689c8d6eb Mon Sep 17 00:00:00 2001 From: Jens Nistler Date: Wed, 4 Sep 2024 10:44:28 +0200 Subject: [PATCH 7/8] restore and adjust tox.ini --- tox.ini | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 tox.ini diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..2484599c --- /dev/null +++ b/tox.ini @@ -0,0 +1,80 @@ +[tox] +envlist = + py{38,39,310}-django32-{mysql,postgres-psycopg2,sqlite} + py{38,39,310}-django40-{mysql,postgres-psycopg2,sqlite} + py{38,39,310,311}-django41-{mysql,postgres-psycopg2,sqlite} + py{38,39,310,311,312}-django42-{mysql,postgres-psycopg3,sqlite} + py{310,311,312}-django50-{mysql,postgres-psycopg3,sqlite} + py{310,311,312}-django51-{mysql,postgres-psycopg3,sqlite} +toxworkdir=/tmp/.tox + +[testenv] +commands = pytest -s --cov --cov-append actstream/ runtests/testapp runtests/testapp_nested/ + +deps = + django-rest-framework + rest-framework-generic-relations + drf-spectacular + coverage + pytest + pytest-cov + pytest-django + coverage>=4.5.1 + django32: Django>=3.2,<4.0 + django40: Django>=4.0,<4.1 + django41: Django>=4.1,<4.2 + django42: Django>=4.2,<5.0 + django50: Django>=5.0,<5.1 + django51: Django>=5.1,<5.2 + mysql: mysqlclient>=2.0.0 + mysql: django-mysql>=2.4.1 + postgres-psycopg2: psycopg2-binary>=2.8 + postgres-psycopg3: psycopg-binary>=3.2 + +setenv = + ; GITHUB_WORKFLOW=true ; Set this to force enable mysql/postgres dbs + mysql: DATABASE_ENGINE=mysql + postgres-psycopg2: DATABASE_ENGINE=postgresql + postgres-psycopg3: DATABASE_ENGINE=postgresql + +; Pass this to force enable mysql/postgres dbs +passenv = + GITHUB_WORKFLOW + MYSQL_HOST + MYSQL_NAME + MYSQL_USER + MYSQL_PASSWORD + MYSQL_PORT + POSTGRES_HOST + POSTGRES_NAME + POSTGRES_PORT + POSTGRES_USER + POSTGRES_PASSWORD + SQLITE_NAME + +usedevelop = True + +[testenv:ipdb] +deps = {[testenv]deps} ipdb ipython +commands = {[testenv]commands} --pdb --pdbcls=IPython.terminal.debugger:TerminalPdb + +[testenv:report] +deps = coverage +skip_install = true +commands = + coverage report + coverage html + +[travis:env] +DJANGO = + 5.1: django51 + 5.0: django50 + 4.2: django42 + 4.1: django41 + 4.0: django40 + 3.2: django32 +DATABASE = + mysql: mysql + postgres-psycopg2: postgresql + postgres-psycopg3: postgresql + sqlite: sqlite From 84005c4a30ad6b3e1375660f0144df8f5be4dfb3 Mon Sep 17 00:00:00 2001 From: Asif Saif Uddin Date: Thu, 5 Sep 2024 16:10:17 +0600 Subject: [PATCH 8/8] Update docs/installation.rst --- docs/installation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation.rst b/docs/installation.rst index 6b910be1..13f87618 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -60,7 +60,7 @@ Make sure to pick the version of Django and django-activity-stream that supports Python ****** -* **Python 3**: 3.6 to 3.12 +* **Python 3**: 3.8 to 3.12 * **PyPy**: 3 Django