Improve Makefile to handle VENV creation if needed.

This commit is contained in:
Rémy HUBSCHER 2019-08-20 12:09:41 +02:00
parent d3534d656d
commit 4e84b6d7bd
No known key found for this signature in database
GPG key ID: 82B47F36036A312A
4 changed files with 33 additions and 21 deletions

1
.gitignore vendored
View file

@ -9,3 +9,4 @@ htmlcov/
docs/_build/
.idea/
.eggs/
.venv/

View file

@ -1,21 +1,32 @@
VIRTUALENV = virtualenv --python=python3
PYTHON = $(VENV)/bin/python
VENV := $(shell echo $${VIRTUAL_ENV-.venv})
INSTALL_STAMP = $(VENV)/.install.stamp
all: init docs test
init:
python setup.py develop
pip install tox coverage Sphinx
init: $(INSTALL_STAMP)
$(INSTALL_STAMP): $(PYTHON) setup.py
$(VENV)/bin/pip install -e .
$(VENV)/bin/pip install tox coverage Sphinx
touch $(INSTALL_STAMP)
test:
coverage erase
tox
coverage html
virtualenv: $(PYTHON)
$(PYTHON):
$(VIRTUALENV) $(VENV)
test: init
$(VENV)/bin/coverage erase
$(VENV)/bin/tox
$(VENV)/bin/coverage html
docs: documentation
documentation:
python setup.py build_sphinx
documentation: init
$(PYTHON) setup.py build_sphinx
messages:
python translations.py make
messages: init
$(PYTHON) translations.py make
compilemessages:
python translations.py compile
compilemessages: init
$(PYTHON) translations.py compile

View file

@ -66,7 +66,7 @@ field changes:
(A ``MonitorField`` can monitor any type of field for changes, not only a
``StatusField``.)
If a list is passed to the ``when`` parameter, the field will only
If a list is passed to the ``when`` parameter, the field will only
update when it matches one of the specified values:
.. code-block:: python
@ -159,16 +159,16 @@ be the excerpt. This number can be customized by setting the
UUIDField
----------
A ``UUIDField`` subclass that provides an UUID field. You can
add this field to any model definition.
A ``UUIDField`` subclass that provides an UUID field. You can
add this field to any model definition.
With the param ``primary_key`` you can set if this field is the
With the param ``primary_key`` you can set if this field is the
primary key for the model, default is True.
Param ``version`` is an integer that set default UUID version.
Param ``version`` is an integer that set default UUID version.
Versions 1,3,4 and 5 are supported, default is 4.
If ``editable`` is set to false the field will not be displayed in the admin
If ``editable`` is set to false the field will not be displayed in the admin
or any other ModelForm, default is False.

View file

@ -94,8 +94,8 @@ UUIDModel
This abstract base class provides ``id`` field on any model that inherits from it
which will be the primary key.
If you dont want to set ``id`` as primary key or change the field name, you can be override it
with our `UUIDField`_
If you dont want to set ``id`` as primary key or change the field name, you can be override it
with our `UUIDField`_
Also you can override the default uuid version. Versions 1,3,4 and 5 are now supported.