From c93f1997fc519f86c53dbfbdeeece2e43f035cdf Mon Sep 17 00:00:00 2001 From: Nick Pegg Date: Mon, 5 Aug 2024 19:29:40 -0700 Subject: [PATCH] basic PEX tooling to build independent binaries --- Makefile | 10 +++++----- poetry.lock | 18 ++++++++++++++++-- pyproject.toml | 3 ++- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 1d96c95..8e074e1 100644 --- a/Makefile +++ b/Makefile @@ -33,11 +33,11 @@ test-fast: test-watch: find . -name '*py' -or -name '*html' -or -name poetry.lock | entr -r -c make test-fast -run: - podman-compose up - build: + poetry build + +docker: podman build -t nickpegg/photojawn . --build-arg GIT_COMMIT=$(shell git rev-parse --short HEAD) -clean: - podman-compose down --rmi all +pex: + poetry run pex --project . -o dist/photojawn.pex --scie eager -c photojawn diff --git a/poetry.lock b/poetry.lock index ebf1e08..5c9194d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -290,6 +290,20 @@ files = [ {file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"}, ] +[[package]] +name = "pex" +version = "2.14.1" +description = "The PEX packaging toolchain." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,<3.14,>=2.7" +files = [ + {file = "pex-2.14.1-py2.py3-none-any.whl", hash = "sha256:43210f64e5461d91ad6c99d80724e83f5010bfa82a1664bf44ffdb14e2defb58"}, + {file = "pex-2.14.1.tar.gz", hash = "sha256:e71296873101732deffa5341d7dc9a9d8ed9e58413acc07579f7b39998c273a2"}, +] + +[package.extras] +subprocess = ["subprocess32 (>=3.2.7)"] + [[package]] name = "pillow" version = "10.4.0" @@ -590,5 +604,5 @@ files = [ [metadata] lock-version = "2.0" -python-versions = "^3.12" -content-hash = "3f22f947559bd9d54a838d51953828baa88e2485fb90c33931359511805cacc9" +python-versions = "^3.12,<3.14" +content-hash = "9ec27256e1d8988f06634a217388d357a211f6120d6ade104fdd87182b18279c" diff --git a/pyproject.toml b/pyproject.toml index 0794638..d5112c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ photojawn = 'photojawn.cli:main' [tool.poetry.dependencies] # TODO: make sure we support >=3.10 via tests -python = "^3.12" +python = "^3.12,<3.14" jinja2 = "^3.1.4" pillow = "^10.4.0" rich = "^13.7.1" @@ -26,6 +26,7 @@ mypy = "*" pytest-testmon = "*" types-pyyaml = "^6.0.12.20240724" types-markdown = "^3.6.0.20240316" +pex = "^2.14.1" [tool.mypy]