Skip to content
Snippets Groups Projects
Verified Commit 9e67ee74 authored by Philipp S. Sommer's avatar Philipp S. Sommer
Browse files

rename project to dasf-broker-django

and the app to dasf_broker
parent 0640d7f9
No related branches found
No related tags found
No related merge requests found
Pipeline #150239 passed
Showing with 50 additions and 50 deletions
django_dasf_broker/_version.py export-subst
dasf_broker/_version.py export-subst
......@@ -140,4 +140,4 @@ cython_debug/
static/
docs/api
django_dasf_broker/migrations/00*.py
dasf_broker/migrations/00*.py
......@@ -33,7 +33,7 @@ repos:
- migrations
- --exclude
- venv
- django_dasf_broker
- dasf_broker
- testproject
- repo: https://github.com/keewis/blackdoc
rev: v0.3.4
......
include versioneer.py
include django_dasf_broker/_version.py
include dasf_broker/_version.py
......@@ -48,19 +48,19 @@ clean-test: ## remove test and coverage artifacts
rm -fr .pytest_cache
lint/isort: ## check style with flake8
isort --skip migrations --check django_dasf_broker tests
isort --skip migrations --check dasf_broker tests
lint/flake8: ## check style with flake8
flake8 --exclude migrations django_dasf_broker tests
flake8 --exclude migrations dasf_broker tests
lint/black: ## check style with black
black --exclude migrations --check django_dasf_broker tests
blackdoc --exclude migrations --check django_dasf_broker tests
black --exclude migrations --check dasf_broker tests
blackdoc --exclude migrations --check dasf_broker tests
lint: lint/isort lint/black lint/flake8 ## check style
formatting:
isort --skip migrations django_dasf_broker tests
black --exclude migrations django_dasf_broker tests
blackdoc --exclude migrations django_dasf_broker tests
isort --skip migrations dasf_broker tests
black --exclude migrations dasf_broker tests
blackdoc --exclude migrations dasf_broker tests
test: ## run tests quickly with the default Python
pytest
......@@ -69,14 +69,14 @@ test-all: ## run tests on every Python version with tox
tox
coverage: ## check code coverage quickly with the default Python
coverage run --source django_dasf_broker -m pytest
coverage run --source dasf_broker -m pytest
coverage report -m
coverage html
$(BROWSER) htmlcov/index.html
docs: ## generate Sphinx HTML documentation, including API docs
rm -rf docs/api
sphinx-apidoc -o docs/api/ django_dasf_broker
sphinx-apidoc -o docs/api/ dasf_broker
$(MAKE) -C docs clean
$(MAKE) -C docs html
$(BROWSER) docs/_build/html/index.html
......
......@@ -11,13 +11,13 @@ Install this package in a dedicated python environment via::
python -m venv venv
source venv/bin/activate
pip install django-dasf-broker
pip install dasf-broker-django
To use this in a development setup, clone the `source code`_ from gitlab, start
the development server and make your changes::
git clone https://gitlab.hzdr.de/hcdc/django/django-dasf-broker
cd django-dasf-broker
git clone https://gitlab.hzdr.de/hcdc/django/dasf-broker-django
cd dasf-broker-django
python -m venv venv
source venv/bin/activate
make dev-install
......@@ -27,8 +27,8 @@ More detailed installation instructions my be found in the docs_.
.. _source code: https://gitlab.hzdr.de/hcdc/django/django-dasf-broker
.. _docs: https://django-dasf-broker.readthedocs.io/en/latest/installation.html
.. _source code: https://gitlab.hzdr.de/hcdc/django/dasf-broker-django
.. _docs: https://dasf-broker-django.readthedocs.io/en/latest/installation.html
Copyright
......
"""pytest configuration script for django-dasf-broker."""
"""pytest configuration script for dasf-broker-django."""
# Disclaimer
# ----------
#
# Copyright (C) 2022 Helmholtz-Zentrum Hereon
#
# This file is part of the project django-dasf-broker
# This file is part of the project dasf-broker-django
# and is released under the EUPL-1.2 license. See LICENSE in the root of the
# repository for full licensing details.
#
......
......@@ -8,7 +8,7 @@ A Django-based message broker for the Data Analytics Software Framework (DASF)
#
# Copyright (C) 2022 Helmholtz-Zentrum Hereon
#
# This file is part of django-dasf-broker and is released under the
# This file is part of dasf-broker-django and is released under the
# EUPL-1.2 license.
# See LICENSE in the root of the repository for full licensing details.
#
......
......@@ -15,7 +15,7 @@
#
# Copyright (C) 2022 Helmholtz-Zentrum Hereon
#
# This file is part of django-dasf-broker and is released under the
# This file is part of dasf-broker-django and is released under the
# EUPL-1.2 license.
# See LICENSE in the root of the repository for full licensing details.
#
......@@ -65,8 +65,8 @@ def get_config():
cfg.VCS = "git"
cfg.style = "pep440"
cfg.tag_prefix = "v"
cfg.parentdir_prefix = "django-dasf-broker-"
cfg.versionfile_source = "django_dasf_broker/_version.py"
cfg.parentdir_prefix = "dasf-broker-django-"
cfg.versionfile_source = "dasf_broker/_version.py"
cfg.verbose = False
return cfg
......
"""Admin interfaces
----------------
This module defines the django-dasf-broker
This module defines the dasf-broker-django
Admin interfaces.
"""
......@@ -10,7 +10,7 @@ Admin interfaces.
#
# Copyright (C) 2022 Helmholtz-Zentrum Hereon
#
# This file is part of django-dasf-broker and is released under the
# This file is part of dasf-broker-django and is released under the
# EUPL-1.2 license.
# See LICENSE in the root of the repository for full licensing details.
#
......@@ -30,12 +30,12 @@ Admin interfaces.
from django.contrib import admin # noqa: F401
from guardian.admin import GuardedModelAdmin
from django_dasf_broker import models # noqa: F401
from dasf_broker import models # noqa: F401
@admin.register(models.DASFTopic)
class DASFTopicAdmin(GuardedModelAdmin):
"""An admin for :model:`django_dasf_broker.DASFTopic"""
"""An admin for :model:`dasf_broker.DASFTopic"""
search_fields = [
"slug",
......
......@@ -2,7 +2,7 @@
------------
This module defines the settings options for the
``django-dasf-broker`` app.
``dasf-broker-django`` app.
"""
......@@ -11,7 +11,7 @@ This module defines the settings options for the
#
# Copyright (C) 2022 Helmholtz-Zentrum Hereon
#
# This file is part of django-dasf-broker and is released under the
# This file is part of dasf-broker-django and is released under the
# EUPL-1.2 license.
# See LICENSE in the root of the repository for full licensing details.
#
......
"""App config
----------
App config for the django_dasf_broker app.
App config for the dasf_broker app.
"""
# Disclaimer
......@@ -9,7 +9,7 @@ App config for the django_dasf_broker app.
#
# Copyright (C) 2022 Helmholtz-Zentrum Hereon
#
# This file is part of django-dasf-broker and is released under the
# This file is part of dasf-broker-django and is released under the
# EUPL-1.2 license.
# See LICENSE in the root of the repository for full licensing details.
#
......@@ -31,4 +31,4 @@ from django.apps import AppConfig
class DjangoHelmholtzAaiConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "django_dasf_broker"
name = "dasf_broker"
......@@ -9,7 +9,7 @@ Constants from :mod:`demessaging.PulsarMessageConstants`.
#
# Copyright (C) 2022 Helmholtz-Zentrum Hereon
#
# This file is part of django-dasf-broker and is released under the
# This file is part of dasf-broker-django and is released under the
# EUPL-1.2 license.
# See LICENSE in the root of the repository for full licensing details.
#
......
"""Models
------
Consumers for the django-dasf-broker app.
Consumers for the dasf-broker-django app.
"""
# Disclaimer
......@@ -9,7 +9,7 @@ Consumers for the django-dasf-broker app.
#
# Copyright (C) 2022 Helmholtz-Zentrum Hereon
#
# This file is part of django-dasf-broker and is released under the
# This file is part of dasf-broker-django and is released under the
# EUPL-1.2 license.
# See LICENSE in the root of the repository for full licensing details.
#
......@@ -36,10 +36,10 @@ from django.shortcuts import get_object_or_404
from django.utils.functional import cached_property
from guardian.shortcuts import assign_perm, get_anonymous_user
from django_dasf_broker.constants import PropertyKeys
from dasf_broker.constants import PropertyKeys
if TYPE_CHECKING:
from django_dasf_broker.models import DASFTopic
from dasf_broker.models import DASFTopic
class TopicProducer(JsonWebsocketConsumer):
......@@ -47,7 +47,7 @@ class TopicProducer(JsonWebsocketConsumer):
@cached_property
def dasf_topic(self) -> DASFTopic:
from django_dasf_broker.models import DASFTopic
from dasf_broker.models import DASFTopic
return get_object_or_404(DASFTopic, slug=self.dasf_topic_slug)
......@@ -60,10 +60,10 @@ class TopicProducer(JsonWebsocketConsumer):
def receive_json(self, content: Dict):
"""Distibute the message to the consumers."""
from django_dasf_broker.models import DASFTopic
from dasf_broker.models import DASFTopic
if self.dasf_topic.is_public or self.user.has_perm(
"django_dasf_broker.can_publish", self.dasf_topic
"dasf_broker.can_publish", self.dasf_topic
):
# create a topic for the response
props = content["properties"]
......@@ -102,7 +102,7 @@ class TopicConsumer(JsonWebsocketConsumer):
@property
def dasf_topic(self) -> DASFTopic:
from django_dasf_broker.models import DASFTopic
from dasf_broker.models import DASFTopic
return get_object_or_404(DASFTopic, slug=self.dasf_topic_slug)
......@@ -122,7 +122,7 @@ class TopicConsumer(JsonWebsocketConsumer):
def receive_json(self, content, **kwargs):
# delete response topic from database
if self.dasf_topic.is_public or self.user.has_perm(
"django_dasf_broker.can_publish", self.dasf_topic
"dasf_broker.can_publish", self.dasf_topic
):
if self.dasf_topic.is_response_topic:
self.dasf_topic.delete()
......
......@@ -3,7 +3,7 @@
#
# Copyright (C) 2022 Helmholtz-Zentrum Hereon
#
# This file is part of django-dasf-broker and is released under the
# This file is part of dasf-broker-django and is released under the
# EUPL-1.2 license.
# See LICENSE in the root of the repository for full licensing details.
#
......
"""Models
------
Models for the django-dasf-broker app.
Models for the dasf-broker-django app.
"""
# Disclaimer
......@@ -9,7 +9,7 @@ Models for the django-dasf-broker app.
#
# Copyright (C) 2022 Helmholtz-Zentrum Hereon
#
# This file is part of django-dasf-broker and is released under the
# This file is part of dasf-broker-django and is released under the
# EUPL-1.2 license.
# See LICENSE in the root of the repository for full licensing details.
#
......@@ -31,7 +31,7 @@ from __future__ import annotations
from django.contrib.auth import get_user_model
from django.db import models # noqa: F401
from django_dasf_broker import app_settings # noqa: F401
from dasf_broker import app_settings # noqa: F401
class DASFTopic(models.Model):
......
File moved
File moved
"""Tests for the :mod:`django_dasf_broker` app.
"""Tests for the :mod:`dasf_broker` app.
"""
# Disclaimer
# ----------
#
# Copyright (C) 2022 Helmholtz-Zentrum Hereon
#
# This file is part of django-dasf-broker and is released under the
# This file is part of dasf-broker-django and is released under the
# EUPL-1.2 license.
# See LICENSE in the root of the repository for full licensing details.
#
......
"""Tests for the django-dasf-broker models
"""Tests for the dasf-broker-django models
---------------------------------------
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment