Skip to content

Commit ab243ac

Browse files
Merge pull request #612 from toonarmycaptain/development
Pull recent changes, CI/dependencies/
2 parents 5561077 + 00b80b1 commit ab243ac

29 files changed

+140
-179
lines changed

.appveyor.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ image: Visual Studio 2019
44

55
environment:
66
matrix:
7-
- PYTHON: "C:\\Python38"
8-
- PYTHON: "C:\\Python39"
97
- PYTHON: "C:\\Python310"
10-
- PYTHON: "C:\\Python38-x64"
11-
- PYTHON: "C:\\Python39-x64"
8+
- PYTHON: "C:\\Python311"
129
- PYTHON: "C:\\Python310-x64"
10+
- PYTHON: "C:\\Python311-x64"
1311

1412
#matrix:
1513
# allow_failures:

.circleci/config.yml

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

.github/workflows/CI.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,24 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
os: [ubuntu-latest, windows-latest]
13-
python-version: ["3.8", "3.9", "3.10"]
13+
python-version: ["3.10", "3.11"]
1414
experimental: [false] # These versions must pass.
1515

16-
# include:
17-
# experimental: true
18-
# - os: ubuntu-latest
19-
# python-version: 3.11-dev
20-
# experimental: true
16+
include:
17+
- os: ubuntu-latest
18+
python-version: 3.12-dev
19+
experimental: true
2120

2221
# - os: windows-latest
2322
# python-version: 3.11-dev
2423
# experimental: true
2524

2625

2726
steps:
28-
- uses: actions/checkout@v2 # Checkout repo.
27+
- uses: actions/checkout@v3 # Checkout repo.
2928

3029
- name: Set up production Python ${{ matrix.python-version }}
31-
uses: actions/setup-python@v2
30+
uses: actions/setup-python@v4
3231
if: "!endsWith(matrix.python-version, '-dev')"
3332
with:
3433
python-version: ${{ matrix.python-version }}
@@ -58,14 +57,14 @@ jobs:
5857
coveralls --service=github
5958
6059
- name: Codacy Coverage Reporter
61-
uses: codacy/codacy-coverage-reporter-action@0.2.0
60+
uses: codacy/codacy-coverage-reporter-action@v1
6261
if: matrix.os == 'ubuntu_latest'
6362
with:
6463
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
6564
coverage-reports: coverage.xml
6665

6766
- name: Codecov # upload
68-
uses: codecov/codecov-action@v1.2.1
67+
uses: codecov/codecov-action@v3
6968
with:
7069
files: ./coverage.xml
7170
name: codecov-umbrella # Optional.

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717
- Remove `.travis.yml`
1818
- Remove dependencies that were only used for TravisCI from `requirements_dev.txt`.
1919
- Change exit to use `raise SystemExit` with exit code 0.
20+
- Change generic types to use builtins (eg list, dict rather than List, Dict), per PEP 585.
21+
- Remove Python 3.8 support due to implementing PEP 585.
22+
- Change all implicity None-optional typing top explicity declare None type or Optional.
23+
- Remove Python 3.9 support, add 3.11.
24+
- Remove CircleCI/TravisCI testing.
25+
- Remove sqlalchemy stubs, functionality now bundled with sqlalchemy
26+
- Rm codecov in favour of github-action
27+
2028

2129
## [0.8.1-alpha] - 2020-08-29
2230
### Changed

