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

Switch to rich #1098

Merged
merged 41 commits into from
Mar 25, 2021
Merged

Switch to rich #1098

merged 41 commits into from
Mar 25, 2021

Conversation

phcreery
Copy link
Contributor

@phcreery phcreery commented Jan 9, 2021

Drop TQDM in favor of willmcgugan/rich
This was #1037 before branch convention changes.
#1037 was part of #895 but I created a new PR after asyncio switch.

Before:
image

After:
image

See #1037 for more info.

Silverarmor added a commit to Silverarmor/spotify-downloader that referenced this pull request Jan 9, 2021
spotdl/__main__.py Outdated Show resolved Hide resolved
@Silverarmor
Copy link
Member

One thing I note, not sure if its an issue/fixable. Resizing the command window, the progress bars will adapt, but after that, when you "snap" the window back (by dragging to corner/top of screen/side of screen), the bars go all messy as per
image
(note duplicated song progress bar)

(Running Windows 10 pro)

@phcreery
Copy link
Contributor Author

phcreery commented Jan 9, 2021

One thing I note, not sure if its an issue/fixable. Resizing the command window, the progress bars will adapt, but after that, when you "snap" the window back (by dragging to corner/top of screen/side of screen), the bars go all messy as per
image
(note duplicated song progress bar)

(Running Windows 10 pro)

I see. Several factors play into this. The text column width is determined at __init__ and not changed after that. (Resizing window to smaller than that width causes an unwanted linefeed AKA duplicate bar) Also, after the code is complete, there is no way for the script to modify the already outputted text. If this is happening during execution, it is most likely due to the former OR is a result of how willmcgugan/rich operates.

@Silverarmor Silverarmor added the Enhancement Enhancing spotDL label Jan 10, 2021
Silverarmor added a commit to Silverarmor/spotify-downloader that referenced this pull request Jan 11, 2021
@phcreery phcreery requested review from a user and Silverarmor January 11, 2021 18:25
Silverarmor added a commit that referenced this pull request Jan 12, 2021
* Transition to setup.cfg rather than setup.py

* Update setup.cfg

* add packages

* Add Readme to PyPi

* Spacing

* Delete oldsetup.py

* Drop Version Support for Py3.6

* Update as for #1098

* Fix Critical Error in setup.py

Had comma separated list rather than semi colon. Prevented setup.py from functioning

* Add 3.9 classifier

* Update setup.cfg

* Drop py3.6 support

* Re-add Py3.6 support

* Change Email

* Remove `requests`

* add tqdm to requirements

* Fix Line Lengths in bug report template

it was annoying me lol

* Update and rename pull_request_template.md to PULL_REQUEST_TEMPLATE.md
@Silverarmor
Copy link
Member

I think tests/test_entry_point.py will need to be edited or something since that uses tqdm? Not entirely sure how that check works.
Last time i removed tqdm ran into THIS - #1096 (comment)

@aklajnert ?

@phcreery
Copy link
Contributor Author

phcreery commented Jan 13, 2021

Hmm, just ran pytest and a whole 5 tests failed. Nice.

Then the URL for test_download_a_playlist is non-existent, is this intentional? https://open.spotify.com/playlist/37i9dQZF1DX1vrY9HPZioH

image

After picking a new playlist, it resolved that one. In 4 of the other tests, my code affected the output so I had to modify pytest to be compliant. All tests passing now.

@Silverarmor
Copy link
Member

@aklajnert ^?

@aklajnert
Copy link
Contributor

Hmm, just ran pytest and a whole 5 tests failed. Nice.

Then the URL for test_download_a_playlist is non-existent, is this intentional? https://open.spotify.com/playlist/37i9dQZF1DX1vrY9HPZioH

image

After picking a new playlist, it resolved that one. In 4 of the other tests, my code affected the output so I had to modify pytest to be compliant. All tests passing now.

Please update your branch - I see you have a conflict with tests/test_entry_point.py file. In general, this branch seems a bit outdated as it doesn't even run tests on CI. I've just run all tests and they're fine.

I think tests/test_entry_point.py will need to be edited or something since that uses tqdm? Not entirely sure how that check works.
Last time i removed tqdm ran into THIS - #1096 (comment)

@aklajnert ?

Not necessarily. In your case, the project wouldn't work because the tqdm was missing from setup.cfg while still being used which was caught by tests. Removing tqdm and its usages shouldn't fail them.

Silverarmor added a commit that referenced this pull request Jan 14, 2021
Finalizing Development branch
--
* Improved `saveFile` handling

* Fixed tests, recorded new cassettes

* Setup CI on GitHub actions

* Disable VCR only for Python 3.8 to speed up tests

* Clean `mypy` and add it to the CI

* Fixed syntax for tox.ini

