To contribute to this package, clone it and install it into a virtual environment:
$ git clone git@github.com:Styria-Digital/django-rest-framework-jwt.git
$ cd django-rest-framework-jwt.git
$ pip install -e .[dev]The most important dependency is tox.
It's already listed as a dev dependency so it should be installed if the
previous command was run. To check the current tox version, type:
$ pip show toxIf it is not installed, type:
$ pip install toxYou can use the demo project as you would any other Django project by running $ tox -e serve.
This creates a separate tox environment and executes the runserver command using the development settings.
If you want to pass additional arguments, e.g. your custom settings, use the following syntax:
$ tox -e serve -- --settings=demo.settings.dev-customTo run the test suite against current virtual environment run the pytest while adding the demo and src directories to PYTHONPATH:
$ PYTHONPATH=${PYTHONPATH}:./demo:./src/ pytestThe whole test suite can be run using tox:
$ toxor for a specific environment configuration (with coverage):
$ tox -e py27-dj111-drf37 -- --cov=rest_framework_jwtThis project uses towncrier
for management of changelogs. You don't need to install it yourself since
you'll be using it through tox, but please adhere to the following rules:
- For each pull request, create a new file in the
changelog.ddirectory with a filename adhering to the#mr.(feature|bugfix|doc|removal|misc).mdschema. For example,changelog.d/77.bugfix.mdthat is submitted in the pull request 77.towncrierwill automatically add a link to the note when building the final changelog. - Wrap symbols like modules, functions, or classes into backticks so they are rendered in a monospace font.
- If you mention functions or other callables, add parentheses at the end of
their names:
func()orClass.method(). This makes the changelog a lot more readable.
tox -e changelog -- --draft will render the current changelog to the terminal
if you have any doubts.
To build the documentation, run the following command:
$ tox -e docsTo deploy documentation to GitHub run:
$ mkdocs gh-deployThe documentation should be available in /html/index.html.
The CI environment should build packages and upload them to the PyPI server
when a tag is pushed to origin. Therefore, if you want to make a new release,
all you have to do is execute the release environment in tox:
$ tox -e releaseThis environment will merge the changelogs from the changelog.d directory
into CHANGELOG.md, bump the minor version (by default)
using bumpversion, commit the
changes, create a tag and push the changes and the tags to origin.
If you want to make a patch release, type:
$ tox -e release -- patchIf Travis CI builds were successful release should be automatically uploaded to PyPI.org.