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

Centralize dependencies in a separate file #185

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ sudo gdebi -nq armory.deb
# Download, compile, and install prerequisites for bitcoinj wallets

curl -fsS --retry 10 https://bootstrap.pypa.io/get-pip.py | sudo python
sudo /usr/local/bin/pip install -q protobuf scrypt pylibscrypt coincurve pysha3 green
sudo /usr/local/bin/pip install -qr requirements.txt
4 changes: 2 additions & 2 deletions btcrecover/btcrpass.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def full_version():
return "btcrecover {} on Python {} {}-bit, {}-bit unicodes, {}-bit ints".format(
__version__,
".".join(str(i) for i in sys.version_info[:3]),
calcsize("P") * 8,
calcsize(b"P") * 8,
sys.maxunicode.bit_length(),
sys.maxint.bit_length() + 1
)
Expand Down Expand Up @@ -310,7 +310,7 @@ def add_armory_library_path():
armory_path = progfiles_path + r"\Armory"
sys.path.extend((armory_path, armory_path + r"\library.zip"))
# 64-bit Armory might install into the 32-bit directory; if this is 64-bit Python look in both
if struct.calcsize('P') * 8 == 64: # calcsize('P') is a pointer's size in bytes
if struct.calcsize(b"P") * 8 == 64: # calcsize('P') is a pointer's size in bytes
assert not progfiles_path.endswith("(x86)"), "ProgramFiles doesn't end with '(x86)' on x64 Python"
progfiles_path += " (x86)"
armory_path = progfiles_path + r"\Armory"
Expand Down
5 changes: 3 additions & 2 deletions btcrecover/test/test_passwords.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class NonClosingBase(object):
def setUpModule():
global orig_warnings, tstr, tchr, utf8_opt, BytesIO, StringIO, BytesIONonClosing, StringIONonClosing

orig_warnings = warnings.filters[:] # the slice notation takes a shallow copy
orig_warnings = warnings.catch_warnings()
orig_warnings.__enter__() # save the current warnings settings (it's a context manager)
# Convert warnings to errors:
warnings.simplefilter("error")
# except this from Intel's OpenCL compiler:
Expand Down Expand Up @@ -89,7 +90,7 @@ def close(self): pass
def tearDownModule():
global tstr
tstr = None
warnings.filters[:] = orig_warnings # the slice notation replaces the list contents, not the list itself
orig_warnings.__exit__(None, None, None) # restore the original warnings settings


WALLET_DIR = os.path.join(os.path.dirname(__file__), "test-wallets")
Expand Down
5 changes: 3 additions & 2 deletions btcrecover/test/test_seeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@

def setUpModule():
global orig_warnings
orig_warnings = warnings.filters[:] # the slice notation takes a shallow copy
orig_warnings = warnings.catch_warnings()
orig_warnings.__enter__() # save the current warnings settings (it's a context manager)
# Convert warnings to errors:
warnings.simplefilter("error")

def tearDownModule():
warnings.filters[:] = orig_warnings # the slice notation replaces the list contents, not the list itself
orig_warnings.__exit__(None, None, None) # restore the original warnings settings


class TestRecoveryFromWallet(unittest.TestCase):
Expand Down
10 changes: 5 additions & 5 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Just download the latest version from <https://github.com/gurnec/btcrecover/arch

### Wallet Installation Requirements ###

Locate your wallet type in the list below, and follow the instructions in the sections indicated for your wallet.
Locate your wallet type in the list below, and follow the instructions for only the sections listed next to your wallet.

**Note** that for Armory wallets, you must have Armory 0.92.x or later installed on the computer where you run *btcrecover*.

Expand Down Expand Up @@ -48,7 +48,7 @@ Download and run the latest version of the pywin32 installer for Python 2.7, eit

##### Windows #####

Visit the Python download page here: <https://www.python.org/downloads/windows/>, and click the link for the latest **Python 2** release. Download and run either the `Windows x86 MSI installer` for the 32-bit version of Python, or the `Windows x86-64 MSI installer` for the 64-bit one (for Armory wallets, be sure to choose the correct one as noted above). Modern PCs should use the 64-bit version, however if you're unsure which one is compatible with your PC, choose the 32-bit one.
Visit the Python download page here: <https://www.python.org/downloads/windows/>, and click the link for the latest **Python 2.7** release near the top of the page under the heading *Python Releases for Windows*. Download and run either the `Windows x86 MSI installer` for the 32-bit version of Python, or the `Windows x86-64 MSI installer` for the 64-bit one (for Armory wallets, be sure to choose the correct one as noted above). Modern PCs should use the 64-bit version, however if you're unsure which one is compatible with your PC, choose the 32-bit one.

##### Linux #####

Expand Down Expand Up @@ -109,7 +109,7 @@ then try this instead:

C:\Python27\Scripts\pip install pylibscrypt

2. Download this libsodium zip file, and extract it to a temporary location: <https://download.libsodium.org/libsodium/releases/libsodium-1.0.13-msvc.zip>
2. Download this libsodium zip file, and extract it to a temporary location: <https://download.libsodium.org/libsodium/releases/libsodium-1.0.16-msvc.zip>

3. Find the correct `libsodium.dll` file from the extracted files, it will be located at one of these two paths:

Expand All @@ -122,8 +122,8 @@ then try this instead:

5. Download and install one of the two update packages below from Microsoft, either the 32-bit version or the 64-bit version (the second) to match the version of Python that you've installed.

* [Microsoft Visual C++ Redistributable for Visual Studio 2017 **32-bit**](https://go.microsoft.com/fwlink/?LinkId=746572)
* [Microsoft Visual C++ Redistributable for Visual Studio 2017 **64-bit**](https://go.microsoft.com/fwlink/?LinkId=746571)
* [Microsoft Visual C++ Redistributable for Visual Studio 2017 **32-bit**](https://go.microsoft.com/fwlink/?LinkId=746571)
* [Microsoft Visual C++ Redistributable for Visual Studio 2017 **64-bit**](https://go.microsoft.com/fwlink/?LinkId=746572)

##### Linux #####

Expand Down
6 changes: 6 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
protobuf
scrypt
pylibscrypt
coincurve
pysha3
green