Repository: django-hijack/django-hijack (language: python)

Issue:
Maintainership
Hi @philippeowagner,

Let me start by expressing my gratitude towards the hours you and other contributors have sunk into this project.
With that in mind, it would be sad to see this library fade away. Looking that the current state of the repository, it might be time to consider putting this project under new maintainership, to fuel the project with new enthusiasm.

Since you are a @jazzband member yourself, that would certainly be an option. If you prefer a corporate or individual maintainer, that could also be arranged.

Maybe you find the time to share your thoughts.

Best,
Joe


Discussion / hints:
The project really lacks care. It is very disappointing to prepare changes and wait for an answer for several years without receiving it...
https://github.com/arteria/django-hijack/pull/197

And in general, if nothing changes soon, I will fork this project (since the MIT license allows it).
FYI, I just reached out to @philippeowagner via email. I am confident this will yield a response. Let's give a little more time before resorting to a hard fork.
Hi all,

We will find together a solution to get django-hijack forward. 

The sources of django-hijack and django-hijack-admin will be moved to https://github.com/django-hijack as soon as possible. 

I will call for maintainer once sources have moved.


Nice to hear that! 
Any news?

Who'd like to join the party?  You @codingjoe and you @Mogost ?

How are we going to organize this? 

Any suggestions and experiences from other projects? 



I'm talking about this repo and  django-hijack/django-hijack-admin by the way.
 


I am happy to take part. 
I think we need automation for deployments and tests, which I did in #197.


May be interesting for @kedlav 
Hi @philippeowagner, yes I'd be honored to help.

I guess it would be good to set some ground rules, like mandatory reviews and a release process as well as version support.
Those would be my suggestions:

### Releases

I agree with @Mogost to automate this. However, #197 includes to many unrelated changes. I have a very tiny GitHub Action script that enables automated releases on PyPi. I'd be delighted to contribute that.
Besides that, `semver` is the way to go and every contribution should be released. Changes may be bundled into a single release if they were merged at the same day. Essentially, if you are done reviewing and merging changes for the day, release your changes. With the automation I proposed this would only mean to create a GibHub release with some notes and you're done.

### Reviews

One should not merge their own code without a peer review. Every member may merge and release new PiPy versions.

### Version support

Updating to new Python and Django versions has been getting easier latetly. It is usually sufficient to support the last two versions. Legacy application may simply jump to an older version of django-hijack.
Django: Latest stable and latest LTS (e.g. 3.1 & 2.2)
Python: Last two releases (e.g. 3.8 & 3.9)

@codingjoe Agree about GH actions. If I made these changes today, it would be done this way.
In #197 I removed `django-compat` dependency, now this dependency hinders rather than helps.

Also I see `django-hijack-admin` as a part of `django-hijack`. I don't understand why this package comes separately.
@Mogost great. I proposed a GH action here #210
I'd also love to review the changes in #197, but it would be much simpler if you could split your changes across multiple pull requests.
@philippeowagner I'd also love to do triage on all open issues. There is a lot that simply needs an explanation and could be closed.

Splitting admin support into a separate package seems ambitious. We should test and document support with and without the admin, but I believe it might be more convenient to have this feature be part of this package. Be it only as a contrib and not core behavior.
**Ahoy pirates and welcome aboard!**

Please welcome our new Captains @codingjoe and Quartermaster @Mogost – or vice versa. 

I'm happy to hand over the steering wheel, but we (arteria GmbH) will remain on board as owners for the time being. 

If any Sailing Master, Gunner, Powder Monkey, .. wants to join the journey, I'm happy to add more crew members with write access to this organization. 

Have fun maneuvering this ship safely into the next harbor. 

PS: See https://github.com/django-hijack/django-hijack/issues/114 why does django-hijack-admin exist. The version numbers should be keeps in sync due to a .deb package. I think @stylesen asked for it. 

PPS: Johannes, please email me in case you need my attention. Thank you!  

I would like to participate as well.

Fix patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 00000000..12db35ba
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,45 @@
+name: CI
+
+on:
+  push:
+    branches:
+      - master
+  pull_request:
+
+jobs:
+
+  dist:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/setup-python@v2
+      - run: python -m pip install --upgrade pip setuptools wheel twine readme-renderer
+      - uses: actions/checkout@v2
+      - run: python setup.py sdist bdist_wheel
+      - run: python -m twine check dist/*
+
+  pytest:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version:
+          - "3.6"
+          - "3.7"
+          - "3.8"
+          - "3.9"
+        django-version:
+          - "2.2"
+          - "3.0"
+          - "3.1"
+    steps:
+    - uses: actions/checkout@v2
+    - name: Set up Python ${{ matrix.python-version }}
+      uses: actions/setup-python@v2
+      with:
+        python-version: ${{ matrix.python-version }}
+    - name: Upgrade Python setuptools
+      run: python -m pip install --upgrade pip setuptools wheel codecov
+    - name: Install Django ${{ matrix.django-version }}
+      run: python -m pip install django~=${{ matrix.django-version }}
+    - name: Run tests
+      run: python setup.py test
+    - run: codecov
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 8e7339a0..00000000
--- a/.travis.yml
+++ /dev/null
@@ -1,48 +0,0 @@
-language: python
-
-# Enumerate all Python/Django pairs until Travis has a real syntax for that
-# Use tox -l to list available tox environments
-matrix:
-  include:
-  - python: 2.7
-    env: TOXENV=py27-django18
-  - python: 2.7
-    env: TOXENV=py27-django19
-  - python: 2.7
-    env: TOXENV=py27-django110
-  - python: 2.7
-    env: TOXENV=py27-django111
-
-  - python: 3.5
-    env: TOXENV=py35-django18
-  - python: 3.5
-    env: TOXENV=py35-django19
-  - python: 3.5
-    env: TOXENV=py35-django110
-  - python: 3.5
-    env: TOXENV=py35-django111
-  - python: 3.5
-    env: TOXENV=py35-django20
-
-  - python: 3.6
-    env: TOXENV=py36-django18
-  - python: 3.6
-    env: TOXENV=py36-django19
-  - python: 3.6
-    env: TOXENV=py36-django110
-  - python: 3.6
-    env: TOXENV=py36-django111
-  - python: 3.6
-    env: TOXENV=py36-django20
-
-install:
-    - pip install tox-travis
-    - pip install coveralls
-
-script:
-    - tox
-
-sudo: false
-
-after_success:
-    coveralls
diff --git a/requirements.txt b/requirements.txt
index 55d6cf5e..584f2307 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,1 +1,2 @@
 django-compat>=1.0.14
+django>=2.2
\ No newline at end of file
diff --git a/setup.cfg b/setup.cfg
index e32e8d04..55de2f54 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,3 +1,23 @@
+[options]
+setup_requires =
+    pytest-runner
+tests_require =
+    pytest
+    pytest-cov
+    pytest-django
+
+[aliases]
+test = pytest
+
+[tool:pytest]
+addopts = --cov=hijack
+DJANGO_SETTINGS_MODULE=hijack.tests.test_settings
+
+[coverage:report]
+show_missing = True
+skip_covered = True
+skip_empty = True
+
 [flake8]
 ignore = F999,E501,E128,E124
 exclude = .git,*/migrations/*,*/static/CACHE/*
diff --git a/setup.py b/setup.py
old mode 100644
new mode 100755
index 7c59d398..69f4643d
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,4 @@
-# -*- encoding: utf-8 -*-
+#!/usr/bin/env python
 """
 Python setup file for the hijack app.
 
@@ -59,12 +59,12 @@ def read(fname):
                    'Framework :: Django',
                    'License :: OSI Approved :: MIT License',
                    'Framework :: Django',
-                   'Framework :: Django :: 1.8',
-                   'Framework :: Django :: 1.9',
-                   'Framework :: Django :: 1.10',
-                   'Framework :: Django :: 1.11',
-                   'Framework :: Django :: 2.0',
-                   'Framework :: Django :: 2.1',
+                   'Framework :: Django :: 2.2',
+                   'Framework :: Django :: 3.0',
+                   'Framework :: Django :: 3.1',
                    'Programming Language :: Python',
-                   'Programming Language :: Python :: 2',
-                   'Programming Language :: Python :: 3', ], )
+                   'Programming Language :: Python :: 3',
+                   'Programming Language :: Python :: 3.6',
+                   'Programming Language :: Python :: 3.7',
+                   'Programming Language :: Python :: 3.8',
+                   'Programming Language :: Python :: 3.9'], )
diff --git a/tox.ini b/tox.ini
deleted file mode 100644
index 8bda2abe..00000000
--- a/tox.ini
+++ /dev/null
@@ -1,23 +0,0 @@
-[tox]
-envlist =
-    py{27}-django{18,19,110,111}
-    py{35,36}-django{18,19,110,111,20,21}
-
-[testenv]
-deps =
-    -r{toxinidir}/requirements-test.txt
-    -r{toxinidir}/requirements.txt
-    django18: Django>=1.8,<1.9
-    django19: Django>=1.9,<1.10
-    django110: Django>=1.10,<1.11
-    django111: Django>=1.11,<1.12
-    django20: Django>=2.0,<2.1
-    django21: Django>=2.1,<2.2
-
-commands =
-    pip freeze
-    coverage erase
-    coverage run -a runtests.py hijack.tests.test_hijack
-    coverage run -a runtests.py hijack.tests.test_checks
-    coverage run -a runtests.py hijack.tests.test_hijack_url_settings:AllowGetRequestsHijackTestCase
-    coverage run -a runtests.py hijack.tests.test_hijack_url_settings:CustomDecoratorHijackTestCase


Test patch:
diff --git a/hijack/tests/test_settings.py b/hijack/tests/test_settings.py
index 4312ccee..ef5473b7 100644
--- a/hijack/tests/test_settings.py
+++ b/hijack/tests/test_settings.py
@@ -88,7 +88,6 @@
     'django.contrib.staticfiles',
     'django.contrib.sitemaps',
     'django.contrib.sites',
-    'django_nose',
     'compat',
 ]
 
diff --git a/requirements-test.txt b/requirements-test.txt
deleted file mode 100644
index 38445c87..00000000
--- a/requirements-test.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-coverage
-django-coverage
-django-nose
diff --git a/runtests.py b/runtests.py
deleted file mode 100755
index a763d0f6..00000000
--- a/runtests.py
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/env python
-"""
-This script is a trick to setup a fake Django environment, since this reusable
-app will be developed and tested outside any specifiv Django project.
-
-Via ``settings.configure`` you will be able to set all necessary settings
-for your app and run the tests as if you were calling ``./manage.py test``.
-
-"""
-import sys
-
-from django.conf import settings
-
-from hijack.tests import test_settings
-
-if not settings.configured:
-    settings.configure(**test_settings.__dict__)
-
-from django_nose import NoseTestSuiteRunner
-
-
-def runtests(*test_args):
-    import django
-    if django.VERSION >= (1, 7):
-        django.setup()
-    failures = NoseTestSuiteRunner(verbosity=2,
-                                      interactive=True).run_tests(test_args)
-    sys.exit(failures)
-
-
-if __name__ == '__main__':
-    runtests(*sys.argv[1:])