sysr-q / flask-themes2

Easily theme your Flask app. (Flask-Themes with Flask>=0.6 support!)
Other
19 stars 14 forks source link

Cleanup #12

Closed sh4nks closed 3 years ago

sh4nks commented 3 years ago

Hi,

this PR depends on #11. It adds and enhances following stuff:

by the way, travis-ci.org is no more - you should consider switching to GitHub Actions or a similar CI.

Let me know what you think.

The tests pass on my machine:

$ pytest
====================================================== test session starts =======================================================
platform linux -- Python 3.9.6, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 -- /home/peter/Development/flask-themes2/.venv/bin/python
cachedir: .pytest_cache
rootdir: /home/peter/Development/flask-themes2, configfile: tox.ini, testpaths: tests
plugins: cov-2.12.1
collected 16 items                                                                                                               

tests/test_themes.py::TestThemeObject::test_theme PASSED                                                                   [  6%]
tests/test_themes.py::TestThemeObject::test_license_text PASSED                                                            [ 12%]
tests/test_themes.py::TestLoaders::test_load_themes_from PASSED                                                            [ 18%]
tests/test_themes.py::TestLoaders::test_packaged_themes_loader PASSED                                                      [ 25%]
tests/test_themes.py::TestLoaders::test_theme_paths_loader PASSED                                                          [ 31%]
tests/test_themes.py::TestSetup::test_manager PASSED                                                                       [ 37%]
tests/test_themes.py::TestSetup::test_setup_themes PASSED                                                                  [ 43%]
tests/test_themes.py::TestSetup::test_get_helpers PASSED                                                                   [ 50%]
tests/test_themes.py::TestStatic::test_static_file_url PASSED                                                              [ 56%]
tests/test_themes.py::TestTemplates::test_template_exists PASSED                                                           [ 62%]
tests/test_themes.py::TestTemplates::test_loader PASSED                                                                    [ 68%]
tests/test_themes.py::TestTemplates::test_render_theme_template PASSED                                                     [ 75%]
tests/test_themes.py::TestTemplates::test_active_theme PASSED                                                              [ 81%]
tests/test_themes.py::TestTemplates::test_theme_static PASSED                                                              [ 87%]
tests/test_themes.py::TestTemplates::test_theme_static_outside PASSED                                                      [ 93%]
tests/test_themes.py::TestTemplates::test_theme_include_static PASSED                                                      [100%]

----------- coverage: platform linux, python 3.9.6-final-0 -----------
Name                        Stmts   Miss  Cover   Missing
---------------------------------------------------------
flask_themes2/__init__.py     200     34    83%   65-70, 81-91, 106, 111, 142, 150, 175-179, 211-212, 229, 241, 261-262, 304, 330, 340-341, 382
---------------------------------------------------------
TOTAL                         200     34    83%

======================================================= 16 passed in 0.31s =======================================================
sh4nks commented 3 years ago

btw, I'd remove the Fork association with the branch - this will give this repo more coverage on GitHub.

sysr-q commented 3 years ago

Wow, thanks @sh4nks! Lots to look at.

Nice to know that people are still interested in this project. Honestly, I haven't had much time to give it love the past few years, it seems that people these days are using Go more than Python where I live.

Let me get this merged, working locally and cut a new release with a major bump up to 1.0.0 on PyPI.

(I did notice Travis dropped off the radar a while ago, but haven't really had a chance to go over my old repos and update them to this millennium. I should do some spring cleaning clearly.)

sysr-q commented 3 years ago

Thanks so much for your help @sh4nks. Everything ran well locally once I installed pytest-cov. Time to dust off the old Python hat and go through my repos and get them working with Python 3.

I've published a new release to PyPI, you can see here: https://pypi.org/project/Flask-Themes2/1.0.0/ Given the occasion and 1.0 I've also reclassified it as Development Status :: 5 - Production/Stable. If my memory serves me correctly some part of the French government uses this, so I'll call that battle tested production ready code.

If there's anything else you need, let me know.

sh4nks commented 3 years ago

Hey @sysr-q, you are welcome and thanks for merging and pushing a new release so fast!