From 52b1b7370a6646d42ca170ac3deb8004c374f2fc Mon Sep 17 00:00:00 2001 From: Andre Perkins Date: Wed, 2 Oct 2024 22:52:32 +0000 Subject: [PATCH] Deploy targets in makefile --- Makefile | 11 +++++++++++ fme/deploy-requirements.txt | 2 ++ pyproject.toml | 1 + 3 files changed, 14 insertions(+) create mode 100644 fme/deploy-requirements.txt diff --git a/Makefile b/Makefile index 671b411..664b16a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ VERSION ?= $(shell git rev-parse --short HEAD) IMAGE ?= fme ENVIRONMENT_NAME ?= fme +DEPLOY_TARGET ?= pypi build_docker_image: docker build -f docker/Dockerfile -t $(IMAGE):$(VERSION) . @@ -16,3 +17,13 @@ create_environment: test: pytest --durations 20 . + +# For maintainer use only +# requires fme[deploy] to be installed +deploy_pypi: + rm -rf dist/* + python -m build + twine upload --repository $(DEPLOY_TARGET) dist/* + +deploy_test_pypi: DEPLOY_TARGET = testpypi +deploy_test_pypi: deploy_pypi diff --git a/fme/deploy-requirements.txt b/fme/deploy-requirements.txt new file mode 100644 index 0000000..51e16c7 --- /dev/null +++ b/fme/deploy-requirements.txt @@ -0,0 +1,2 @@ +build +twine \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 66b24f3..4c59bbe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,6 +29,7 @@ Documentation = "https://ai2-climate-emulator.readthedocs.io/" dependencies = { file = "fme/requirements.txt" } optional-dependencies.dev = { file = "fme/dev-requirements.txt" } optional-dependencies.docs = { file = "fme/docs/requirements.txt" } +optional-dependencies.deploy = { file = "fme/deploy-requirements.txt" } [tool.setuptools.packages.find] where = ["fme"]