-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e9309ce
commit b08053a
Showing
1 changed file
with
13 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
PYTHON := $(shell command -v python3 || command -v python || echo "none") | ||
PIP3 := $(shell command -v pip3 || command -v pip || echo "none") | ||
PG_VERSION := 16 | ||
PYTHON ?= $(shell which python3 || which python) | ||
PIP ?= $(shell which pip3 || which pip) | ||
PG_VERSION ?= 16 | ||
|
||
.PHONY: run | ||
run: | ||
cargo pgrx run | ||
@cargo pgrx run | ||
|
||
.PHONY: clean | ||
clean: | ||
cargo clean | ||
@cargo clean | ||
|
||
.PHONY: init | ||
init: | ||
cargo install --locked cargo-pgrx | ||
cargo pgrx init --pg$(PG_VERSION) download | ||
@cargo install --locked cargo-pgrx | ||
@cargo pgrx init --pg$(PG_VERSION) download | ||
|
||
.PHONY: lint | ||
lint: | ||
cargo fmt --check | ||
cargo clippy | ||
@cargo fmt --check | ||
@cargo clippy | ||
|
||
.PHONY: test | ||
test: | ||
@if [ "$(PYTHON)" = "none" ]; then echo >&2 "Error: python3 is required."; exit 1; fi | ||
@if [ "$(PIP)" = "none" ]; then echo >&2 "Error: pip3 is required."; exit 1; fi | ||
$(PIP3) install aiosmtpd | ||
trap 'kill `cat /tmp/smtpd.pid`' EXIT; \ | ||
@if [ -z "$(PYTHON)" ]; then echo "python3 or python not found"; exit 1; fi | ||
@if [ -z "$(PIP)" ]; then echo "pip3 or pip not found"; exit 1; fi | ||
@$(PIP) install aiosmtpd | ||
@trap 'kill `cat /tmp/smtpd.pid`' EXIT; \ | ||
$(PYTHON) -m aiosmtpd -n & echo $$! > /tmp/smtpd.pid; \ | ||
cargo pgrx test pg$(PG_VERSION) |