diff --git a/.travis.yml b/.travis.yml index 17d121c..cb151c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,34 +3,44 @@ sudo: false language: python python: - - 3.5 - - 3.6 - - 3.7 - - 3.8 +- 3.5 +- 3.6 +- 3.7 +- 3.8 env: - - TOX_ENV=django3 - - TOX_ENV=django22 - - TOX_ENV=django21 - - TOX_ENV=django20 - - TOX_ENV=django111 +- TOX_ENV=django3 +- TOX_ENV=django22 +- TOX_ENV=django21 +- TOX_ENV=django20 +- TOX_ENV=django111 matrix: include: - - python: 3.6 - env: TOX_ENV=quality + - python: 3.6 + env: TOX_ENV=quality exclude: - - python: 3.5 - env: TOX_ENV=django3 + - python: 3.5 + env: TOX_ENV=django3 before_install: - - pip install -U pip wheel codecov +- pip install -U pip wheel codecov install: - - pip install -r requirements/compatibility.txt +- pip install -r requirements/compatibility.txt script: - - tox -e $TOX_ENV +- tox -e $TOX_ENV after_success: - - codecov +- codecov + +deploy: + provider: pypi + distributions: sdist bdist_wheel + on: + tags: true + condition: $TOXENV = django22 + user: __token__ + password: + secure: tGdkCFLWD5ozKUrR+DalntG0d9jr4ak7nXSO947WuWuc1R2OX7mdlEORKdkmbV35Z32QNnzgwZy4CeNZXw8QBzZC3BOFpHtESel+CxskbeFkF93er4ENT72RyTW4mfQc6JtVMoIsRjjX7WpWNo4QooGhpKtqX4riF8rOZgpkbQT7CDB39DDCf/78E8YS4yPLxePYx57T92k4ysFgrQwZqIlb1tA+4s6pCwyK9qq1SKnBws9q23ADi0RKSi0p7ICYNHYJZoUcj2WIiU1c2Smx3AJywNDGMnb7MUaAnJHTouVQIXpxeOGL7ECESKDtaM/p7yQ0iYGAEBlAesB5lmmHh1kSp0JzyPX+ChNXBd+9HFEbupYaQXlI8MzVGDiHo4EbR0Mu7mEOnuKXTeyLd/4oMSecSAuWU65tNAx+immIQsulT4xmZTpRYVXOkl38X6Cr4/OGgR5cSn23AExrtB9dGKTGm4zqj9S0U3qeZy7Qq5ZXke9FTI7P7Px3Y9HyX/ke6Pmo7KIac2mzME9tCx0cDNSj+BTL/frAO/nyCnd2k/peZXbo5Tod4hiZt01xc1B5++XU8yDQjtXwdDWWmHXkS8uTwu8S3SDGa42Snor9s+UDG86aHPq1H7PJPTThMyVTd46uv3+oeg+5kphFGi2kKwB3fKuCSK4tX4lEwA8fu6o= diff --git a/Makefile b/Makefile index 2296d89..2bed60e 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ help: ## display this help message @echo "Please use \`make ' where is one of" @grep '^[a-zA-Z]' $(MAKEFILE_LIST) | sort | awk -F ':.*?## ' 'NF==2 {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}' -clean: clean-pyc clean-test ## Remove all build, test, coverage and Python artifacts +clean: clean-pyc clean-test clean-docs-build ## Remove all build, test, coverage and Python artifacts clean-pyc: ## Remove Python file artifacts find . -name '*.pyc' -exec rm -f {} + @@ -29,9 +29,19 @@ clean-test: ## Remove test and coverage artifacts rm -fr .pytest_cache rm -fr *.egg-info/ +clean-docs-build: ## Remove docs and build artifacts + rm -fr build/ + rm -fr dist/ + +docs-requirements: ## Install docs requirements + pip3 install -qr requirements/docs.txt + requirements: ## Install development requirements pip3 install -r requirements/dev.txt +build: docs-requirements ## Build the project + python setup.py bdist_wheel + venv: ## Create a virtual env and install test and production requirements python3 -m venv $(VENV) source $(VENV)/bin/activate @@ -43,6 +53,7 @@ upgrade: ## Upgrade requirement pins. pip-compile requirements/base.in --rebuild --upgrade -o requirements/base.txt pip-compile requirements/test.in --rebuild --upgrade -o requirements/test.txt pip-compile requirements/quality.in --rebuild --upgrade -o requirements/quality.txt + pip-compile requirements/docs.in --rebuild --upgrade -o requirements/docs.txt pip-compile requirements/compatibility.in --rebuild --upgrade -o requirements/compatibility.txt pip-compile requirements/dev.in --rebuild --upgrade -o requirements/dev.txt pip-compile requirements/pip-tools.in --rebuild --upgrade -o requirements/pip-tools.txt @@ -64,3 +75,6 @@ test-quality: ## Uses pep8 to check the quality of Code test-python: ## Run python tests python -Wd -m pytest + +test-docs: build ## Run docs tests + twine check dist/* diff --git a/django_view_permissions/__init__.py b/django_view_permissions/__init__.py index ba4a350..ff66f61 100644 --- a/django_view_permissions/__init__.py +++ b/django_view_permissions/__init__.py @@ -1,4 +1,4 @@ """ Grants the ability to allow or block django view access based on user group. """ -VERSION = '0.0.1-dev' +VERSION = '0.0.dev0' diff --git a/requirements/dev.in b/requirements/dev.in index 3e56e37..ce9c6b8 100644 --- a/requirements/dev.in +++ b/requirements/dev.in @@ -8,3 +8,4 @@ -r test.txt -r quality.txt -r compatibility.txt +-r docs.txt diff --git a/requirements/dev.txt b/requirements/dev.txt index 8881ea9..7cfdc0d 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -7,10 +7,15 @@ appdirs==1.4.3 # via -r requirements/compatibility.txt, virtualenv astroid==2.3.3 # via -r requirements/quality.txt, pylint attrs==19.3.0 # via -r requirements/test.txt, pytest -coverage==5.0.3 # via -r requirements/test.txt, pytest-cov +bleach==3.1.1 # via -r requirements/docs.txt, readme-renderer +certifi==2019.11.28 # via -r requirements/docs.txt, requests +chardet==3.0.4 # via -r requirements/docs.txt, requests +coverage==5.0.4 # via -r requirements/test.txt, pytest-cov distlib==0.3.0 # via -r requirements/compatibility.txt, virtualenv django==2.2.11 # via -r requirements/base.txt, -r requirements/test.txt +docutils==0.16 # via -r requirements/docs.txt, readme-renderer filelock==3.0.12 # via -r requirements/compatibility.txt, tox, virtualenv +idna==2.9 # via -r requirements/docs.txt, requests importlib-metadata==1.5.0 # via -r requirements/compatibility.txt, -r requirements/test.txt, importlib-resources, pluggy, pytest, tox, virtualenv importlib-resources==1.3.1 # via -r requirements/compatibility.txt, virtualenv isort==4.3.21 # via -r requirements/quality.txt, pylint @@ -19,22 +24,35 @@ mccabe==0.6.1 # via -r requirements/quality.txt, pylint more-itertools==8.2.0 # via -r requirements/test.txt, pytest packaging==20.3 # via -r requirements/compatibility.txt, -r requirements/test.txt, pytest, tox pathlib2==2.3.5 # via -r requirements/test.txt, pytest +pkginfo==1.5.0.1 # via -r requirements/docs.txt, twine pluggy==0.13.1 # via -r requirements/compatibility.txt, -r requirements/test.txt, pytest, tox py==1.8.1 # via -r requirements/compatibility.txt, -r requirements/test.txt, pytest, tox pycodestyle==2.5.0 # via -r requirements/quality.txt +pygments==2.6.1 # via -r requirements/docs.txt, readme-renderer pylint==2.4.4 # via -r requirements/quality.txt pyparsing==2.4.6 # via -r requirements/compatibility.txt, -r requirements/test.txt, packaging pytest-cov==2.8.1 # via -r requirements/test.txt pytest-django==3.8.0 # via -r requirements/test.txt pytest==5.4.1 # via -r requirements/test.txt, pytest-cov, pytest-django pytz==2019.3 # via -r requirements/base.txt, -r requirements/test.txt, django -six==1.14.0 # via -r requirements/compatibility.txt, -r requirements/quality.txt, -r requirements/test.txt, astroid, packaging, pathlib2, tox, virtualenv +readme-renderer==25.0 # via -r requirements/docs.txt, twine +requests-toolbelt==0.9.1 # via -r requirements/docs.txt, twine +requests==2.23.0 # via -r requirements/docs.txt, requests-toolbelt, twine +six==1.14.0 # via -r requirements/compatibility.txt, -r requirements/docs.txt, -r requirements/quality.txt, -r requirements/test.txt, astroid, bleach, packaging, pathlib2, readme-renderer, tox, virtualenv sqlparse==0.3.1 # via -r requirements/base.txt, -r requirements/test.txt, django toml==0.10.0 # via -r requirements/compatibility.txt, tox tox-battery==0.5.2 # via -r requirements/compatibility.txt tox==3.14.5 # via -r requirements/compatibility.txt, tox-battery +tqdm==4.43.0 # via -r requirements/docs.txt, twine +twine==1.15.0 # via -r requirements/docs.txt typed-ast==1.4.1 # via -r requirements/quality.txt, astroid +urllib3==1.25.8 # via -r requirements/docs.txt, requests virtualenv==20.0.10 # via -r requirements/compatibility.txt, tox wcwidth==0.1.8 # via -r requirements/test.txt, pytest +webencodings==0.5.1 # via -r requirements/docs.txt, bleach +wheel==0.34.2 # via -r requirements/docs.txt wrapt==1.11.2 # via -r requirements/quality.txt, astroid zipp==1.2.0 # via -r requirements/compatibility.txt, -r requirements/test.txt, importlib-metadata, importlib-resources + +# The following packages are considered to be unsafe in a requirements file: +# setuptools diff --git a/requirements/docs.in b/requirements/docs.in new file mode 100644 index 0000000..2f7cd83 --- /dev/null +++ b/requirements/docs.in @@ -0,0 +1,8 @@ +# # # # # # # # # # # +# +# Docs Requirements. +# +# # # # # # # # # # # + +twine +wheel \ No newline at end of file diff --git a/requirements/docs.txt b/requirements/docs.txt new file mode 100644 index 0000000..80c70e8 --- /dev/null +++ b/requirements/docs.txt @@ -0,0 +1,25 @@ +# +# This file is autogenerated by pip-compile +# To update, run: +# +# make upgrade +# +bleach==3.1.1 # via readme-renderer +certifi==2019.11.28 # via requests +chardet==3.0.4 # via requests +docutils==0.16 # via readme-renderer +idna==2.9 # via requests +pkginfo==1.5.0.1 # via twine +pygments==2.6.1 # via readme-renderer +readme-renderer==25.0 # via twine +requests-toolbelt==0.9.1 # via twine +requests==2.23.0 # via requests-toolbelt, twine +six==1.14.0 # via bleach, readme-renderer +tqdm==4.43.0 # via twine +twine==1.15.0 # via -r requirements/docs.in +urllib3==1.25.8 # via requests +webencodings==0.5.1 # via bleach +wheel==0.34.2 # via -r requirements/docs.in + +# The following packages are considered to be unsafe in a requirements file: +# setuptools diff --git a/requirements/test.txt b/requirements/test.txt index ee2bb29..7162c00 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -5,7 +5,7 @@ # make upgrade # attrs==19.3.0 # via pytest -coverage==5.0.3 # via pytest-cov +coverage==5.0.4 # via pytest-cov importlib-metadata==1.5.0 # via pluggy, pytest more-itertools==8.2.0 # via pytest packaging==20.3 # via pytest diff --git a/setup.cfg b/setup.cfg index ac5e6ca..66f0e06 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,6 @@ +[wheel] +universal = 1 + [pycodestyle] exclude=.git,.venv,.tox, .env max-line-length=90 diff --git a/setup.py b/setup.py index 5655206..8de5153 100644 --- a/setup.py +++ b/setup.py @@ -48,17 +48,18 @@ def is_requirement(line): setup( name='django-view-permissions', version=VERSION, - author='Ayub-khan', + author='ayub-khan', author_email='muhammadayubkhan6@gmail.com', url='https://github.com/Ayub-Khan/django-view-permissions', description='Utility to handle django view access', long_description=README + '\n\n' + CHANGELOG, + long_description_content_type='text/x-rst', packages=find_packages(exclude=['tests']), license='Apache Software License 2.0', keywords='Django view permissions user', install_requires=load_requirements('requirements/base.in'), - tests_requires=load_requirements('requirements/test.in'), zip_safe=False, + python_requires='>=3.5', classifiers=[ 'Development Status :: 3 - Alpha', 'Framework :: Django', @@ -66,10 +67,11 @@ def is_requirement(line): 'Framework :: Django :: 2.0', 'Framework :: Django :: 2.1', 'Framework :: Django :: 2.2', - 'Framework :: Django :: 3.0' + 'Framework :: Django :: 3.0', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Natural Language :: English', + "Operating System :: OS Independent", 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6',