Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.2.0-alpha release #105

Merged
merged 94 commits into from
Jan 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
45acb50
Merge class_registry, definitions, Add DEFAULT_CHART_SAVE_FOLDER var.
toonarmycaptain Dec 17, 2018
cd311cb
Slight reformat. Add APP_SETTINGS, APP_DEFAULT_CHART_SAVE_FOLDER paths.
toonarmycaptain Dec 17, 2018
aea4281
Add select_folder_dialogue. Rename filename to filepath_str.
toonarmycaptain Dec 17, 2018
13ab767
Rename class_registry import to definitions.
toonarmycaptain Dec 17, 2018
c1cfd72
Add settings.py, user_default_chart_save_location functions, app_init.
toonarmycaptain Dec 17, 2018
ed29156
Correct failing import. Fixes #91.
toonarmycaptain Dec 18, 2018
d13e288
Add test settings.py path. Remove unnecessary image_data path.
toonarmycaptain Dec 18, 2018
ced8830
Pass over tests failing due to new setup save folder feature. See #90.
toonarmycaptain Dec 18, 2018
ecc742e
Remove depreciated IMAGE_DATA folder creation.
toonarmycaptain Dec 18, 2018
18d9a4d
Rename test_app_main to reflect moved data_folder_check function.
toonarmycaptain Dec 18, 2018
c9cbdc8
Refactor clear_screen to take variable argument.
toonarmycaptain Dec 18, 2018
d3c8132
Move main_menu into folder UI_menus, add settings_menu.py
toonarmycaptain Dec 18, 2018
526560c
Remove superfluous import alias as self.
toonarmycaptain Dec 18, 2018
8391ca7
Use pathlib.Path to ensure saved value has uniform separators.
toonarmycaptain Dec 18, 2018
eaa1858
Add folder set runtime var initialisation, user feedback.
toonarmycaptain Dec 18, 2018
9dde26f
Codestyle two spaces before comment.
toonarmycaptain Dec 18, 2018
54361c3
Initialise chosen_option, fixed bad docstring return value, PEP8 fixes.
toonarmycaptain Dec 18, 2018
eae30c4
Move helper UI_functions.py to UI_menus folder.
toonarmycaptain Dec 18, 2018
1d57814
PEP8 remove extra space before operator
toonarmycaptain Dec 18, 2018
f7bbfe6
Create save_as_dialogue. Add start_dir arg to select_file_dialogue.
toonarmycaptain Dec 19, 2018
2d5d70a
Create __init__.py.
toonarmycaptain Dec 19, 2018
73b4686
Add class chart_save_folder to setup_class_storage.
toonarmycaptain Dec 19, 2018
bc930d2
Add start_dir param above app folder to avatar_file_dialogue.
toonarmycaptain Dec 19, 2018
4d86c83
Add chart_default_filename to class_data_dict, save chart to chart_data.
toonarmycaptain Dec 19, 2018
66ad4db
Add save_chart_image func, UI for user select.
toonarmycaptain Dec 19, 2018
b94e74e
User set chart save folder defaults UI location to folder above app.
toonarmycaptain Dec 19, 2018
724d26e
Docstring, PEP8 fix.
toonarmycaptain Dec 19, 2018
64df9ca
Fix broken test by mocking out DEFAULT_CHART_SAVE_FOLDER.
toonarmycaptain Dec 19, 2018
d9cfc47
Slight reordering of return values to match dict assignment, clarity.
toonarmycaptain Dec 20, 2018
eb29469
Various docstring, PEP8, comment improvements.
toonarmycaptain Dec 20, 2018
975208f
Ignore test docs build
toonarmycaptain Dec 20, 2018
812f525
Add removal of user_save_chart folder.
toonarmycaptain Dec 20, 2018
1b7a8b3
Add move_file func. Changing chart save folder moves current to new loc.
toonarmycaptain Dec 21, 2018
c7a93e9
Add TestMoveFile, implement shutil.rmtree instead of individual os funcs
toonarmycaptain Dec 21, 2018
6f61509
Add TestMoveDirectoryWithFileInIt, cleanup imports.
toonarmycaptain Dec 21, 2018
949f020
Move setUp asserts setUp func, use shutil.rmtree for os.remove/os.rmdir.
toonarmycaptain Dec 21, 2018
fb77fc1
Added test for load_from_json. Added notes to file_functions docstrings.
toonarmycaptain Dec 21, 2018
64952a4
Add boilerplate edit_class_data function with warning message, tests.
toonarmycaptain Dec 21, 2018
1ecc4e5
Experimental 3.7 support
toonarmycaptain Dec 28, 2018
76f8ab8
Attempt to fix 3.7
toonarmycaptain Dec 28, 2018
6eb7a93
Update .travis.yml
toonarmycaptain Dec 28, 2018
a98ff4b
Update .travis.yml
toonarmycaptain Dec 28, 2018
a471cdb
Update .travis.yml
toonarmycaptain Dec 28, 2018
bd59f2b
Update .travis.yml
toonarmycaptain Dec 28, 2018
37557ee
Update .travis.yml
toonarmycaptain Dec 28, 2018
11355ca
Update .travis.yml
toonarmycaptain Dec 28, 2018
59a54e6
Require success Python 3.7 Linux
toonarmycaptain Dec 29, 2018
1949bc5
Add new Python 3.7 testing on Travis to CHANGELOG.
toonarmycaptain Dec 29, 2018
2ac741f
PEP8 Remove whitespace.
toonarmycaptain Dec 29, 2018
4d0c05e
PEP8 Remove whitespace.
toonarmycaptain Dec 29, 2018
a254571
Require successful Python 3.7 build on Linux (#94)
toonarmycaptain Dec 29, 2018
6242e1a
Make indentation uniform 4 spaces.
toonarmycaptain Dec 29, 2018
f9a57f0
Move Travis test dependency install from .travis.yml to requirements_dev
toonarmycaptain Dec 29, 2018
dd0b4b8
Fix version numbers in requirements_dev.txt.
toonarmycaptain Dec 29, 2018
d6fb62d
Fix version numbers in requirements_dev.txt.
toonarmycaptain Dec 29, 2018
1f7e60b
Remove commented test dependency installs and TODO from travis.yml.
toonarmycaptain Dec 29, 2018
b1eafba
Remove commented test dependency installs and TODO from travis.yml.
toonarmycaptain Dec 29, 2018
df0538a
Add dependency install from requirements_dev to CHANGELOG.
toonarmycaptain Dec 29, 2018
0f33cfe
Merge branch 'development' into new_CI_coverage
toonarmycaptain Dec 29, 2018
61ef1fc
Add dependency install from requirements_dev to CHANGELOG.
toonarmycaptain Dec 29, 2018
2ce2fc8
Merge remote-tracking branch 'origin/new_CI_coverage' into new_CI_cov…
toonarmycaptain Dec 29, 2018
32bd5fa
Move Travis test dependency install from .travis.yml to requirements…
toonarmycaptain Dec 29, 2018
1af828c
Add Python 3.6, 3.7 testing via circleci.
toonarmycaptain Dec 29, 2018
3f8a97f
Add Python 3.6, 3.7 testing via circleci.
toonarmycaptain Dec 29, 2018
20ba4d2
Add Python 3.6, 3.7 testing via circleci.
toonarmycaptain Dec 29, 2018
e6fbb47
Add Python 3.6, 3.7 testing via circleci.
toonarmycaptain Dec 29, 2018
569bfd4
Remove test_suite, venv from coverage, codacy report from cicleci.
toonarmycaptain Dec 29, 2018
73619f6
Add save test results. Remove non-running python 3.6 image.
toonarmycaptain Dec 29, 2018
ce1d0df
Add save test results. Remove non-running python 3.6 image.
toonarmycaptain Dec 29, 2018
3ce7773
Add save test results. Remove non-running python 3.6 image.
toonarmycaptain Dec 29, 2018
58530a7
Add corrected Coveralls coverage calculation.
toonarmycaptain Dec 29, 2018
279f082
Add circleci badge to README.
toonarmycaptain Dec 29, 2018
9bf0e9c
Merge branch 'development' into new_CI_coverage
toonarmycaptain Dec 29, 2018
864cb60
Correct indentation.
toonarmycaptain Dec 29, 2018
651dd42
Add circleci testing, correct coveralls coverage calculation. (#97)
toonarmycaptain Dec 29, 2018
dc7aec6
Add comment, PEP8 blank line at end of file.
toonarmycaptain Dec 29, 2018
40ed6b0
Update neglected CHANGELOG with recent changes.
toonarmycaptain Dec 29, 2018
b0cc0ee
Move removed elements to Removed tag.
toonarmycaptain Dec 29, 2018
50dd9ae
Add Code Cimate Maintainability badge.
toonarmycaptain Dec 30, 2018
6962d30
Add Code Climate, links.
toonarmycaptain Dec 30, 2018
92e4460
Add Codebeat, note in CHANGELOG, badge in README, ignore test code.
toonarmycaptain Jan 1, 2019
27d7d27
Add missing slash to .codebeatignore.
toonarmycaptain Jan 1, 2019
b5daf35
Merge branch 'development' into new_CI_coverage
toonarmycaptain Jan 1, 2019
c0408df
Add Codebeat coverage, badge, .codebeatignore (#103)
toonarmycaptain Jan 1, 2019
31e97d5
Reformat - each badge on a newline.
toonarmycaptain Jan 1, 2019
a2b5015
Add Codeship badge.
toonarmycaptain Jan 1, 2019
b693f3f
Merge remote-tracking branch 'origin/new_CI_coverage' into new_CI_cov…
toonarmycaptain Jan 1, 2019
a45b8c0
Add Codeship note in CHANGELOG
toonarmycaptain Jan 1, 2019
8dbfd97
Merge branch 'development' into new_CI_coverage
toonarmycaptain Jan 1, 2019
4c2f81a
Merge pull request #104 from toonarmycaptain/new_CI_coverage
toonarmycaptain Jan 1, 2019
f98fc2a
Bump version number, changelog for release: [0.2.0-alpha] - 2018-12-31
toonarmycaptain Jan 1, 2019
f000f49
Merge remote-tracking branch 'origin/development' into development
toonarmycaptain Jan 1, 2019
733cfb9
Spelling and minor clarity edits.
toonarmycaptain Jan 1, 2019
1a3b7be
Add final newline.
toonarmycaptain Jan 1, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Python CircleCI 2.0 configuration file
version: 2
jobs:
build:
docker:
- image: circleci/python:3.7

working_directory: ~/dionysus

steps:
- checkout

- run:
name: install dependencies
command: |
python3 -m venv venv
. venv/bin/activate

pip install -r requirements_dev.txt
pip install -r requirements.txt

mkdir test-results

- run:
name: run tests
command: |
. venv/bin/activate

pytest -v --cov=/home/circleci/dionysus/ --junitxml=../test-results/junit.xml
coverage xml

- store_test_results:
path: test-results
1 change: 1 addition & 0 deletions .codebeatignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/test_suite/**
3 changes: 2 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ include = /home/travis/build/toonarmycaptain/dionysus/*
omit =
*.yml
*.md

test_suite/*
venv/*
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.idea/
dionysus_env/
dionysus_app/app_data/

docs/ # don't test docs build



Expand Down
17 changes: 10 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
language: python
sudo: false
dist: xenial

os:
- windows
- linux
- windows
- linux


cache: pip
Expand All @@ -13,20 +15,21 @@ python:


matrix:
include: # Workaround for python 3.7.
- python: "3.7"
dist: xenial
sudo: required

fast_finish: true
allow_failures:
- os: windows # allow failure on Win until Travis-Win supports python.
- python: "3.7" # Travis CI not supporting 3.7 yet
# - python: "3.7" # Travis CI not supporting 3.7 yet


install:
- pip install -r requirements_dev.txt
- pip install -r requirements.txt

- pip install pytest-cov
- pip install coveralls
- pip install coverage
- pip install codacy-coverage

# command to run tests
script:
Expand Down
55 changes: 50 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,56 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.2.0-alpha] - 2018-12-31
### Added
- Save chart dialogue.
- OS native 'save as' dialogue.
- Starting default folder to class folder in dionysus charts ie dionysus_charts/class_name.
- Default filename provided is sanitised user supplied chart name.
- User can save chart in user selected location with user supplied filename.
- Copy of image also saved in app_data/class_data/class_name/chart_data along with the chart data.
- User defined location for dionysus_charts folder.
- Prompt to set location on startup, default location in application parent directory if user declines to set location.
- Charts for each class will by default save in sub-folders for each class in dionysus_charts folder.
- OS native prompt for location selection.
- Add user settings, settings menu.
- User can configure, reconfigure dionysus_charts save folder location.
Changing location moves current folder and contents.
- Add "not implemented" message when "Edit a classlist" is selected from main menu.
- CI/Testing
- Travis CI
- Use Xenial distribution for Python 3.7 to build on Travis.
- circleci
- Add Python 3.7 testing via [circleci](https://codeclimate.com/github/toonarmycaptain/dionysus).
- circleci badge added to README.
- Code Climate
- Connect dionysus to [Code Climate](https://codeclimate.com/github/toonarmycaptain/dionysus)
- Add Code Climate Maintainability badge to README.
- Codebeat
- Add [Codebeat](https://codebeat.co/projects/github-com-toonarmycaptain-dionysus-master) code quality checker.
- Add .codebeatignore to ignore test code from code quality metrics
- Codeship
- Add [Codeship CI](https://app.codeship.com/projects/320107), badge to README.
### Changed
- Charts save to correct location in dionysus_charts rather than in app_home folder.
- Reorganise menus/UI scripts into folder UI_menus.
- Moved app initialisation code to initialise_app.py.
- data_folder_check moved here.
- REGISTRY variable moved to definitions.py.
- CI/Testing
- Move testing/development dependencies to requirements_dev.txt.
- Coveralls
- Correct coverage calculation to only include project code (not testing or python env code).
- Travis CI
- Install testing dependencies from requirements_dev.txt rather than manually.
- Require passing tests Python 3.7 on Linux for successful build.
### Removed
- app_data/image_data folder.
- Unnecessary as saving images to external folder, and to class_data/*/chart_data folder.
- class_registry.py.
- REGISTRY variable moved to definitions.py.


## [0.1.1-alpha] - 2018-12-12
### Added
- OS native file select dialogue
Expand Down Expand Up @@ -39,14 +87,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Remove in next release.

## [0.1.0-alpha] - 2018-12-10
Initial alpha release! Dionysus will take classlists, and successfully produce charts with the default avatar.
Initial alpha release! Dionysus will take class lists, and successfully produce charts with the default avatar.

### Known bugs/non-functional features:
- setup.py is boilerplate and untested.
- User supplied avatar does not copy to app data folder and thus does not work in app.
- No indication of chart save location and not saving in desired/intended location in app_data/image_data/
- Need to cut and paste/type user supplied avatar location is too awkward.
- Preview/display of created chart does not reflect generated image accurately.



13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
## dionysus - Avatar chart generator
[![Build Status](https://travis-ci.org/toonarmycaptain/dionysus.svg?branch=master)](https://travis-ci.org/toonarmycaptain/dionysus) [![Build status](https://ci.appveyor.com/api/projects/status/yb33uwd13tkv7l79?svg=true)](https://ci.appveyor.com/project/toonarmycaptain/dionysus) [![Coverage Status](https://coveralls.io/repos/github/toonarmycaptain/dionysus/badge.svg)](https://coveralls.io/github/toonarmycaptain/dionysus) [![BCH compliance](https://bettercodehub.com/edge/badge/toonarmycaptain/dionysus?branch=master)](https://bettercodehub.com/) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/d24e9508258849c2b40760fce3448c6b)](https://www.codacy.com/app/toonarmycaptain/dionysus?utm_source=github.com&utm_medium=referral&utm_content=toonarmycaptain/dionysus&utm_campaign=Badge_Grade) [![CodeFactor](https://www.codefactor.io/repository/github/toonarmycaptain/dionysus/badge/master)](https://www.codefactor.io/repository/github/toonarmycaptain/dionysus/overview/master) [![Updates](https://pyup.io/repos/github/toonarmycaptain/dionysus/shield.svg)](https://pyup.io/repos/github/toonarmycaptain/dionysus/) [![Known Vulnerabilities](https://snyk.io/test/github/toonarmycaptain/dionysus/badge.svg?targetFile=requirements.txt)](https://snyk.io/test/github/toonarmycaptain/dionysus?targetFile=requirements.txt) [![Python 3](https://pyup.io/repos/github/toonarmycaptain/dionysus/python-3-shield.svg)](https://pyup.io/repos/github/toonarmycaptain/dionysus/)
[![Build Status](https://travis-ci.org/toonarmycaptain/dionysus.svg?branch=master)](https://travis-ci.org/toonarmycaptain/dionysus)
[![CircleCI](https://circleci.com/gh/toonarmycaptain/dionysus/tree/master.svg?style=svg)](https://circleci.com/gh/toonarmycaptain/dionysus/tree/master)
[![Build status](https://ci.appveyor.com/api/projects/status/yb33uwd13tkv7l79?svg=true)](https://ci.appveyor.com/project/toonarmycaptain/dionysus)
[![Coverage Status](https://coveralls.io/repos/github/toonarmycaptain/dionysus/badge.svg)](https://coveralls.io/github/toonarmycaptain/dionysus)
[![BCH compliance](https://bettercodehub.com/edge/badge/toonarmycaptain/dionysus?branch=master)](https://bettercodehub.com/)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d24e9508258849c2b40760fce3448c6b)](https://www.codacy.com/app/toonarmycaptain/dionysus?utm_source=github.com&utm_medium=referral&utm_content=toonarmycaptain/dionysus&utm_campaign=Badge_Grade)
[![codebeat badge](https://codebeat.co/badges/c7b02602-ed39-46ff-9513-d06217fdfab4)](https://codebeat.co/projects/github-com-toonarmycaptain-dionysus-master)
[![CodeFactor](https://www.codefactor.io/repository/github/toonarmycaptain/dionysus/badge/master)](https://www.codefactor.io/repository/github/toonarmycaptain/dionysus/overview/master)
[![Codeship Status for toonarmycaptain/dionysus](https://app.codeship.com/projects/43b55830-ee0a-0136-e887-0e72079f591a/status?branch=master)](https://app.codeship.com/projects/320107)
[![Updates](https://pyup.io/repos/github/toonarmycaptain/dionysus/shield.svg)](https://pyup.io/repos/github/toonarmycaptain/dionysus/)
[![Known Vulnerabilities](https://snyk.io/test/github/toonarmycaptain/dionysus/badge.svg?targetFile=requirements.txt)](https://snyk.io/test/github/toonarmycaptain/dionysus?targetFile=requirements.txt)
[![Python 3](https://pyup.io/repos/github/toonarmycaptain/dionysus/python-3-shield.svg)](https://pyup.io/repos/github/toonarmycaptain/dionysus/)

**dionysus** is an open source CLI app primarily aimed at teachers that charts student results for display using avatars, nicknames, or student names.

Expand Down
33 changes: 11 additions & 22 deletions app_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,12 @@
import os
import sys

import dionysus_app.class_registry as class_registry
import definitions

from dionysus_app.class_registry_functions import cache_class_registry, check_registry_on_exit
from dionysus_app.data_folder import DataFolder
from dionysus_app.main_menu import run_main_menu


def data_folder_check():
"""
Check data folders exist, create them if they do not.

:return: None
"""

data_folders = {
DataFolder.APP_DATA: DataFolder.generate_rel_path(DataFolder.APP_DATA.value),
DataFolder.CLASS_DATA: DataFolder.generate_rel_path(DataFolder.CLASS_DATA.value),
DataFolder.IMAGE_DATA: DataFolder.generate_rel_path(DataFolder.IMAGE_DATA.value),
}

for key in data_folders:
data_folders[key].mkdir(parents=True, exist_ok=True)
from dionysus_app.initialise_app import app_init
from dionysus_app.UI_menus.main_menu import run_main_menu
from dionysus_app.settings_functions import load_chart_save_folder


def run_app():
Expand All @@ -38,9 +22,14 @@ def run_app():
"""
os.chdir(sys.path[0]) # Make sure cwd is directory os script.

data_folder_check()
app_init()


# load runtime variables
definitions.REGISTRY = cache_class_registry()

definitions.DEFAULT_CHART_SAVE_FOLDER = load_chart_save_folder()

class_registry.REGISTRY = cache_class_registry()

run_main_menu() # startup checks successful, enter UI.

Expand Down
4 changes: 4 additions & 0 deletions definitions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import os

ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) # Global root directory

REGISTRY = None

DEFAULT_CHART_SAVE_FOLDER = None
100 changes: 0 additions & 100 deletions dionysus_app/UI_functions.py

This file was deleted.

Loading