Repository: shinneider/django-admin-inline-paginator (language: python)

Issue:
Fails at installing new version 0.2.1 at CI
We @shinneider ,
We have upgraded the package  to `0.2.1` and it started to fail at our GitLab CI.

Here is a traceback of it:

```
Collecting django==2.2.24
  Downloading Django-2.2.24-py3-none-any.whl (7.5 MB)
Collecting django-absolute==0.3
  Downloading django-absolute-0.3.tar.gz (10 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting django-admin-inline-paginator==0.2.1
  Downloading django-admin-inline-paginator-0.2.1.tar.gz (7.5 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /home/gitlab-runner/builds/hi3SfEg7/0/NephilaAG/gryps-project/venv/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-nm11c9y_/django-admin-inline-paginator_efb36415eafa45c2880fee38d38dbf5f/setup.py'"'"'; __file__='"'"'/tmp/pip-install-nm11c9y_/django-admin-inline-paginator_efb36415eafa45c2880fee38d38dbf5f/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-cfrtmicm
       cwd: /tmp/pip-install-nm11c9y_/django-admin-inline-paginator_efb36415eafa45c2880fee38d38dbf5f/
  Complete output (7 lines):
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-nm11c9y_/django-admin-inline-paginator_efb36415eafa45c2880fee38d38dbf5f/setup.py", line 7, in <module>
      from django_admin_inline_paginator.meta import VERSION
    File "/tmp/pip-install-nm11c9y_/django-admin-inline-paginator_efb36415eafa45c2880fee38d38dbf5f/django_admin_inline_paginator/__init__.py", line 2, in <module>
      from django import __version__ as django_version
  ModuleNotFoundError: No module named 'django'
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/bb/fe/6e014aa386cdfebbdd140ceccd4d3df50d8d8141fb546b3bfb47efcfeeb3/django-admin-inline-paginator-0.2.1.tar.gz#sha256=f0af26ef6ea8ae74084fe5c3dc44f942a15efbb9d49ce1fee260f566ff3ccb6a (from https://pypi.org/simple/django-admin-inline-paginator/) (requires-python:>=3.3). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement django-admin-inline-paginator==0.2.1 (from versions: 0.1, 0.1.1, 0.2, 0.2.1)
ERROR: No matching distribution found for django-admin-inline-paginator==0.2.1
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit status 1
```

The affected commit: https://github.com/shinneider/django-admin-inline-paginator/commit/528272b7ab184c16834feb4a169b464fbff47623

Still not sure is it a problem at CI or at configuration for `setup.py` file.


Discussion / hints:

Fix patch:
diff --git a/django_admin_inline_paginator/__init__.py b/django_admin_inline_paginator/__init__.py
index 66ad70d..93f3d6e 100644
--- a/django_admin_inline_paginator/__init__.py
+++ b/django_admin_inline_paginator/__init__.py
@@ -1,5 +1,10 @@
 # -*- coding: utf-8 -*-
-from django import __version__ as django_version
+try:
+    import django
+except ImportError:
+    django = None
 
-if django_version < '3.2':  # pragma: no cover
+__version__ = '0.2.1'
+
+if django and django.VERSION < (3, 2):  # pragma: no cover
     default_app_config = 'django_admin_inline_paginator.apps.DjangoAdminInlinePaginatorConfig'
diff --git a/django_admin_inline_paginator/meta.py b/django_admin_inline_paginator/meta.py
deleted file mode 100644
index 2ce21ed..0000000
--- a/django_admin_inline_paginator/meta.py
+++ /dev/null
@@ -1,3 +0,0 @@
-from distutils.version import StrictVersion
-
-VERSION = StrictVersion('0.2.1')
diff --git a/setup.py b/setup.py
index a10ff8c..b09bd06 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@
 
 from setuptools import find_packages, setup
 
-from django_admin_inline_paginator.meta import VERSION
+from django_admin_inline_paginator import __version__
 
 extras_require = {
     'dev': [
@@ -20,7 +20,7 @@
 
 setup(
     name='django-admin-inline-paginator',
-    version=str(VERSION),
+    version=__version__,
     description='The "Django Admin Inline Paginator" is simple way to paginate your inline in django admin',
     long_description=open('README.md', encoding='utf-8').read(),
     long_description_content_type='text/markdown',


Test patch:
diff --git a/django_admin_inline_paginator/tests/meta_test.py b/django_admin_inline_paginator/tests/meta_test.py
deleted file mode 100644
index 33f8c5e..0000000
--- a/django_admin_inline_paginator/tests/meta_test.py
+++ /dev/null
@@ -1,14 +0,0 @@
-import unittest
-from django_admin_inline_paginator.meta import VERSION
-
-
-class TestMetaFormat(unittest.TestCase):
-
-    def test_version_format(self):
-        """
-            This project use format major.minor.patch
-        """
-        ver = str(VERSION).split('.')
-        self.assertEqual(isinstance(ver, list), True)
-        self.assertEqual(len(ver), 3)
-        self.assertEqual(all([x.isnumeric() for x in ver]), True)