Skip to content

Commit b4a9107

Browse files
rockymmatera
andauthored
Sync workflows and versions with mathics-core (#209)
* Sync workflows and versions with mathics-core * isort and black --------- Co-authored-by: mmatera <matera@fisica.unlp.edu.ar>
1 parent 01bd899 commit b4a9107

7 files changed

Lines changed: 28 additions & 26 deletions

File tree

.github/workflows/autoblack.yml renamed to .github/workflows/isort-and-black-checks.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
# Othewrwise, Black is run and its changes are committed back to the incoming pull request.
44
# https://github.com/cclauss/autoblack
55

6-
name: autoblack
6+
name: isort and black check
77
on: [pull_request]
88
jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
13-
- name: Set up Python 3.9
14-
uses: actions/setup-python@v3
12+
- uses: actions/checkout@v4
13+
- name: Set up Python 3.11
14+
uses: actions/setup-python@v5
1515
with:
16-
python-version: 3.9
17-
- name: Install click
18-
run: pip install 'click==8.0.4'
19-
- name: Install Black
20-
run: pip install 'black==22.3.0'
16+
python-version: 3.11
17+
- name: Install click, black and isort
18+
run: pip install 'click==8.0.4' 'black==23.12.1' 'isort==5.13.2'
19+
- name: Run isort --check .
20+
run: isort --check .
2121
- name: Run black --check .
2222
run: black --check .
2323
- name: If needed, commit black changes to the pull request

.github/workflows/macos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
matrix:
1414
python-version: ['3.9', '3.10', '3.11']
1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v4
18+
uses: actions/setup-python@v5
1919
with:
2020
python-version: ${{ matrix.python-version }}
2121
- name: Install OS dependencies

.github/workflows/ubuntu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
matrix:
1414
python-version: ['3.8', '3.9', '3.10', '3.11']
1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v3
18+
uses: actions/setup-python@v5
1919
with:
2020
python-version: ${{ matrix.python-version }}
2121
- name: Install OS dependencies

.github/workflows/windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
os: [windows]
1515
python-version: ['3.11']
1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v3
19+
uses: actions/setup-python@v5
2020
with:
2121
python-version: ${{ matrix.python-version }}
2222
- name: Install OS dependencies

mathics_django/server.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
#!/usr/bin/env python
21
# -*- coding: utf-8 -*-
32

43

5-
import sys
4+
import argparse
5+
import errno
66
import os
77
import os.path as osp
8-
import argparse
98
import socket
10-
import errno
119
import subprocess
10+
import sys
1211

1312
import mathics
14-
from mathics_django import server_version_string, license_string
15-
from mathics_django import settings as mathics_settings # Prevents UnboundLocalError
16-
from mathics_django.version import __version__ as django_frontend_version
1713
from mathics.settings import DATA_DIR
1814

15+
from mathics_django import ( # Prevents UnboundLocalError
16+
license_string,
17+
server_version_string,
18+
settings as mathics_settings,
19+
)
20+
from mathics_django.version import __version__ as django_frontend_version
21+
1922

2023
def check_database():
2124
# Check for the database
@@ -107,7 +110,7 @@ def launch_app(args):
107110
addr = "127.0.0.1"
108111

109112
try:
110-
from django.core.servers.basehttp import run, get_internal_wsgi_application
113+
from django.core.servers.basehttp import get_internal_wsgi_application, run
111114

112115
handler = get_internal_wsgi_application()
113116
run(addr, port, handler)

mathics_django/urls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# -*- coding: utf-8 -*-
22

33

4-
from django.urls import re_path, include
5-
from django.conf.urls.static import static
64
from django.conf import settings
5+
from django.conf.urls.static import static
6+
from django.urls import include, re_path
77

88
handler404 = "mathics_django.web.views.error_404_view"
99
handler500 = "mathics_django.web.views.error_500_view"

mathics_django/web/urls.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
doc_subsection,
1818
)
1919

20-
2120
# These are the callback functions.
2221
from mathics_django.web.views import (
2322
delete,

0 commit comments

Comments
 (0)