Python_bump.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Instructions for bumping python versions
2+
3+
When bumping version, need to modify version specifiers in all of these files:
4+
5+
.github/workflows/CI.yml
6+
.circleci/config.yml
7+
appveyor.yml
8+
9+
README.md - bump supported versions.

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
33
[![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors-)
44
<!-- ALL-CONTRIBUTORS-BADGE:END -->
5-
[![Build Status](https://travis-ci.org/toonarmycaptain/dionysus.svg?branch=master)](https://travis-ci.org/toonarmycaptain/dionysus)
6-
[![CircleCI](https://circleci.com/gh/toonarmycaptain/dionysus/tree/master.svg?style=svg)](https://circleci.com/gh/toonarmycaptain/dionysus/tree/master)
75
[![Build status](https://ci.appveyor.com/api/projects/status/yb33uwd13tkv7l79?svg=true)](https://ci.appveyor.com/project/toonarmycaptain/dionysus)
86
[![Coverage Status](https://coveralls.io/repos/github/toonarmycaptain/dionysus/badge.svg)](https://coveralls.io/github/toonarmycaptain/dionysus)
97
[![codecov](https://codecov.io/gh/toonarmycaptain/dionysus/branch/master/graph/badge.svg)](https://codecov.io/gh/toonarmycaptain/dionysus)
@@ -18,7 +16,7 @@
1816
**dionysus** is an open source CLI app primarily aimed at teachers that charts student results for display using avatars, nicknames, or student names.
1917

2018
Currently in alpha release, fuller features, automated install/packaging, and a full GUI/webapp are future goals.
21-
Supports latest two python minor versions - currently 3.8 and 3.9.
19+
Supports latest two python minor versions - currently 3.10 and 3.11.
2220

2321
Excitedly welcoming contributors!
2422

dionysus_app/UI_menus/UI_functions.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from pathlib import Path
88
from tkinter import filedialog
9-
from typing import Optional, Union, List, Tuple, Callable
9+
from typing import Optional, Union, Callable
1010

1111

1212
def clear_screen(num_lines: int = 50) -> None:
@@ -78,7 +78,7 @@ def scrub_candidate_filename(dirty_string: str) -> str:
7878
]).rstrip()
7979

8080

81-
def ask_user_bool(question: str, invalid_input_response: str = None) -> bool:
81+
def ask_user_bool(question: str, invalid_input_response: str|None = None) -> bool:
8282
"""
8383
Get user input, return a bool response.
8484
Optional additional instruction on invalid input.
@@ -98,10 +98,10 @@ def ask_user_bool(question: str, invalid_input_response: str = None) -> bool:
9898
return valid_responses[response.upper()]
9999

100100

101-
def save_as_dialogue(title_str: str = None,
102-
default_file_extension: str = None,
103-
filetypes: List[Tuple[str, str]] = None,
104-
suggested_filename: str = None,
101+
def save_as_dialogue(title_str: str|None = None,
102+
default_file_extension: str |None= None,
103+
filetypes: list[tuple[str, str]]|None = None,
104+
suggested_filename: str|None = None,
105105
start_dir: Union[Path, str] = '..'
106106
) -> Optional[Path]:
107107
"""
@@ -146,7 +146,7 @@ def save_as_dialogue(title_str: str = None,
146146
:param title_str: str
147147
:param default_file_extension: list
148148
:param suggested_filename: str
149-
:param filetypes: List[Tuple[str, str]]
149+
:param filetypes: list[tuple[str, str]]
150150
:param start_dir: Path or str
151151
:return: Path
152152
"""
@@ -173,8 +173,8 @@ def save_as_dialogue(title_str: str = None,
173173
return Path(filepath_str)
174174

175175

176-
def select_file_dialogue(title_str: str = None,
177-
filetypes: List[Tuple[str, str]] = None,
176+
def select_file_dialogue(title_str: str|None = None,
177+
filetypes: list[tuple[str, str]]|None = None,
178178
start_dir: Union[Path, str] = '..',
179179
) -> Optional[Path]:
180180
"""
@@ -199,7 +199,7 @@ def select_file_dialogue(title_str: str = None,
199199
title will be "Open".
200200
201201
:param title_str: str
202-
:param filetypes: List[Tuple[str, str]]
202+
:param filetypes: list[tuple[str, str]]
203203
:param start_dir: str
204204
:return: Path or None
205205
"""
@@ -218,7 +218,7 @@ def select_file_dialogue(title_str: str = None,
218218
return Path(filepath_str)
219219

220220

221-
def select_folder_dialogue(title_str: str = None, start_dir: Union[Path, str] = '..') -> Optional[Path]:
221+
def select_folder_dialogue(title_str: str|None = None, start_dir: Union[Path, str] = '..') -> Optional[Path]:
222222
"""
223223
Prompt user to select a directory.
224224
@@ -250,7 +250,7 @@ def select_folder_dialogue(title_str: str = None, start_dir: Union[Path, str] =
250250

251251
def get_user_input(prompt: str,
252252
validation: Callable,
253-
validation_error_msg: Union[str, Callable] = None):
253+
validation_error_msg: Union[str, Callable]|None = None):
254254
"""
255255
Generic function for getting user input.
256256

dionysus_app/UI_menus/chart_generator/create_chart_UI.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def user_cancels() -> None:
7171

7272

7373
class ImageDisplay(tk.Frame):
74-
def __init__(self, image_path: Path = None, master=None) -> None:
74+
def __init__(self, image_path: Path|None = None, master=None) -> None:
7575
super().__init__(master)
7676
self.master = master
7777
self.save_as_button_clicked = False

dionysus_app/UI_menus/chart_generator/take_chart_data_UI.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Script for taking and saving data for chart.
33
"""
4-
from typing import Dict, List, Optional
4+
from typing import Optional
55

66
from dionysus_app.class_ import Class
77
from dionysus_app.student import Student
@@ -32,7 +32,7 @@ def take_score_data(current_class: Class) -> dict:
3232
return student_scores
3333

3434

35-
def take_student_scores(current_class: Class) -> Dict[float, List[Student]]:
35+
def take_student_scores(current_class: Class) -> dict[float, list[Student]]:
3636
"""
3737
UI function presenting student names from supplied class one at a
3838
time and taking a score for each.
@@ -48,7 +48,7 @@ def take_student_scores(current_class: Class) -> Dict[float, List[Student]]:
4848
}
4949
5050
:param current_class: Class object
51-
:return: Dict[float, List[Student]]
51+
:return: dict[float, list[Student]]
5252
"""
5353
student_scores: dict = dict()
5454
for student in current_class.students:

dionysus_app/UI_menus/class_functions_UI.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""UI elements for class_functions"""
22
from pathlib import Path
3-
from typing import Dict, Optional, Union
3+
from typing import Optional, Union
44

55
import definitions
66

@@ -94,19 +94,19 @@ def create_chart_with_new_class_dialogue() -> bool:
9494
invalid_input_response="Invalid response, please try again.")
9595

9696

97-
def display_class_selection_menu(class_options: Dict[int, ClassIdentifier]) -> None:
97+
def display_class_selection_menu(class_options: dict[int, ClassIdentifier]) -> None:
9898
"""
9999
Print "Select class from list:" followed by numbered option list.
100100
101-
:param class_options: Dict[int, ClassIdentifier]
101+
:param class_options: dict[int, ClassIdentifier]
102102
:return: None
103103
"""
104104
print("Select class from list:")
105105
for key, class_ in class_options.items():
106106
print(f'{key}. {class_.name}')
107107

108108

109-
def take_class_selection(class_options: Dict[int, ClassIdentifier]) -> ClassIdentifier:
109+
def take_class_selection(class_options: dict[int, ClassIdentifier]) -> ClassIdentifier:
110110
"""
111111
Prompt user to select a class, return selected class name.
112112
@@ -118,7 +118,7 @@ def take_class_selection(class_options: Dict[int, ClassIdentifier]) -> ClassIden
118118
but this behaviour is predicated on exact match and thus not
119119
communicated to user.
120120
121-
:param class_options: Dict[int: ClassIdentifier]
121+
:param class_options: dict[int: ClassIdentifier]
122122
:return: ClassIdentifier
123123
"""
124124
while True:

dionysus_app/UI_menus/main_menu.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Application main menu.
33
"""
4-
from typing import Dict, Callable, Optional
4+
from typing import Callable, Optional
55

66
from dionysus_app.chart_generator.create_chart import new_chart
77
from dionysus_app.class_functions import create_classlist
@@ -51,7 +51,7 @@ def take_main_menu_input() -> Optional[bool]:
5151
5252
:return: None or True
5353
"""
54-
possible_options: Dict[str, Callable] = {
54+
possible_options: dict[str, Callable] = {
5555
'1': create_classlist,
5656
'2': edit_class_data,
5757
'3': new_chart,

dionysus_app/chart_generator/create_chart.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
sort of overlap without obscuring the avatars, or two columns of avatars in a point column.
99
"""
1010
from pathlib import Path
11-
from typing import Optional, Tuple
11+
from typing import Optional
1212

1313
import definitions
1414

@@ -27,7 +27,7 @@
2727
from dionysus_app.UI_menus.UI_functions import clean_for_filename
2828

2929

30-
def new_chart(loaded_class: Class = None) -> None:
30+
def new_chart(loaded_class: Class|None = None) -> None:
3131
"""
3232
Create a new chart with supplied class, user input.
3333
@@ -75,7 +75,7 @@ def new_chart(loaded_class: Class = None) -> None:
7575
user_save_chart_image(chart_data_dict, chart_image_location)
7676

7777

78-
def assemble_chart_data(loaded_class: Class) -> Tuple[str, str, dict, dict]:
78+
def assemble_chart_data(loaded_class: Class) -> tuple[str, str, dict, dict]:
7979
"""
8080
Collect data/user input for new chart.
8181

dionysus_app/chart_generator/generate_image.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
fig.subtitle('title_string')
66
"""
77
from pathlib import Path
8-
from typing import List, Tuple
98

109
import matplotlib.pyplot as plt
1110

@@ -49,7 +48,7 @@ def set_axis(x_min: int = 0, x_max: int = 100, x_step: int = 10):
4948
plt.yticks([])
5049

5150

52-
def add_avatar_to_plot(ax, avatar_path, xy_coords: List[Tuple[int, int]]) -> None:
51+
def add_avatar_to_plot(ax, avatar_path, xy_coords: list[tuple[int, int]]) -> None:
5352
"""
5453
Take avatar, add avatar to ax at given coords.
5554
@@ -63,7 +62,7 @@ def add_avatar_to_plot(ax, avatar_path, xy_coords: List[Tuple[int, int]]) -> Non
6362
6463
:param ax:
6564
:param avatar_path: Path object
66-
:param xy_coords: List[Tuple[int, int]]
65+
:param xy_coords: list[tuple[int, int]]
6766
:return: None
6867
"""
6968
valid_avatar_path = validate_avatar(avatar_path)

0 commit comments

Comments
 (0)