diff --git a/Makefile b/Makefile index 3b66592..97b0541 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,9 @@ help: @echo "๐Ÿ“ฆ Vendoring (for offline/air-gapped use):" @echo " make vendor-macos - Build macOS ARM64 wheels (requires macOS native)" @echo " make vendor-linux - Build Linux x86_64 wheels (Docker - any OS)" - @echo " make vendor-all - Build wheels for both platforms (macOS native + Docker)" + @echo " make vendor-linux-dev - Build Linux x86_64 dev wheels (includes pytest)" + @echo " make vendor-all - Build runtime wheels for both platforms" + @echo " make vendor-all-dev - Build runtime + dev wheels for all platforms" @echo " make verify-vendor - Test offline installation from vendor/" @echo "" @echo "๐Ÿ”จ Binary Distribution:" @@ -61,16 +63,18 @@ help: @echo " make clean-release - Remove all release artifacts" @echo "" @echo "๐Ÿ› ๏ธ Development workflow (works on macOS + Linux):" + @echo " make install - Create venv and install runtime dependencies" + @echo " make install-offline - Install runtime deps from vendor/ (offline)" + @echo " make install-dev-offline - Install runtime + dev deps from vendor/ (offline)" + @echo " make test - Run test suite" @echo " make build-image - Build Docker image (Python 3.12)" @echo " make wheels - Build wheels into ./$(WHEELHOUSE)" - @echo " make install - Create venv and install dependencies" - @echo " make test - Run test suite" @echo " make up - Start warm dev container" @echo " make shell - Open shell in warm container" @echo " make down - Stop and remove dev container" @echo "" @echo "๐Ÿงน Cleanup:" - @echo " make clean - Remove venv, wheelhouse, vendor/" + @echo " make clean - Remove venv, wheelhouse (keeps vendor/)" @echo " make clean-vendor - Remove vendor/ only" @echo " make clean-release - Remove releases/ only" @echo "" @@ -80,14 +84,9 @@ help: @echo "Platform notes:" @echo " โ€ข vendor-macos requires native macOS (uses .venv312 with ARM64 Python)" @echo " โ€ข vendor-linux works on any platform with Docker" + @echo " โ€ข vendor-linux-dev includes pytest for offline development" @echo " โ€ข binary-linux works on any platform with Docker" @echo " โ€ข All other targets work on macOS and Linux" - @echo "๐Ÿ› ๏ธ Development workflow (works on macOS + Linux):" - @echo " make install-dev - Create venv and install dev dependencies (includes pytest)" - @echo " make install - Create venv and install production dependencies only" - @echo " make test - Run test suite (requires install-dev)" - @echo " make test-all - Install dev deps + run all tests" - # ---------- Build reusable image ---------- .PHONY: build-image @@ -108,6 +107,26 @@ vendor-macos: requirements.txt cd $(VENDOR_MACOS) && shasum -a 256 *.whl > SHA256SUMS @echo "โœ“ macOS ARM64 wheels: $(VENDOR_MACOS)/" +.PHONY: vendor-linux +vendor-linux: requirements.txt + @echo "Building Linux x86_64 wheels (Docker)..." + mkdir -p $(VENDOR_LINUX) + docker run --rm \ + --platform linux/amd64 \ + -v "$$PWD":$(WORKDIR) \ + -w $(WORKDIR) \ + python:3.12-slim \ + bash -c " \ + set -e && \ + apt-get update -qq && apt-get install -y -qq gcc g++ make libffi-dev && \ + pip install --upgrade pip && \ + pip download --dest $(VENDOR_LINUX) -r requirements.txt && \ + pip wheel --wheel-dir $(VENDOR_LINUX) --no-deps $(VENDOR_LINUX)/*.tar.gz 2>/dev/null || true && \ + rm -f $(VENDOR_LINUX)/*.tar.gz && \ + cd $(VENDOR_LINUX) && sha256sum *.whl > SHA256SUMS \ + " + @echo "โœ“ Linux x86_64 wheels: $(VENDOR_LINUX)/" + .PHONY: vendor-linux-dev vendor-linux-dev: requirements-dev.txt @echo "Building Linux x86_64 dev wheels (Docker)..." @@ -128,24 +147,26 @@ vendor-linux-dev: requirements-dev.txt " @echo "โœ“ Linux x86_64 dev wheels: $(VENDOR_LINUX)-dev/" -.PHONY: vendor-all-dev -vendor-all-dev: vendor-linux vendor-linux-dev - @echo "" - @echo "โœ“ All platform wheels (runtime + dev):" - @echo " Linux x86_64 (runtime): $(VENDOR_LINUX)/" - @echo " Linux x86_64 (dev): $(VENDOR_LINUX)-dev/" - - - .PHONY: vendor-all vendor-all: vendor-macos vendor-linux @echo "" - @echo "โœ“ All platforms vendored:" + @echo "โœ“ All platforms vendored (runtime only):" @echo " macOS ARM64: $(VENDOR_MACOS)/ ($$(ls $(VENDOR_MACOS)/*.whl 2>/dev/null | wc -l | xargs) wheels)" @echo " Linux x86_64: $(VENDOR_LINUX)/ ($$(ls $(VENDOR_LINUX)/*.whl 2>/dev/null | wc -l | xargs) wheels)" @echo "" @echo "Commit with: git add vendor/ && git commit -m 'vendor: update wheels'" +.PHONY: vendor-all-dev +vendor-all-dev: vendor-linux vendor-linux-dev + @echo "" + @echo "โœ“ All platform wheels (runtime + dev):" + @echo " Linux x86_64 (runtime): $(VENDOR_LINUX)/ ($$(ls $(VENDOR_LINUX)/*.whl 2>/dev/null | wc -l | xargs) wheels)" + @echo " Linux x86_64 (dev): $(VENDOR_LINUX)-dev/ ($$(ls $(VENDOR_LINUX)-dev/*.whl 2>/dev/null | wc -l | xargs) wheels)" + @echo "" + @echo "For macOS dev wheels, run on native macOS:" + @echo " python3.12 -m venv .venv312 && source .venv312/bin/activate" + @echo " pip download --dest vendor/macos-arm64-dev -r requirements-dev.txt" + .PHONY: verify-vendor verify-vendor: @echo "Testing offline installation from vendor/..." @@ -159,7 +180,6 @@ verify-vendor: python3.12 -m venv .venv-verify && \ source .venv-verify/bin/activate && \ pip install --no-index --find-links=vendor/$$PLATFORM -r requirements.txt && \ - pytest -v tests/test_vectors.py && \ python src/pyhdwallet.py test && \ echo "" && \ echo "โœ… Vendor installation verified!" && \ @@ -167,6 +187,17 @@ verify-vendor: rm -rf .venv-verify \ ' +# ---------- Offline Installation ---------- +.PHONY: install-offline +install-offline: + @echo "Installing from vendor/ (runtime only)..." + @./install_offline.sh + +.PHONY: install-dev-offline +install-dev-offline: + @echo "Installing from vendor/ (dev mode with pytest)..." + @./install_offline.sh --dev + # ---------- Binary Building ---------- .PHONY: binary binary: @@ -233,27 +264,6 @@ test: pytest -v tests/test_vectors.py && \ python src/pyhdwallet.py test -.PHONY: install-dev -install-dev: requirements-dev.txt - @if [ ! -d "$(VENV_HOST)" ]; then \ - echo "Creating venv: $(VENV_HOST)"; \ - python3.12 -m venv $(VENV_HOST); \ - fi - . $(VENV_HOST)/bin/activate && \ - pip install --upgrade pip && \ - pip install -r requirements-dev.txt && \ - echo "โœ“ Development environment ready: $(VENV_HOST)" && \ - echo " Installed: production deps + pytest" - -.PHONY: test-all -test-all: install-dev - @. $(VENV_HOST)/bin/activate && \ - pytest -v tests/test_vectors.py && \ - python src/pyhdwallet.py test && \ - echo "" && \ - echo "โœ… All tests passed!" - - # ---------- Warm container lifecycle ---------- .PHONY: up up: build-image @@ -285,7 +295,6 @@ clean: down find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true # NOTE: vendor/ is kept (use 'make clean-vendor' to remove) - # ---------- Platform-Aware Operations ---------- .PHONY: info info: @@ -297,7 +306,7 @@ info: @echo " Docker: $(shell docker --version 2>/dev/null || echo 'not found')" # ---------- Release Management ---------- -VERSION := $(shell grep 'VERSION = ' src/pyhdwallet.py | head -1 | sed 's/.*"\(.*\)".*/\1/' || echo "v1.1.0") +VERSION := v1.1.0 RELEASE_DIR := releases/$(VERSION) .PHONY: release-prep @@ -350,8 +359,6 @@ release: release-checksums @echo " 2. Tag: git tag -a $(VERSION) -m 'Release $(VERSION)'" @echo " 3. Push: git push origin $(VERSION)" - - .PHONY: release-test release-test: @echo "๐Ÿงช Testing release binaries..." diff --git a/vendor/linux-x86_64/SHA256SUMS b/vendor/linux-x86_64/SHA256SUMS deleted file mode 100644 index 616dd30..0000000 --- a/vendor/linux-x86_64/SHA256SUMS +++ /dev/null @@ -1,18 +0,0 @@ -11a36f4d3ce51dfc1043f3218591ac4eb1ceb172919cebe05b52a5bcc8d245c2 base58-2.1.1-py3-none-any.whl -33792674bda552a071a539b6590b2986aa8c08d0c9c30c2566d7cb323173310d bip_utils-2.10.0-py3-none-any.whl -cff2a1999e49cd51c23d1b6786a012127fd8f722c5946e82bd7ab3eb307443f3 cbor2-5.8.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl -3e17ed538242334bf70832644a32a7aae3d83b57567f9fd60a26257e992b79ba cffi-2.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl -1b04778b75339c6e46deb9ae3bcfc2250fbe48d1324153e4310fc4996e135715 coincurve-21.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -e68035c5d2329b0bea290d95bf5e6bc769ef037e39ec8e3903ddcb7b8520551d crcmod-1.7-cp312-cp312-linux_x86_64.whl -10b01676fc208c3e6feeb25a8b83d81767e8059e1fe86e1dc62d10a3018fa926 cryptography-46.0.3-cp311-abi3-manylinux_2_34_x86_64.whl -30638e27cf77b7e15c4c4cc1973720149e1033827cfd00661ca5c8cc0cdb24c3 ecdsa-0.19.1-py2.py3-none-any.whl -7b0c7960b802a605bf5ae8dcf03af34f711087b503b3c96ffec7368dd49372c8 ed25519_blake2b-1.4.1-cp312-cp312-linux_x86_64.whl -2e718c0651f6921eb7f48a1355331757defcb8e588864383d189c796cc25ab03 pgpy-0.6.0-py3-none-any.whl -9da4c9c7f9a0a0e8e3d9ed6eedc885561288edd72267ebc7b0fd11262e8c8b28 py_sr25519_bindings-0.2.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -0d632f46f2ba09143da3a8afe9e33fb6f92fa2320ab7e886e2d0f7672af84629 pyasn1-0.6.1-py3-none-any.whl -e5c6e8d3fbad53479cab09ac03729e0a9faf2bee3db8208a550daf5af81a5934 pycparser-2.23-py3-none-any.whl -c8987bd3307a39bc03df5c8e0e3d8be0c4c3518b7f044b0f4c15d1aa78f52575 pycryptodome-3.23.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -f489c4765093fb60e2edafdf223397bc716491b2b69fe74367b70d6999257a5c pycryptodomex-3.23.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -c8a231e36ec2cab018c4ad4358c386e36eede0319a0c41fed24f840b1dac59f6 pynacl-1.6.2-cp38-abi3-manylinux_2_34_x86_64.whl -6d097f465bfa47796b1494e12ea65d1478107d38e13bc56f6e58eedc4f6c1a87 pyzipper-0.3.6-py2.py3-none-any.whl -4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274 six-1.17.0-py2.py3-none-any.whl diff --git a/vendor/linux-x86_64/base58-2.1.1-py3-none-any.whl b/vendor/linux-x86_64/base58-2.1.1-py3-none-any.whl deleted file mode 100644 index 04086bf..0000000 Binary files a/vendor/linux-x86_64/base58-2.1.1-py3-none-any.whl and /dev/null differ diff --git a/vendor/linux-x86_64/bip_utils-2.10.0-py3-none-any.whl b/vendor/linux-x86_64/bip_utils-2.10.0-py3-none-any.whl deleted file mode 100644 index 7208162..0000000 Binary files a/vendor/linux-x86_64/bip_utils-2.10.0-py3-none-any.whl and /dev/null differ diff --git a/vendor/linux-x86_64/cbor2-5.8.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl b/vendor/linux-x86_64/cbor2-5.8.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl deleted file mode 100644 index 02923e6..0000000 Binary files a/vendor/linux-x86_64/cbor2-5.8.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl and /dev/null differ diff --git a/vendor/linux-x86_64/cffi-2.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl b/vendor/linux-x86_64/cffi-2.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl deleted file mode 100644 index ec1be78..0000000 Binary files a/vendor/linux-x86_64/cffi-2.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl and /dev/null differ diff --git a/vendor/linux-x86_64/coincurve-21.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl b/vendor/linux-x86_64/coincurve-21.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl deleted file mode 100644 index f024a0b..0000000 Binary files a/vendor/linux-x86_64/coincurve-21.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl and /dev/null differ diff --git a/vendor/linux-x86_64/crcmod-1.7-cp312-cp312-linux_x86_64.whl b/vendor/linux-x86_64/crcmod-1.7-cp312-cp312-linux_x86_64.whl deleted file mode 100644 index b85853c..0000000 Binary files a/vendor/linux-x86_64/crcmod-1.7-cp312-cp312-linux_x86_64.whl and /dev/null differ diff --git a/vendor/linux-x86_64/cryptography-46.0.3-cp311-abi3-manylinux_2_34_x86_64.whl b/vendor/linux-x86_64/cryptography-46.0.3-cp311-abi3-manylinux_2_34_x86_64.whl deleted file mode 100644 index 57f66dc..0000000 Binary files a/vendor/linux-x86_64/cryptography-46.0.3-cp311-abi3-manylinux_2_34_x86_64.whl and /dev/null differ diff --git a/vendor/linux-x86_64/ecdsa-0.19.1-py2.py3-none-any.whl b/vendor/linux-x86_64/ecdsa-0.19.1-py2.py3-none-any.whl deleted file mode 100644 index a98c904..0000000 Binary files a/vendor/linux-x86_64/ecdsa-0.19.1-py2.py3-none-any.whl and /dev/null differ diff --git a/vendor/linux-x86_64/ed25519_blake2b-1.4.1-cp312-cp312-linux_x86_64.whl b/vendor/linux-x86_64/ed25519_blake2b-1.4.1-cp312-cp312-linux_x86_64.whl deleted file mode 100644 index eed837b..0000000 Binary files a/vendor/linux-x86_64/ed25519_blake2b-1.4.1-cp312-cp312-linux_x86_64.whl and /dev/null differ diff --git a/vendor/linux-x86_64/pgpy-0.6.0-py3-none-any.whl b/vendor/linux-x86_64/pgpy-0.6.0-py3-none-any.whl deleted file mode 100644 index e0b4196..0000000 Binary files a/vendor/linux-x86_64/pgpy-0.6.0-py3-none-any.whl and /dev/null differ diff --git a/vendor/linux-x86_64/py_sr25519_bindings-0.2.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl b/vendor/linux-x86_64/py_sr25519_bindings-0.2.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl deleted file mode 100644 index e21a4ec..0000000 Binary files a/vendor/linux-x86_64/py_sr25519_bindings-0.2.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl and /dev/null differ diff --git a/vendor/linux-x86_64/pyasn1-0.6.1-py3-none-any.whl b/vendor/linux-x86_64/pyasn1-0.6.1-py3-none-any.whl deleted file mode 100644 index eef3fa5..0000000 Binary files a/vendor/linux-x86_64/pyasn1-0.6.1-py3-none-any.whl and /dev/null differ diff --git a/vendor/linux-x86_64/pycparser-2.23-py3-none-any.whl b/vendor/linux-x86_64/pycparser-2.23-py3-none-any.whl deleted file mode 100644 index 0748c19..0000000 Binary files a/vendor/linux-x86_64/pycparser-2.23-py3-none-any.whl and /dev/null differ diff --git a/vendor/linux-x86_64/pycryptodome-3.23.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl b/vendor/linux-x86_64/pycryptodome-3.23.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl deleted file mode 100644 index a0f9a68..0000000 Binary files a/vendor/linux-x86_64/pycryptodome-3.23.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl and /dev/null differ diff --git a/vendor/linux-x86_64/pycryptodomex-3.23.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl b/vendor/linux-x86_64/pycryptodomex-3.23.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl deleted file mode 100644 index 042b992..0000000 Binary files a/vendor/linux-x86_64/pycryptodomex-3.23.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl and /dev/null differ diff --git a/vendor/linux-x86_64/pynacl-1.6.2-cp38-abi3-manylinux_2_34_x86_64.whl b/vendor/linux-x86_64/pynacl-1.6.2-cp38-abi3-manylinux_2_34_x86_64.whl deleted file mode 100644 index cd7f3cf..0000000 Binary files a/vendor/linux-x86_64/pynacl-1.6.2-cp38-abi3-manylinux_2_34_x86_64.whl and /dev/null differ diff --git a/vendor/linux-x86_64/pyzipper-0.3.6-py2.py3-none-any.whl b/vendor/linux-x86_64/pyzipper-0.3.6-py2.py3-none-any.whl deleted file mode 100644 index 98a5dac..0000000 Binary files a/vendor/linux-x86_64/pyzipper-0.3.6-py2.py3-none-any.whl and /dev/null differ diff --git a/vendor/linux-x86_64/six-1.17.0-py2.py3-none-any.whl b/vendor/linux-x86_64/six-1.17.0-py2.py3-none-any.whl deleted file mode 100644 index c506fd0..0000000 Binary files a/vendor/linux-x86_64/six-1.17.0-py2.py3-none-any.whl and /dev/null differ