Verified Commit 6ece587c authored by Philipp Sebastian Sommer's avatar Philipp Sebastian Sommer
Browse files

minor fix for descriptions and config files

parent 5725b45c
# https://pre-commit.com/
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
# isort should run before black as black sometimes tweaks the isort output
- repo: https://github.com/PyCQA/isort
rev: 5.9.3
hooks:
- id: isort
args:
- --profile
- black
- --line-length
- "79"
- --filter-files
- -skip-gitignore
- --float-to-top
- -p
- demessaging
# https://github.com/python/black#version-control-integration
- repo: https://github.com/psf/black
rev: 21.9b0
hooks:
- id: black
- repo: https://github.com/keewis/blackdoc
rev: v0.3.4
hooks:
- id: blackdoc
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910
hooks:
- id: mypy
# Copied from setup.cfg
args: [--ignore-missing-imports]
additional_dependencies: [pydantic]
......@@ -96,6 +96,56 @@ are missing something, please do not hesitate to ask.
Running the tests
-----------------
Just run ``tox`` (you installed it with ``pip install .[dev]``).
Note that you will need a running postgres server and a user with the rights
to create a new postgres database.
Contributing
------------
We are working on a more detailed contributing guide, but here is the
short version:
When you want to contribute to the code, please do clone the source code
repository and install it with the ``[dev]`` extra, i.e.
.. code:: bash
git clone https://gitlab.hzdr.de/hcdc/django/clm-community/django-academic-community/
cd django-academic-community
pip install -e .[dev]
We use automated formatters (see their config in ``pyproject.toml`` and
``setup.cfg``), namely
- `Black <https://black.readthedocs.io/en/stable/>`__ for standardized
code formatting
- `blackdoc <https://blackdoc.readthedocs.io/en/stable/>`__ for
standardized code formatting in documentation
- `Flake8 <http://flake8.pycqa.org/en/latest/>`__ for general code
quality
- `isort <https://github.com/PyCQA/isort>`__ for standardized order in
imports.
- `mypy <http://mypy-lang.org/>`__ for static type checking on `type
hints <https://docs.python.org/3/library/typing.html>`__
We highly recommend that you setup `pre-commit
hooks <https://pre-commit.com/>`__ to automatically run all the above
tools every time you make a git commit. This can be done by running
::
pre-commit install
from the root of the repository. You can skip the pre-commit checks with
``git commit --no-verify`` but note that the CI will fail if it
encounters any formatting errors.
You can also run the pre-commit step manually by invoking
::
pre-commit run --all-files
Copyright
......
......@@ -8,3 +8,4 @@ known_first_party = "academic_community"
[tool.black]
line-length = 79
target-version = ['py38']
exclude = "migrations"
......@@ -3,6 +3,7 @@ name = django-academic-community
version = 0.1.0
description = A Django app to manage members, topics and more in an academic community
long_description = file: README.rst
long_description_content_type = text/x-rst
url = https://coastgit.hzg.de/HCDC/django/django-academic-community
author = Phiilpp S. Sommer
author_email = philipp.sommer@hzg.de
......@@ -77,17 +78,13 @@ exclude =
[options.extras_require]
testsite =
requests
psycopg2-binary
types-requests
dev =
tox
requests
types-requests
pytest
pytest-cov
pytest-lazy-fixture
pytest-django
pyodbc
isort==5.9.3
black==21.9b0
blackdoc==0.3.4
......@@ -95,6 +92,10 @@ dev =
pre-commit
mypy
django-stubs
dev =
%(testsite)s
sphinx
sphinxcontrib-django
......@@ -184,4 +185,4 @@ ignore =
E203 # whitespace before ':' - doesn't work well with black
E402 # module level import not at top of file
E501 # line too long - let black worry about that
W503 # line break before binary operator
\ No newline at end of file
W503 # line break before binary operator
......@@ -14,13 +14,6 @@ passenv =
PSQL_HOST
deps =
pytest
pytest-lazy-fixture
pytest-django
pytest-cov
mypy
django-stubs
black
psycopg2
extras =
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment