Skip to content

Commit ce13f33

Browse files
authored
Merge pull request #54 from dgk/feature/django3-merge-fix
django 3-4 support
2 parents ddba74b + a44631b commit ce13f33

57 files changed

Lines changed: 544 additions & 555 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/codecov.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: codecov
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- develop
8+
9+
jobs:
10+
main:
11+
runs-on: ubuntu-latest
12+
13+
env:
14+
DJANGO_SETTINGS_MODULE: sites.test.settings
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: '3.10'
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
python -m pip install "Django>=4.2,<4.3"
29+
python -m pip install -r requirements.test.txt
30+
python -m pip install codecov
31+
32+
- name: Test
33+
run: |
34+
python -m pip install "Django>=4.2,<4.3"
35+
python -m pip install -r requirements.test.txt
36+
python -m pip install codecov
37+
38+
- name: Run tests and collect coverage
39+
run: |
40+
coverage run manage.py test tests
41+
42+
- name: Upload coverage to Codecov
43+
uses: codecov/codecov-action@v3

.github/workflows/release.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- '[0-9]+.[0-9]+.[0-9]+'
7+
8+
jobs:
9+
main:
10+
runs-on: ubuntu-latest
11+
12+
environment:
13+
name: pypi
14+
url: https://pypi.org/p/django-business-logic
15+
16+
permissions:
17+
id-token: write
18+
contents: write
19+
20+
steps:
21+
22+
- name: Checkout code
23+
uses: actions/checkout@v2
24+
25+
- name: Set up Python 3.10
26+
uses: actions/setup-python@v4
27+
with:
28+
python-version: '3.10'
29+
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
python -m pip install wheel
34+
35+
- name: Build package
36+
run: |
37+
python setup.py sdist bdist_wheel
38+
39+
- name: Publish package distributions to PyPI
40+
uses: pypa/gh-action-pypi-publish@release/v1
41+
with:
42+
password: ${{ secrets.PYPI_API_TOKEN }}
43+
44+
- name: Create Release
45+
id: create_release
46+
uses: comnoco/create-release-action@v2.0.5
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
with:
50+
tag_name: ${{ github.ref }}
51+
release_name: Release ${{ github.ref_name }}
52+
body: |
53+
Pypi release: https://pypi.org/project/django-business-logic/${{ github.ref_name }}/
54+
draft: false
55+
prerelease: false

.github/workflows/unittests.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: unittests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- develop
8+
9+
jobs:
10+
main:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
python:
16+
- "3.8"
17+
- "3.9"
18+
- "3.10"
19+
- "3.11"
20+
django:
21+
- "3.2"
22+
- "4.0"
23+
- "4.1"
24+
- "4.2"
25+
26+
env:
27+
DJANGO_SETTINGS_MODULE: sites.test.settings
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v3
32+
33+
- name: Set up Python ${{ matrix.python }}
34+
uses: actions/setup-python@v4
35+
with:
36+
python-version: ${{ matrix.python }}
37+
38+
- name: Set up pip
39+
run: |
40+
python -m pip install --upgrade pip
41+
42+
- name: Install Django ${{ matrix.django }}
43+
run: |
44+
DJANGO_VERSION_MAJOR=$(echo ${{ matrix.django }} | cut -d. -f1)
45+
DJANGO_VERSION_NEXT_MINOR=$(($(echo ${{ matrix.django }} | cut -d. -f2) + 1))
46+
python -m pip install "Django>=${{ matrix.django }},<$DJANGO_VERSION_MAJOR.$DJANGO_VERSION_NEXT_MINOR"
47+
48+
- name: Install django-admin-sortable2 for Django 3.2
49+
if: ${{ matrix.django == '3.2' }}
50+
run: |
51+
python -m pip install django-admin-sortable2==1.0.4
52+
53+
- name: Install dependencies
54+
run: |
55+
python -m pip install -r requirements.test.txt
56+
57+
- name: Test
58+
run: |
59+
py.test tests

.travis.yml

Lines changed: 0 additions & 73 deletions
This file was deleted.

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.6-alpine
1+
FROM python:3.9-alpine
22

33
ARG VERSION
44
ARG VCS_REF
@@ -14,11 +14,12 @@ LABEL org.label-schema.schema-version="1.0" \
1414
RUN mkdir /app
1515
WORKDIR app
1616

