jazzband / django-dbbackup

Management commands to help backup and restore your project database and media files
BSD 3-Clause "New" or "Revised" License
986 stars 220 forks source link

Track version in git tags #76

Closed ZuluPro closed 8 years ago

ZuluPro commented 9 years ago

It should be a great thing to track version number in git tags, like in Django project.

I think a little script which register to PyPi, create tag and push it will do the job. (Don't use setup.py register, it doesn't use HTTPS and send your credentials, there's twine for this)

Small question in passing: I saw last version is 2.0.5 alpha: https://pypi.python.org/pypi/django-dbbackup/2.0.5a We do not have history before Bitbucket import, do you really think this version number is appropriate ?

benjaoming commented 9 years ago

:+1:

Perhaps use a Makefile inspired by the way that cookiecutter-pypackage configures things?

https://github.com/Nekroze/cookiecutter-pypackage

benjaoming commented 9 years ago

The best way to implement these conventions in our project that I know of, would be a Makefile.

So we'd have make release version=1.2.3

release: clean
    git tag $(version)
    git push --tags
    python setup.py sdist upload --sign

(should use twine of course, but I haven't made the switch)

pkkid commented 9 years ago

Don't forget to update the dbbackup/init.py file, or maybe remove the variables in there if they are no longer needed.

benjaoming commented 9 years ago

Yup, good point, no idea how to script it, though.

benjaoming commented 9 years ago

One idea would be to do like django's get_version and always keep a date-based version in dbbackup/__init__.py

Then only when releasing, making an amendment to the third version component that isn't actually committed.

Here's how twine is used: https://github.com/Bernardo-MG/cookiecutter-python-library/tree/master/%7B%7Bcookiecutter.repo_name%7D%7D