Skip to content

Commit 4faf7b3

Browse files
authored
Merge pull request #181 from brandonbiggs/pyproject
Added a small makefile to help with building, installing, and linting…
2 parents aae39f9 + 713ebeb commit 4faf7b3

File tree

3 files changed

+63
-0
lines changed

3 files changed

+63
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ dist/
33
*.egg-info/
44
*.xlsx
55
launch.json
6+
uv.lock

Makefile

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
VERSION := 3.3.8
2+
UNAME := $(shell uname -s)
3+
4+
##@
5+
##@ Help
6+
##@
7+
8+
.PHONY: help
9+
help: ##@ (Default) Print listing of key targets with their descriptions
10+
@printf "\nUsage: make <command>\n"
11+
ifeq ($(UNAME), Linux)
12+
@grep -F -h "##@" $(MAKEFILE_LIST) | grep -F -v grep -F | sed -e 's/\\$$//' | awk 'BEGIN {FS = ":*[[:space:]]*##@[[:space:]]*"}; \
13+
{ \
14+
if($$2 == "") \
15+
pass; \
16+
else if($$0 ~ /^#/) \
17+
printf "\n\n%s\n", $$2; \
18+
else if($$1 == "") \
19+
printf " %-20s%s\n", "", $$2; \
20+
else \
21+
printf "\n \033[34m%-20s\033[0m %s", $$1, $$2; \
22+
}'
23+
@printf "\n\n"
24+
else ifeq ($(UNAME), Darwin)
25+
@grep -F -h "##@" $(MAKEFILE_LIST) | grep -F -v grep -F | sed -e 's/\\$$//' | awk 'BEGIN {FS = ":*[[:space:]]*##@[[:space:]]*"}; \
26+
{ \
27+
if($$2 == "") \
28+
next; \
29+
else if($$0 ~ /^#/) \
30+
printf "\n\n%s\n", $$2; \
31+
else if($$1 == "") \
32+
printf " %-20s%s\n", "", $$2; \
33+
else \
34+
printf "\n \033[34m%-20s\033[0m %s", $$1, $$2; \
35+
}'
36+
@printf "\n\n"
37+
else
38+
@printf "\nmake help not supported on $(uname)\n"
39+
endif
40+
.DEFAULT_GOAL := help
41+
42+
##@
43+
##@ Commands
44+
##@
45+
46+
build: ##@ Build the python package
47+
python setup.py sdist
48+
49+
install: ##@ Install with pip
50+
pip install dist/redfish_utilities-${VERSION}.tar.gz
51+
52+
install-uv: ##@ Install with uv
53+
uv pip install dist/redfish_utilities-${VERSION}.tar.gz
54+
55+
lint: ##@ Run linting
56+
black .

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[tool.black]
2+
line-length = 120
3+
4+
# uv package manager
5+
[tool.uv]
6+
native-tls = true

0 commit comments

Comments
 (0)