diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..81c4998 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,23 @@ +name: Test +on: + - push + - pull_request +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + python-version: ["3.10"] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install django + - name: Lint with tox + run: python manage.py test diff --git a/OSSDB_web/__init__.py b/FOSSDB_web/__init__.py similarity index 100% rename from OSSDB_web/__init__.py rename to FOSSDB_web/__init__.py diff --git a/FOSSDB_web/apps/fossdb/__init__.py b/FOSSDB_web/apps/fossdb/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/FOSSDB_web/apps/fossdb/admin.py b/FOSSDB_web/apps/fossdb/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/FOSSDB_web/apps/fossdb/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/FOSSDB_web/apps/fossdb/apps.py b/FOSSDB_web/apps/fossdb/apps.py new file mode 100644 index 0000000..6c8b002 --- /dev/null +++ b/FOSSDB_web/apps/fossdb/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class FossdbConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'fossdb' diff --git a/FOSSDB_web/apps/fossdb/migrations/__init__.py b/FOSSDB_web/apps/fossdb/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/FOSSDB_web/apps/fossdb/models.py b/FOSSDB_web/apps/fossdb/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/FOSSDB_web/apps/fossdb/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/FOSSDB_web/apps/fossdb/tests.py b/FOSSDB_web/apps/fossdb/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/FOSSDB_web/apps/fossdb/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/FOSSDB_web/apps/fossdb/views.py b/FOSSDB_web/apps/fossdb/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/FOSSDB_web/apps/fossdb/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/OSSDB_web/asgi.py b/FOSSDB_web/asgi.py similarity index 73% rename from OSSDB_web/asgi.py rename to FOSSDB_web/asgi.py index 748bf18..e090765 100644 --- a/OSSDB_web/asgi.py +++ b/FOSSDB_web/asgi.py @@ -1,5 +1,5 @@ """ -ASGI config for OSSDB_web project. +ASGI config for FOSSDB_web project. It exposes the ASGI callable as a module-level variable named ``application``. @@ -11,6 +11,6 @@ import os from django.core.asgi import get_asgi_application -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "OSSDB_web.settings") +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "FOSSDB_web.settings") application = get_asgi_application() diff --git a/OSSDB_web/settings.py b/FOSSDB_web/settings.py similarity index 94% rename from OSSDB_web/settings.py rename to FOSSDB_web/settings.py index fb01332..34fb5ca 100644 --- a/OSSDB_web/settings.py +++ b/FOSSDB_web/settings.py @@ -1,5 +1,5 @@ """ -Django settings for OSSDB_web project. +Django settings for FOSSDB_web project. Generated by "django-admin startproject" using Django 4.0.5. @@ -16,7 +16,7 @@ from pathlib import Path # Build paths inside the project like this: BASE_DIR / "subdir". BASE_PATH = Path(__file__).resolve().parent.parent -sys.path.insert(0, str(BASE_PATH.joinpath("OSSDB_web", "apps"))) +sys.path.insert(0, str(BASE_PATH.joinpath("FOSSDB_web", "apps"))) # SECURITY WARNING: don't run with debug turned on in production! @@ -55,7 +55,7 @@ MIDDLEWARE = [ "django.middleware.clickjacking.XFrameOptionsMiddleware", ] -ROOT_URLCONF = "OSSDB_web.urls" +ROOT_URLCONF = "FOSSDB_web.urls" TEMPLATES = [ { @@ -73,7 +73,7 @@ TEMPLATES = [ }, ] -WSGI_APPLICATION = "OSSDB_web.wsgi.application" +WSGI_APPLICATION = "FOSSDB_web.wsgi.application" # Database diff --git a/OSSDB_web/urls.py b/FOSSDB_web/urls.py similarity index 100% rename from OSSDB_web/urls.py rename to FOSSDB_web/urls.py diff --git a/OSSDB_web/wsgi.py b/FOSSDB_web/wsgi.py similarity index 73% rename from OSSDB_web/wsgi.py rename to FOSSDB_web/wsgi.py index 3d213a5..3d462f8 100644 --- a/OSSDB_web/wsgi.py +++ b/FOSSDB_web/wsgi.py @@ -1,5 +1,5 @@ """ -WSGI config for OSSDB_web project. +WSGI config for FOSSDB_web project. It exposes the WSGI callable as a module-level variable named ``application``. @@ -11,6 +11,6 @@ import os from django.core.wsgi import get_wsgi_application -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "OSSDB_web.settings") +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "FOSSDB_web.settings") application = get_wsgi_application() diff --git a/manage.py b/manage.py index 38cfeeb..94b8cd0 100755 --- a/manage.py +++ b/manage.py @@ -6,7 +6,7 @@ import sys def main(): """Run administrative tasks.""" - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'OSSDB_web.settings') + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "FOSSDB_web.settings") try: from django.core.management import execute_from_command_line except ImportError as exc: @@ -18,5 +18,5 @@ def main(): execute_from_command_line(sys.argv) -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/pyproject.toml b/pyproject.toml index d6b34aa..53ca1a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" check_untyped_defs = true disallow_any_generics = true ignore_missing_imports = true -mypy_path = "OSSDB_web" +mypy_path = "FOSSDB_web" no_implicit_optional = true no_implicit_reexport = true show_error_codes = true diff --git a/requirements.txt b/requirements.txt index 5f91e93..6f74b38 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ Django==4.1 fontawesomefree==6.2.1 +mysqlclient==2.1.1 diff --git a/setup.cfg b/setup.cfg index 7e27ba2..069d76d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [metadata] -name = OSSDB-Web +name = FOSSDB-Web description = Open-Source Software Database Website author = Kristofers Solo license = GPL3 @@ -9,10 +9,11 @@ classifiers = Programming Language :: Python :: 3.10 [options] -packages = OSSDB_web +packages = FOSSDB_web install_requires = Django>=4.1 fontawesomefree>=6.2.1 + mysqlclient>=2.1.1 python_requires = >=3.10 package_dir = =. diff --git a/tox.ini b/tox.ini index c163b8f..da224ca 100644 --- a/tox.ini +++ b/tox.ini @@ -7,19 +7,25 @@ isolated_build = true python = 3.10: py310, mypy, flake8 +; [testenv] +; setenv = +; PYTHONPATH = {toxinidir} +; deps = +; -r{toxinidir}/requirements_dev.txt + + [testenv] -setenv = - PYTHONPATH = {toxinidir} -deps = - -r{toxinidir}/requirements_dev.txt +basepython = python3.10 +deps = django +commands = python manage.py test [testenv:flake8] basepython = python3.10 deps = flake8 -commands = flake8 OSSDB_web +commands = flake8 FOSSDB_web [testenv:mypy] basepython = python3.10 deps = -r{toxinidir}/requirements_dev.txt -commands = mypy OSSDB_web +commands = mypy FOSSDB_web