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

Add temp dir, cleanup codebase, ready for release 0.6.0 #282

Merged
merged 60 commits into from
Apr 1, 2020

Conversation

toonarmycaptain
Copy link
Owner

  • temp dir feature added.
  • Codebase cleanup:
    • Increased Path passing enforcement.
    • Increased typehinting.
    • Increased test coverage, conversion to pytest style tests.
  • Readying for reorganisation for Database feature:
    • Better separate UI/logic persistence layers (eg in create_class, new_chart)
    • Expanded use of Class object to create_chart.

dependabot-preview bot and others added 30 commits January 30, 2020 11:14
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.3.4 to 5.3.5.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@5.3.4...5.3.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
…ibution magnitude.

docs: add schedutron as a contributor
docs: add AbdullahElagha as a contributor
docs: add HCamberos as a contributor
docs: add mbarakaja as a contributor
docs: add destag as a contributor
docs: add malexanderboyd as a contributor
docs: add Ginkooo as a contributor
docs: add toonarmycaptain as a contributor
docs: create .all-contributorsrc [skip ci]
docs: update README.md [skip ci]
Bumps [matplotlib](https://github.com/matplotlib/matplotlib) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/matplotlib/matplotlib/releases)
- [Commits](matplotlib/matplotlib@v3.1.2...v3.1.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
…b-3.1.3

Bump matplotlib from 3.1.2 to 3.1.3
Bumps [setuptools](https://github.com/pypa/setuptools) from 45.1.0 to 45.2.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/master/CHANGES.rst)
- [Commits](pypa/setuptools@v45.1.0...v45.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
…s-45.2.0

Bump setuptools from 45.1.0 to 45.2.0
…-1.11.1

Bump coveralls from 1.10.0 to 1.11.1
Bumps [pytest-mypy](https://github.com/dbader/pytest-mypy) from 0.4.2 to 0.5.0.
- [Release notes](https://github.com/dbader/pytest-mypy/releases)
- [Changelog](https://github.com/dbader/pytest-mypy/blob/master/changelog.md)
- [Commits](realpython/pytest-mypy@v0.4.2...v0.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
…py-0.5.0

Bump pytest-mypy from 0.4.2 to 0.5.0
…20-03-01

Scheduled monthly dependency update for March
Bumps [setuptools](https://github.com/pypa/setuptools) from 45.2.0 to 46.0.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/master/CHANGES.rst)
- [Commits](pypa/setuptools@v45.2.0...v46.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Bumps [pytest-mypy](https://github.com/dbader/pytest-mypy) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/dbader/pytest-mypy/releases)
- [Changelog](https://github.com/dbader/pytest-mypy/blob/master/changelog.md)
- [Commits](realpython/pytest-mypy@v0.5.0...v0.6.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Bumps [codecov](https://github.com/codecov/codecov-python) from 2.0.16 to 2.0.22.
- [Release notes](https://github.com/codecov/codecov-python/releases)
- [Changelog](https://github.com/codecov/codecov-python/blob/v2.0.22/CHANGELOG.md)
- [Commits](codecov/codecov-python@v2.0.16...v2.0.22)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
….0.22

Bump codecov from 2.0.16 to 2.0.22
…py-0.6.0

Bump pytest-mypy from 0.5.0 to 0.6.0
Bumps [mypy](https://github.com/python/mypy) from 0.761 to 0.770.
- [Release notes](https://github.com/python/mypy/releases)
- [Commits](python/mypy@v0.761...v0.770)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
…s-46.0.0

Bump setuptools from 45.2.0 to 46.0.0
Bumps [matplotlib](https://github.com/matplotlib/matplotlib) from 3.1.3 to 3.2.1.
- [Release notes](https://github.com/matplotlib/matplotlib/releases)
- [Commits](matplotlib/matplotlib@v3.1.3...v3.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.0.3 to 5.0.4.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](nedbat/coveragepy@coverage-5.0.3...coverage-5.0.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
…b-3.2.1

Bump matplotlib from 3.1.3 to 3.2.1
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.3.5 to 5.4.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@5.3.5...5.4.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Bumps [setuptools](https://github.com/pypa/setuptools) from 46.0.0 to 46.1.1.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/master/CHANGES.rst)
- [Commits](pypa/setuptools@v46.0.0...v46.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
…s-46.1.1

Bump setuptools from 46.0.0 to 46.1.1
toonarmycaptain and others added 22 commits March 26, 2020 00:44
Signed-off-by: toonarmycaptain <toonarmycaptain@hotmail.com>
Initial use: to cache added avatars to be written database with class.

initialise_app -> data_folder_check() will ensure dir exists at runtime.
Add path to DataFolder.
Add variable TEMP_DIR to settings_functions.py.

Signed-off-by: toonarmycaptain <toonarmycaptain@hotmail.com>
Signed-off-by: toonarmycaptain <toonarmycaptain@hotmail.com>
Signed-off-by: toonarmycaptain <toonarmycaptain@hotmail.com>
Signed-off-by: toonarmycaptain <toonarmycaptain@hotmail.com>
This subclass implements temp dir for class in app temp directory,
with 'avatars' dir for holding user avatars before writing to database.

Signed-off-by: toonarmycaptain <toonarmycaptain@hotmail.com>
Cache avatars in temp folder, then move to class_data/database when
class is written.

take_student_avatar now takes NewClass instead of a class name, copies
avatars to NewClass.temp_avatars_dir using file_functions.copy_file.

create_classlist_data copies cached avatars after writing class to file.

Added functions: copy_avatars_to_class_data, copy_avatar_to_class_data
Remove functions: copy_avatar_to_app_data

Note this solves issue caused by creating folders etc after taking user
input, as user adding avatar was trying to copy to new class folders
that didn't exist yet due to previous change that separated logic from
writing to disk/database, postponing folder creation until writing,
where previously avatars were copied to created folder one by one as
user supplied them for each added student.

NB Above issue is a good candidate for end-to-testing if/when this is
implemented.

Signed-off-by: toonarmycaptain <toonarmycaptain@hotmail.com>
Signed-off-by: toonarmycaptain <toonarmycaptain@hotmail.com>
Bumps [setuptools](https://github.com/pypa/setuptools) from 46.1.1 to 46.1.3.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/master/CHANGES.rst)
- [Commits](pypa/setuptools@v46.1.1...v46.1.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
…s-46.1.3

Bump setuptools from 46.1.1 to 46.1.3
Signed-off-by: toonarmycaptain <toonarmycaptain@hotmail.com>
Signed-off-by: toonarmycaptain <toonarmycaptain@hotmail.com>
Signed-off-by: toonarmycaptain <toonarmycaptain@hotmail.com>
This fixes bug where name with disallowed characters would be used as a
directory name.

Also added test ensuring path_safe_name is used.

Signed-off-by: toonarmycaptain <toonarmycaptain@hotmail.com>
Change `new_chart`/`assemble_chart_data` to take `Class`/`NewClass`
object instead of a class name.
- Supports passing in class directly from `create_class` without
reloading from database.
- Move logic prompting user to choose a class from `assemble_chart_data`
 to `new_chart`.

Signed-off-by: toonarmycaptain <toonarmycaptain@hotmail.com>
Signed-off-by: toonarmycaptain <toonarmycaptain@hotmail.com>
Signed-off-by: toonarmycaptain <toonarmycaptain@hotmail.com>
Signed-off-by: toonarmycaptain <toonarmycaptain@hotmail.com>
Signed-off-by: toonarmycaptain <toonarmycaptain@hotmail.com>
Signed-off-by: toonarmycaptain <toonarmycaptain@hotmail.com>
Signed-off-by: toonarmycaptain <toonarmycaptain@hotmail.com>
@ghost
Copy link

ghost commented Apr 1, 2020

Congratulations 🎉. DeepCode analyzed your code in 1.73 seconds and we found no issues. Enjoy a moment of no bugs ☀️.

👉 View analysis in DeepCode’s Dashboard

@coveralls
Copy link

coveralls commented Apr 1, 2020

Pull Request Test Coverage Report for Build 1187

  • 81 of 81 (100.0%) changed or added relevant lines in 10 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.5%) to 94.28%

Totals Coverage Status
Change from base Build 1058: 1.5%
Covered Lines: 890
Relevant Lines: 944

💛 - Coveralls

@codecov
Copy link

codecov bot commented Apr 1, 2020

Codecov Report

Merging #282 into master will increase coverage by 1.39%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #282      +/-   ##
=========================================
+ Coverage    92.9%   94.3%   +1.39%     
=========================================
  Files          22      22              
  Lines         916     948      +32     
=========================================
+ Hits          851     894      +43     
+ Misses         65      54      -11
Impacted Files Coverage Δ
dionysus_app/class_registry_functions.py 100% <ø> (+32.35%) ⬆️
dionysus_app/initialise_app.py 100% <100%> (ø) ⬆️
dionysus_app/data_folder.py 100% <100%> (ø) ⬆️
data_version_conversion.py 97.36% <100%> (+0.07%) ⬆️
dionysus_app/settings_functions.py 100% <100%> (ø) ⬆️
dionysus_app/UI_menus/UI_functions.py 100% <100%> (ø) ⬆️
dionysus_app/class_functions.py 99.15% <100%> (+0.03%) ⬆️
app_main.py 95% <100%> (+0.26%) ⬆️
dionysus_app/UI_menus/class_functions_UI.py 100% <100%> (ø) ⬆️
dionysus_app/chart_generator/create_chart.py 100% <100%> (ø) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 28f5651...83c1000. Read the comment docs.

Signed-off-by: toonarmycaptain <toonarmycaptain@hotmail.com>
@toonarmycaptain toonarmycaptain changed the title Add temp dir,cleanup codebase, release 0.6.0 Add temp dir,cleanup codebase, ready for release 0.6.0 Apr 1, 2020
@toonarmycaptain toonarmycaptain changed the title Add temp dir,cleanup codebase, ready for release 0.6.0 Add temp dir, cleanup codebase, ready for release 0.6.0 Apr 1, 2020
@toonarmycaptain
Copy link
Owner Author

Retry DeepCode

@toonarmycaptain toonarmycaptain merged commit dc9d99f into master Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants