HACKER097 / wisdom-tree

Wisdom Tree is a TUI concentration app, with features like pomodoro timer, YouTube music player, Lo-fi radio.
MIT License
353 stars 22 forks source link

Fix for treedata overriding #25

Closed ghost closed 2 years ago

ghost commented 2 years ago

Resolves the treedata overriding issue.

Essentially, it was caused by line 4 in MANIFEST.in.

graft includes all files in a given directory, which in our case would also be res/treedata.

Because it is assumed that all files included in the package are important, and should be overridden when updated, it will assume that treedata is a depreciated file that should be overridden with whatever new treedata file is included in the newest package.

All that is needed to fix this is to exclude the treedata file after grafting the res directory.

ghost commented 2 years ago

I should also note, make sure you remove your build/ (and maybe dist/?) directories before packaging the project. If you leave these directories, it can cause treedata to be added regardless because it is found in them despite being removed from the package.

HACKER097 commented 2 years ago

I should also note, make sure you remove your build/ (and maybe dist/?) directories before packaging the project. If you leave these directories, it can cause treedata to be added regardless because it is found in them despite being removed from the package.

This is embarrassing, but I have no idea how pypi works. Another contributor turned the project into a package, and I've using these commands to update it. python3 setup.py sdist bdist_wheel twine upload --verbose --skip-existing dist/wisdom-tree* What do i need to change here?

ghost commented 2 years ago

This is embarrassing, but I have no idea how pypi works. Another contributor turned the project into a package, and I've using these commands to update it. python3 setup.py sdist bdist_wheel twine upload --verbose --skip-existing dist/wisdom-tree* What do i need to change here?

You would need to change: twine upload --verbose --skip-existing dist/wisdom-tree to: twine upload --verbose --skip-existing dist/wisdom-tree-0.1.1

An asterisk acts as a wildcard, and replaces itself with every possible file starting with whatever is written prior to it. You would not want to upload every version of wisdom-tree, just the newest version.

The main issue had to do with the MANIFEST.in file, which determines which files are included into your package. I modified that file such that it ignores the treedata file, and so most of what needs to be done now is to merge my changes, and then with those new changes, packaging the project should ignore treedata.

HACKER097 commented 2 years ago

aight, I just updated, but the age still got reset. I assume this takes effect from the next updates?

ghost commented 2 years ago

aight, I just updated, but the age still got reset. I assume this takes effect from the next updates?

Would you mind running the upgrade command and showing me your output? It does not seem to override when upgrading on my end.

HACKER097 commented 2 years ago

aight, I just updated, but the age still got reset. I assume this takes effect from the next updates?

Would you mind running the upgrade command and showing me your output? It does not seem to override when upgrading on my end.

https://imgur.com/FcZ71h9.png

ghost commented 2 years ago

https://imgur.com/FcZ71h9.png

That's pretty odd, it doesn't seem to overwrite for me. I imagine it might have to do with it seeming to find wisdom-tree-0.1.0 on your system, it definitely should not be picking up on older versions before the fix for treedata. Try running pip3 uninstall wisdom-tree and giving it a reinstall to see if it still happens.

For new installs, I found the easiest way to test if it saves treedata is to temporarily change the growth rate to something really quick, save the treedata, and then reinstalling wisdom-tree to see if the age is still there after reinstalling.

While reinstalling, pay attention to see if it says anything about any versions before 0.1.1, because those were the problematic versions that would override treedata.

HACKER097 commented 2 years ago

Yes, re-installing does not reset the age. Uninstalling 0.1.0 also removed the treedata file, so a new one with age 1 is created when i ran 0.1.2, shouldn't be a problem from next updates.