Skip to content

Commit

Permalink
updated setup related files
Browse files Browse the repository at this point in the history
  • Loading branch information
sugatoray committed Jan 7, 2022
1 parent bc25ea2 commit 79033b7
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# User Defined
.vscode
housekeeper

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
32 changes: 31 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
.PHONY: black flake test types install interrogate build buildcheck pypi testpypi clean cleanall style check pipinstalltest this
.PHONY: black flake test types install interrogate \
build buildcheck buildplus buildcheckplus getpackageinfo \
github pypi testpypi \
clean cleanall style check pipinstalltest \
this thispy thatpy

PACKAGE_NAME := "genespeak"
TESTPYPI_DOWNLOAD_URL := "https://test.pypi.org/simple/"
PYPIPINSTALL := "python -m pip install -U --index-url"
PIPINSTALL_PYPITEST := "$(PYPIPINSTALL) $(TESTPYPI_DOWNLOAD_URL)"
PKG_INFO := "import pkginfo; dev = pkginfo.Develop('.'); print((dev.$${FIELD}))"


black:
black --target-version py38 $(PACKAGE_NAME) tests setup.py
Expand Down Expand Up @@ -33,6 +39,20 @@ build: clean
buildcheck: cleanall build
twine check dist/*

buildplus: build getpackageinfo

buildcheckplus: buildcheck getpackageinfo

getpackageinfo:
$(eval PKG_NAME := $(shell FIELD="name" && python -c $(PKG_INFO);))
@echo PKG_NAME is: [$(PKG_NAME)]
$(eval PKG_VERSION := $(shell FIELD="version" && python -c $(PKG_INFO);))
@echo PKG_VERSION is: [$(PKG_VERSION)]

github: buildplus
# creating a github release: https://cli.github.com/manual/gh_release_create
gh release create v$(PKG_VERSION) ./dist/$(PKG_NAME)-$(PKG_VERSION)*.*

pypi: build
twine upload dist/*

Expand All @@ -56,3 +76,13 @@ pipinstalltest:
this:
# example: make this VERSION="0.0.3"
@if [ $(VERSION) ]; then echo This is $(PACKAGE_NAME)==$(VERSION); else echo This is $(PACKAGE_NAME); fi;

thispy:
# example: https://lists.gnu.org/archive/html/help-make/2015-03/msg00011.html
@FIELD="name" && python -c $(PKG_INFO);
@FIELD="version" && python -c $(PKG_INFO);
$(eval FIELD := "name")
@echo FIELD is: [$(FIELD)]

thatpy: thispy
@echo FIELD is: [$(FIELD)]
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"twine",
"setuptools",
"build",
"pkginfo>=1.8.2",
]

all_packages = base_packages
Expand Down

0 comments on commit 79033b7

Please sign in to comment.