Skip to content

Commit

Permalink
Make the project a proper package.
Browse files Browse the repository at this point in the history
I tried merging in as much as possible from the default-app reposistory.
But there are still a bunch of differences which need to be merged.

https://github.com/maykinmedia/default-app/
  • Loading branch information
Alexander Schrijver committed Apr 20, 2020
1 parent 2bf445b commit 92d928a
Show file tree
Hide file tree
Showing 8 changed files with 227 additions and 5 deletions.
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2020 Maykin Media

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8 changes: 8 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include *.rst
include LICENSE
recursive-include digid_eherkenning *.html
recursive-include digid_eherkenning *.txt
recursive-include digid_eherkenning *.po
global-exclude __pycache__
global-exclude *.py[co]

17 changes: 17 additions & 0 deletions docs/check_sphinx.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import subprocess


def test_linkcheck(tmpdir):
doctrees = tmpdir.join("doctrees")
htmldir = tmpdir.join("html")
subprocess.check_call(
["sphinx-build", "-W", "-blinkcheck", "-d", str(doctrees), ".", str(htmldir)],
)


def test_build_docs(tmpdir):
doctrees = tmpdir.join("doctrees")
htmldir = tmpdir.join("html")
subprocess.check_call(
["sphinx-build", "-W", "-bhtml", "-d", str(doctrees), ".", str(htmldir)],
)
50 changes: 50 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
.. digid_eherkenning documentation master file, created by startproject.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to digid_eherkenning's documentation!
=================================================

|build-status| |black| |coverage|

|python-versions| |django-versions| |pypi-version|

<One liner describing the project>

Features
========

* ...
* ...

.. toctree::
:maxdepth: 2
:caption: Contents:

quickstart



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

.. |build-status| image:: https://travis-ci.org/maykinmedia/digid_eherkenning.svg?branch=master
:target: https://travis-ci.org/maykinmedia/digid_eherkenning

.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black

.. |coverage| image:: https://codecov.io/gh/maykinmedia/digid_eherkenning/branch/master/graph/badge.svg
:target: https://codecov.io/gh/maykinmedia/digid_eherkenning
:alt: Coverage status

.. |python-versions| image:: https://img.shields.io/pypi/pyversions/digid_eherkenning.svg

.. |django-versions| image:: https://img.shields.io/pypi/djversions/digid_eherkenning.svg

.. |pypi-version| image:: https://img.shields.io/pypi/v/digid_eherkenning.svg
:target: https://pypi.org/project/digid_eherkenning/
18 changes: 18 additions & 0 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
==========
Quickstart
==========

Installation
============

Install from PyPI with pip:

.. code-block:: bash
pip install digid_eherkenning
Usage
=====

<document how to use the app here>
78 changes: 73 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,59 @@
[pycodestyle]
[pep8]
ignore=W293,W291,E501,E261
max-line-length=88
exclude=migrations,static,media
# setuptools config
# see http://setuptools.readthedocs.io/en/latest/setuptools.html#configuring-setup-using-setup-cfg-files
[metadata]
name = digid-eherkenning
version = 0.1.0
description = TODO
long_description = file: README.rst
url = https://github.com/maykinmedia/digid_eherkenning
license = MIT
author = Maykin Media
author_email = [email protected]
keywords = TODO
classifiers =
Development Status :: 3 - Alpha
Framework :: Django
Framework :: Django :: 2.2
Framework :: Django :: 3.0
Intended Audience :: Developers
Operating System :: Unix
Operating System :: MacOS
Operating System :: Microsoft :: Windows
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Topic :: Software Development :: Libraries :: Python Modules

[options]
zip_safe = False
include_package_data = True
packages = digid_eherkenning
install_requires =
django
tests_require =
pytest
pytest-django
tox
isort

[options.extras_require]
tests =
pytest
pytest-django
tox
isort
pep8 = flake8
coverage = pytest-cov
docs =
sphinx
sphinx-rtd-theme
release =
bumpversion
twine

# 3rd party configuration

[aliases]
test=pytest

[isort]
combine_as_imports = true
Expand All @@ -16,3 +67,20 @@ not_skip = __init__.py
known_django=django
known_first_party={{ project_name|lower }}
sections=FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER

[tool:pytest]
testpaths = tests
python_classes = test_*
DJANGO_SETTINGS_MODULE=tests.project.settings

[pep8]
max-line-length=88
ignore=W293,W291,E501,E261
exclude=migrations,static,media

[flake8]
max-line-length=88
exclude=env,.tox,doc

[zest.releaser]
create-wheel = yes
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from setuptools import setup

setup()
51 changes: 51 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[tox]
envlist =
py{37,38}-django{11,22,30}
isort
black
; docs
skip_missing_interpreters = true

[travis:env]
DJANGO =
1.11: django11
2.2: django22
3.0: django30

[testenv]
setenv =
DJANGO_SETTINGS_MODULE=testapp.settings
PYTHONPATH={toxinidir}
extras =
tests
coverage
deps =
django11: Django~=1.11.0
django22: Django~=2.2.0
django30: Django~=3.0.0
commands =
py.test tests \
--junitxml=reports/junit.xml \
--cov --cov-report xml:reports/coverage-{envname}.xml \
{posargs}

[testenv:isort]
extras = tests
skipsdist = True
commands = isort --recursive --check-only --diff .

[testenv:black]
extras = tests
skipsdist = True
commands = black --check digid_eherkenning testapp tests setup.py

[testenv:docs]
basepython=python
changedir=doc
skipsdist=true
extras = docs
commands=
py.test check_sphinx.py -v \
--junitxml=../reports/junit-{envname}.xml \
--tb=line \
{posargs}

0 comments on commit 92d928a

Please sign in to comment.