trivial: apply pre-commit rules
gitea/bidon/pipeline/head This commit looks good Details

This commit is contained in:
Frédéric Péters 2023-08-05 10:50:12 +02:00
parent a324736fff
commit 0f750dc7c8
8 changed files with 24 additions and 24 deletions

View File

@ -37,7 +37,7 @@ INSTALLED_APPS = (
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'bidon.bidon_app' 'bidon.bidon_app',
) )
MIDDLEWARE_CLASSES = ( MIDDLEWARE_CLASSES = (
@ -104,7 +104,8 @@ STATIC_URL = '/static/'
local_settings_file = os.environ.get( local_settings_file = os.environ.get(
'BIDON_SETTINGS_FILE', os.path.join(os.path.dirname(__file__), 'local_settings.py')) 'BIDON_SETTINGS_FILE', os.path.join(os.path.dirname(__file__), 'local_settings.py')
)
if os.path.exists(local_settings_file): if os.path.exists(local_settings_file):
with open(local_settings_file) as f: with open(local_settings_file) as f:

View File

@ -12,10 +12,9 @@ Class-based views
Including another URLconf Including another URLconf
1. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) 1. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
""" """
from django.conf.urls import include, url
from django.contrib import admin from django.contrib import admin
from django.urls import include, path
urlpatterns = [ urlpatterns = [
url(r'^admin/', include(admin.site.urls)), path('admin/', include(admin.site.urls)),
] ]

View File

@ -11,6 +11,6 @@ import os
from django.core.wsgi import get_wsgi_application from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bidon.settings") os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bidon.settings')
application = get_wsgi_application() application = get_wsgi_application()

17
debian/control vendored
View File

@ -3,18 +3,17 @@ Section: python
Priority: optional Priority: optional
Maintainer: Emmanuel Cazenave <ecazenave@entrouvert.com> Maintainer: Emmanuel Cazenave <ecazenave@entrouvert.com>
Build-Depends: debhelper-compat (= 12), Build-Depends: debhelper-compat (= 12),
python3-django, dh-python,
python3-setuptools, python3-all,
python3-all, python3-django,
dh-python python3-setuptools,
Standards-Version: 3.9.6 Standards-Version: 3.9.6
Homepage: https://dev.entrouvert.org/projects/bidon Homepage: https://dev.entrouvert.org/projects/bidon
Package: python-eo-bidon Package: python-eo-bidon
Architecture: all Architecture: all
Depends: ${python:Depends}, Depends: python3-django (>= 1:1.11),
${misc:Depends}, python3-setuptools,
python3-django (>= 1:1.11), ${misc:Depends},
python3-setuptools, ${python:Depends},
Description: Entr'ouvert sandox package (python module) Description: Entr'ouvert sandox package (python module)

View File

@ -2,8 +2,8 @@
import os import os
import sys import sys
if __name__ == "__main__": if __name__ == '__main__':
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bidon.settings") os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bidon.settings')
from django.core.management import execute_from_command_line from django.core.management import execute_from_command_line

View File

@ -1,14 +1,13 @@
#! /usr/bin/env python #! /usr/bin/env python
# -*- coding: utf-8 -*-
import os import os
import subprocess import subprocess
from distutils.cmd import Command
from setuptools.command.install_lib import install_lib as _install_lib
from distutils.command.build import build as _build from distutils.command.build import build as _build
from distutils.command.sdist import sdist from distutils.command.sdist import sdist
from distutils.cmd import Command
from setuptools import setup, find_packages from setuptools import find_packages, setup
from setuptools.command.install_lib import install_lib as _install_lib
class eo_sdist(sdist): class eo_sdist(sdist):
@ -63,6 +62,7 @@ class compile_translations(Command):
def run(self): def run(self):
from django.core.management import call_command from django.core.management import call_command
os.environ.pop('DJANGO_SETTINGS_MODULE', None) os.environ.pop('DJANGO_SETTINGS_MODULE', None)
for path, dirs, files in os.walk('bidon'): for path, dirs, files in os.walk('bidon'):
if 'locale' not in dirs: if 'locale' not in dirs:

View File

@ -2,9 +2,9 @@ import os
DATABASES = { DATABASES = {
'default': { 'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', 'ENGINE': 'django.db.backends.postgresql',
'TEST': { 'TEST': {
'NAME': 'bidon-test-%s' % os.environ.get("BRANCH_NAME", "").replace('/', '-')[:63], 'NAME': 'bidon-test-%s' % os.environ.get('BRANCH_NAME', '').replace('/', '-')[:63],
}, },
} }
} }

View File

@ -1,5 +1,6 @@
def test_true(db): def test_true(db):
assert True assert True
def test_notfail(): def test_notfail():
assert True assert True