17+
RUN apk add --no-cache libxslt && \
18+
apk add --no-cache --virtual .build-deps g++ python3-dev libffi-dev openssl-dev libxslt-dev git
19+
1720
ADD . /app
1821

19-
RUN apk add --no-cache libxslt && \
20-
apk add --no-cache --virtual .build-deps g++ python-dev libffi-dev openssl-dev libxslt-dev git && \
21-
pip install -r requirements.dev.txt && \
22+
RUN pip install -r requirements.dev.txt && \
2223
python setup.py install && \
2324
apk del .build-deps
2425

README.rst

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
.. image:: https://img.shields.io/travis/dgk/django-business-logic/master.svg
2-
:target: http://travis-ci.org/dgk/django-business-logic?branch=master
3-
:alt: travis-ci
1+
.. image:: https://img.shields.io/github/actions/workflow/status/dgk/django-business-logic/unittests.yml
2+
:target: https://github.com/dgk/django-business-logic/actions/workflows/unittests.yml
3+
:alt: github-build
44

55
.. image:: https://img.shields.io/codecov/c/github/dgk/django-business-logic.svg
66
:target: https://codecov.io/gh/dgk/django-business-logic
@@ -18,6 +18,10 @@
1818
:target: https://django-business-logic.readthedocs.io/en/latest/license.html
1919
:alt: MIT license
2020

21+
.. image:: https://app.fossa.com/api/projects/git%2Bgithub.com%2Fdgk%2Fdjango-business-logic.svg?type=shield&issueType=license
22+
:target: https://app.fossa.com/projects/git%2Bgithub.com%2Fdgk%2Fdjango-business-logic?ref=badge_shield
23+
:alt: FOSSA Status
24+
2125
.. image:: https://img.shields.io/pypi/pyversions/django-business-logic.svg
2226
:target: https://pypi.org/project/django-business-logic/
2327
:alt: python versions
@@ -34,10 +38,6 @@
3438
:target: https://pypi.org/project/django-business-logic/
3539
:alt: pypi versions status
3640

37-
.. image:: https://img.shields.io/gitter/room/django-business-logic/community.svg
38-
:target: https://gitter.im/django-business-logic/community
39-
:alt: gitter
40-
4141
Preface
4242
#######
4343

@@ -114,8 +114,6 @@ Support us
114114

115115
Any feedback and github stars would be greatly appreciated.
116116

117-
Please feel free to ask any questions in the `gitter chat <https://gitter.im/django-business-logic/community>`_
118-
119117
If you are familiar with react/mobx and want to help to build django-business-logic library
120118
(`next generation frontend code is here <https://github.com/dgk/business-logic-ui/>`_), please contact me dgk@dgk.su.
121119

business_logic/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# -*- coding: utf-8 -*-
22

3-
__version__ = '0.5.5'
3+
__version__ = '0.5.8'

business_logic/admin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from polymorphic.admin import PolymorphicChildModelAdmin
99
from polymorphic.admin import PolymorphicParentModelAdmin
1010

11-
from adminsortable2.admin import SortableInlineAdminMixin
11+
from adminsortable2.admin import SortableInlineAdminMixin, SortableAdminMixin, SortableAdminBase
1212

1313
from ace_overlay.widgets import AceOverlayWidget
1414

@@ -99,7 +99,7 @@ class FunctionArgumentChoiceAdmin(SortableInlineAdminMixin, admin.TabularInline)
9999
extra = 1
100100

101101

102-
class FunctionArgumentAdmin(admin.ModelAdmin):
102+
class FunctionArgumentAdmin(SortableAdminMixin, admin.ModelAdmin):
103103
model = FunctionArgument
104104
inlines = (FunctionArgumentChoiceAdmin,)
105105
readonly_fields = ('function', 'order')
@@ -116,7 +116,7 @@ class FunctionArgumentInline(SortableInlineAdminMixin, admin.StackedInline):
116116
show_change_link = True
117117

118118

119-
class FunctionDefinitionAdmin(PolymorphicChildModelAdmin):
119+
class FunctionDefinitionAdmin(PolymorphicChildModelAdmin, SortableAdminBase):
120120
inlines = (FunctionArgumentInline,)
121121

122122

business_logic/apps.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class BusinessLogicConfig(AppConfig):
5+
name = 'business_logic'
6+
default_auto_field = 'django.db.models.AutoField'

business_logic/blockly/build.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
from __future__ import unicode_literals
32

43
import inspect
54
import logging

0 commit comments

Comments
 (0)