* Refactor setup.py. Add setup.cfg. modify issue & PR templates. (#1096)

* Transition to setup.cfg rather than setup.py

* Update setup.cfg

* add packages

* Add Readme to PyPi

* Spacing

* Delete oldsetup.py

* Drop Version Support for Py3.6

* Update as for #1098

* Fix Critical Error in setup.py

Had comma separated list rather than semi colon. Prevented setup.py from functioning

* Add 3.9 classifier

* Update setup.cfg

* Drop py3.6 support

* Re-add Py3.6 support

* Change Email

* Remove `requests`

* add tqdm to requirements

* Fix Line Lengths in bug report template

it was annoying me lol

* Update and rename pull_request_template.md to PULL_REQUEST_TEMPLATE.md

* Fixing typo (#1108)

@last72 helping to fix typos in CONTRIBUTING.md

* Fixing typo

ometimes, -> Sometimes,

* Fixing typo

intensions -> intentions

* Core values: How we decided what gets included (#1105)

@MikhailZex - Core values: How we decided what gets included


* Values: What get added, and what gets removed

* Updates based on @Silverarmor's Review

- Used title case
- Canged '~(80%)' to '~80%+)
- Removed unnecessary line breaks
- Removed extra COREVALUES.md

* Prepare Update to 3.3.0

Updated setup.cfg version to 3.3.0

* Fix setup.cfg & setup.py dev (#1116)

Authored by @phcreery @Silverarmor 
@phcreery helped solve the big problem!

* Attempt to unfck it

* Try change entry point to all?

* Try add a main() function

* remove colon bit

* Revert to 172e973
Signed-off-by: Silverarmor <[email protected]>

* idk whats happening

* try fix packages? mayb helps?

* back to __main__

* Removed where to look

* script as spotdl

* didnt work, trying spotdl:spotdl

* trying __main__ maybe?

* I am literally desperate and trying different files now.

hopefully? maybe?

* hopefully fixed

* Revert "hopefully fixed"

This reverts commit 1f07c0b.

* Fix entry point.

Big thanks @phcreery who figured this one out!

Co-Authored-By: Peyton Creery <[email protected]>
Co-authored-by: Peyton Creery <[email protected]>

* Transfer mypy.ini to setup.cfg

Co-authored-by: Andrzej Klajnert <[email protected]>
Co-authored-by: Woongyeol Choi <[email protected]>
Co-authored-by: Michael George <[email protected]>
Co-authored-by: Peyton Creery <[email protected]>
Copy link
Member

@Silverarmor Silverarmor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs updating from master.

Also note 490f926 - I deleted tmp file. - Maybe needs to be added to .gitignore?

@phcreery
Copy link
Contributor Author

phcreery commented Jan 15, 2021

@Silverarmor updated

Copy link
Member

@Silverarmor Silverarmor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of merge conflicts in /tests/ files.

tests/cassettes/test_multiple_elements.yaml Outdated Show resolved Hide resolved
tests/cassettes/test_multiple_elements.yaml Outdated Show resolved Hide resolved
tests/cassettes/test_search_and_download.yaml Outdated Show resolved Hide resolved
@aklajnert
Copy link
Contributor

Lots of merge conflicts in /tests/ files.

Do not resolve conflicts in YAML files in /tests/cassetes directory, as they are autogenerated. Simply remove them and run tests again, so they will be recreated. Or just pick select theirs on conflicts resolving.

@Silverarmor Silverarmor deleted the branch spotDL:dev February 12, 2021 10:37
@aklajnert
Copy link
Contributor

@Silverarmor - did you close it intentionally?

@Silverarmor
Copy link
Member

my bad, made a mistake and was tryna fix it

@Silverarmor Silverarmor reopened this Feb 12, 2021
@ghost
Copy link

ghost commented Mar 19, 2021

@phcreery, could you look into the merge conflicts, as long as they exist, the checks will not run

phcreery and others added 3 commits March 22, 2021 11:22
invalid escape sequence '\$'
(Which is correct in our case).
spotdl/download/progressHandlers.py Show resolved Hide resolved
spotdl/download/progressHandlers.py Outdated Show resolved Hide resolved
spotdl/download/progressHandlers.py Outdated Show resolved Hide resolved
spotdl/download/progressHandlers.py Outdated Show resolved Hide resolved
spotdl/download/progressHandlers.py Outdated Show resolved Hide resolved
spotdl/download/progressHandlers.py Outdated Show resolved Hide resolved
spotdl/download/progressHandlers.py Outdated Show resolved Hide resolved
spotdl/download/progressHandlers.py Outdated Show resolved Hide resolved
spotdl/download/downloader.py Outdated Show resolved Hide resolved
Copy link
Member

@Silverarmor Silverarmor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aklajnert
Copy link
Contributor

There are quite a lot flake8 violations, but they should be easy to fix.

spotdl/download/downloader.py Outdated Show resolved Hide resolved
@Silverarmor
Copy link
Member

3ec3de4 appears to have caused tests to fail

@aklajnert
Copy link
Contributor

@Silverarmor - I think this should be merged next, as it is quite vulnerable to merge conflicts.

@Silverarmor
Copy link
Member

@Silverarmor - I think this should be merged next, as it is quite vulnerable to merge conflicts.

Will do

@Silverarmor Silverarmor merged commit 324a363 into spotDL:dev Mar 25, 2021
@Silverarmor
Copy link
Member

Want to also note thanks for all your hard work on this feature! @phcreery

@Silverarmor Silverarmor mentioned this pull request Mar 25, 2021
Silverarmor added a commit that referenced this pull request Mar 26, 2021
* Fix MikhailZex GitHub's link (#1215)
Authored by @jcs090218 

* Use the proper name for beautifulsoup4 (#1210)
Authored by @timschumi

* Refactor spotify client (#1188)
Authored by @aklajnert  

* Switch to rich (#1098)
Authored by @phcreery 

* Bump version number to 3.5.0

Co-authored-by: Jen-Chieh Shen <[email protected]>
Co-authored-by: Tim Schumacher <[email protected]>
Co-authored-by: Andrzej Klajnert <[email protected]>
Co-authored-by: Peyton Creery <[email protected]>
Co-authored-by: Michael George <[email protected]>
Co-authored-by: Jakub <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Enhancing spotDL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants