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
Embedded pybitcointools #126
Comments
Easier to install and test (don't have to deal with different versions installed) this way and i don't see any drawbacks of it. If a new version is out, we can easily test if its works, make the required changes then send it to all users. |
That sounds like a prime case for virtualenv. Set up a new virtualenv, change the number in the requirements.txt file and test. Virtualenv makes it isolated, and reproducible on other systems. Including a package is a bit of a bad practice, and you're left maintaining more than just your own code. |
But what happens if tomorrow a new version of pybitcointools came out a feature we want to use? We can display an error to console saying "If you want to use ZeroNet you have to update your pybitcointools: On linux get a root console, execute pip --upgrade pybitcointools if it still dont work after that (some linux have python3's pip as default) try it with pip2 or pip2.7 or pip-2.7 commands. On windows download the new pybitcointools zip, find your python installation's site package dir and try overwrite files there if you can't then logout and login using an administrator user and try again.", but its sound painful for me. |
In the requirements.txt you would change a line like:
to
And then the user just has to run:
Or, we could actually do that for the user in the upgrade.py file: import subprocess
subprocess.call(['pip','install','--upgrade','--force-reinstall','-r','requirements.txt']) All we'd have to do is make sure the updater downloads the requirements.txt file each time. |
Alternatively, if you really want to include it directly in the repo, then I would recommend looking into pex. The video on the page should explain it fairly well. |
Calling pip from updater won't work in most environment because it requires administrator/root permissions to run. |
The current format 'smells', like a code smell. It's the sort of thing that would make me walk away from a project. Releasing ZeroNet on PyPI would fix all the above problems. A user would run . pip install ZeroNet To install, and updating would be by . pip install --upgrade ZeroNet Which would also update all dependencies. Needing administrative privileges with pip assumes you aren't using virtualenv - a bad idea when it comes to Python. However, it isn't unusual for a program to need administrative privileges to update. Including a full project makes you maintain their code, bloats your own repository making rollbacks harder, makes a testing environment incredibly hard, as tools like nose, pytest and others automatically finds tests, and you probably haven't got pybitcointools test tools in your requirements file. |
As the project owner my top priority to provide the easiest way to use and update zeronet on every platform. This effort will be infringed If we require admin privileges or other actions to update the client. As developer i want to care as less as possible. Supporting and testing different version of packages or distribution formats are painful for me. I know i'm not the best programmer, the code needs improvements and I'm ready to give up my habits, but the easy user experience has to be above all. |
Is there a reason pybitcointools is embedded inside ZeroNet, rather than being installed via pip?
The text was updated successfully, but these errors were encountered: