Repository: carltongibson/django-filter

Issue:
Version incrementation for V0.8
Hello,

It is certainly a small detail, and it will be corrected in the next release, but it seems that the version numbers where not incremented for the 0.8 release.
You can see it at least in the following files:
- [setup.py line 9](https://github.com/alex/django-filter/blob/v0.8/setup.py#L9),
- [django_filters/__init__.py line 6](https://github.com/alex/django-filter/blob/v0.8/django_filters/__init__.py#L6)

regards,



Discussion:
Hi @ymph — It seems like there are version numbers _everywhere_ :-)

I caught a couple of them but missed these. I'll look at getting it all into one place. 

Thanks for the report.

Hey! I can recomend https://github.com/peritus/bumpversion
Once properly configured it can nicely increment versions before releasing and after a release change it to X.Y.Z+1-dev. I can open a PR if you're interested.

Hello,
@carltongibson : You are welcome, just for you to know, I found out the problem when installing your library with pip with a fixed version in a requirement file, and pip gave me a warning stating that the versoin found in the package did not match the version requested.

@slafs : thank you for the tip, I will check it for my projects.

@ymph — Hmmm. `pip install django-filter` installs cleanly for me... However, we'll patch this up for the next release. 

@slafs — That project looks cool — I'd still like to remove some of the duplication but that'll do nicely for now. A PR would be very welcome. ;-)

Yes, I have a perhaps non common workflow. In order to support offline installation, I maintain a local archive of the libraries used for the project. We have also a project-wide requirement files for pip.

So here is the output I have when calling pip with a requirement file and the 0.8 version of your lib freshly downloaded from github :

> pip install -r requirement.txt -f ~/Downloads/
> Downloading/unpacking django-filter==0.8 (from -r requirement.txt (line 1))
>   Running setup.py (path:/Users/ymh/dev/venvs/tempo/build/django-filter/setup.py) egg_info for package django-filter
> 
>   **Requested django-filter==0.8 (from -r requirement.txt (line 1)), but installing version 0.7**
> Installing collected packages: django-filter
>   Running setup.py install for django-filter
> 
> Successfully installed django-filter
> Cleaning up...

and I forgot: thank you very much for this useful library !

Regards,


Resolving patch:
diff --git a/django_filters/__init__.py b/django_filters/__init__.py
--- a/django_filters/__init__.py
+++ b/django_filters/__init__.py
@@ -3,4 +3,22 @@
 from .filterset import FilterSet
 from .filters import *
 
-VERSION = (0, 7)
+__version__ = '0.9.0-dev'
+
+
+def get_version(version):
+    '''
+    '0.1.2-dev' -> (0, 1, 2, 'dev')
+    '0.1.2' -> (0, 1, 2)
+    '''
+    v = version.split('.')
+    v = v[:-1] + v[-1].split('-')
+    ret = []
+    for p in v:
+        if p.isdigit():
+            ret.append(int(p))
+        else:
+            ret.append(p)
+    return tuple(ret)
+
+VERSION = get_version(__version__)
diff --git a/docs/conf.py b/docs/conf.py
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -48,9 +48,9 @@
 # built documents.
 #
 # The short X.Y version.
-version = '0.8.0'
+version = '0.9.0-dev'
 # The full version, including alpha/beta/rc tags.
-release = '0.8.0'
+release = '0.9.0-dev'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -6,7 +6,7 @@
 
 setup(
     name='django-filter',
-    version='0.7',
+    version='0.9.0-dev',
     description=('Django-filter is a reusable Django application for allowing'
                  ' users to filter querysets dynamically.'),
     long_description=readme,


Test patch: