-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
URS v3.3.1 | Bug Fixes/Refactoring, a New Utility, and GitHub Actions #42
Conversation
…ming algorithm. Added a Halo that is displayed when setting up the wordcloud
…m-agnostic solution for both methods
…tree utility to usage codeblock. Updating Table of Contents. Wrapping all 'NOTE:'s in a Markdown quote. Adding the 'Utilities' section and the 'Display Directory Tree' and 'Check PRAW Rate Limits' sub-sections
…rbose boolean from Codecov key
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #42 +/- ##
==========================================
- Coverage 86.56% 85.82% -0.74%
==========================================
Files 33 42 +9
Lines 3453 4028 +575
==========================================
+ Hits 2989 3457 +468
- Misses 464 571 +107 ☔ View full report in Codecov by Sentry. |
Overview
Summary
URS v3.3.1's primary focus is refactoring/fixing open issues. This release also includes a new utility that I thought was fun and useful to implement.
Additionally this is a reintroduction to GitHub Actions, which replaces Travis-CI since it is unfortunately no longer free. URS is now tested on all operating systems (see the new GitHub Actions YAML in the Test Configuration section).
The New Utility
Here is the new flag:
When used without the optional date, this flag will display a visual tree of the current date's scrape directory. This makes it quick and easy to see what scrapes you have recorded for today and is an alternative to the
tree
command found on Linux distributions. You can also include a date following the-t
flag, which will display the visual tree for the specified date.Refactoring
The previous codebase utilized Python's old-school method of string formatting. Here is an example of the previous string formatting that was implemented:
I went through every module to replace the outdated method with the superior
f-string
introduced in Python 3.6:There should not be issues with implementing
f-strings
since URS requires Python 3.7+ - this is becausenumpy
, a dependency, dropped support for Python 3.6 after releasingv1.20.0
on January 30, 2021.Demo GIFs for the Utilities section in the
README
will be added to thedemo-gifs
branch shortly after this pull request is merged.Motivation/Context
Two issues are fixed with this pull request (see Issue Fix or Enhancement Request section).
I have been considering adding additional tools/scrape options to URS. Adding the new tree utility seemed like a good addition. I recently discovered Rich and immediately realized I need to take full advantage of this library - the next iteration will include yet another UI overhaul.
I noticed Travis-CI was not triggering builds as I was pushing to the
dev
branch. I looked into the issue and discovered their business structure has changed - there is now a cap for the number of free builds you can run. I do not believe I would run out of free builds anytime soon if it continued to be the primary CI provider for this project. However I want to avoid the looming anxiety of counting the number of builds I use every time I push to this repository, so I am re-activating GitHub Actions. It was previously disabled since Travis-CI provided the necessary CI features, which is simply runningpytest
. It is now enabled, the exclusive CI provider for this project, and tests URS on all platforms (previously only tested on Ubuntu, the Linux distribution provided by most CI solutions).New Dependencies
Issue Fix or Enhancement Request
scrapes
directory when generating frequencies #40.GetPath.get_scrape_type()
.IndexError
raised intest_Export.py
when runningpytest
on Windows machine #30.IndexError
raised intest_Export.py
when runningpytest
on Windows machine.test_Export.py
:Type of Change
Breaking Change
N/A
List All Changes That Have Been Made
Added
-t
/--tree
- display the directory structure of the current date directory. Or optionally include a date to display that day's scrape directory.Utilities.py
to theurs/utils
module.DateTree
which contains methods to find and build a visual tree for the target date's directory.README
-t
/--tree
and--check
utility flags.test_Utilities.py
under thetest_utils
module.Changed
analytics
module:GetPath.get_scrape_type()
GetPath.name_file()
FinalizeWordcloud().save_wordcloud()
pathlib
'sPath()
method to get the path.%
operator) to the superiorf-string
.pytest.yml
.ubuntu-latest
,macOS-latest
, andwindows-latest
) and to send test coverage to Codecov after testing completes onubuntu-latest
.README
%
operator) to the superiorf-string
in the following modules:test_utils/test_Export.py
test_praw_scrapers/test_live_scrapers/test_Livestream.py
test_Export.py
:TestExportWriteCSVAndWriteJSON().test_write_csv()
TestExportExportMethod().test_export_write_csv()
PULL_REQUEST_TEMPLATE.md
.Deprecated
.travis.yml
- URS no longer uses Travis-CI as its CI provider.How Has This Been Tested?
pytest
on local machine - all tests passedPytest
workflow.Test Configuration
New GitHub Actions configuration:
Dependencies
Checklist