-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from nsat/makefile_update
Smarter/better makefile; now with upload capability and builds source distribution. Ran black on setup.py
- Loading branch information
Showing
4 changed files
with
66 additions
and
20 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 |
---|---|---|
|
@@ -90,6 +90,7 @@ venv/ | |
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
.makerc | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
|
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,14 +1,58 @@ | ||
.PHONEY: help | ||
VERSION := $(shell python ./setup.py --version) | ||
NAME := $(shell python ./setup.py --name) | ||
ARCH ?= linux_x86_64 | ||
src := predict.py predict.c setup.py | ||
sdist := dist/$(NAME)-$(VERSION).tar.gz | ||
wheels := dist/$(NAME)-$(VERSION)-cp27-cp27m-$(ARCH).whl \ | ||
dist/$(NAME)-$(VERSION)-cp35-cp35m-$(ARCH).whl \ | ||
dist/$(NAME)-$(VERSION)-cp37-cp37m-$(ARCH).whl \ | ||
dist/$(NAME)-$(VERSION)-cp27-cp27mu-$(ARCH).whl \ | ||
dist/$(NAME)-$(VERSION)-cp36-cp36m-$(ARCH).whl \ | ||
dist/$(NAME)-$(VERSION)-cp38-cp38-$(ARCH).whl | ||
|
||
-include .makerc | ||
|
||
.PHONY: help | ||
help: | ||
@echo "Targets:" | ||
@echo " clean: Removes distribution folders and artifacts from building" | ||
@echo " manylinux-wheels: Builds binary and manylinux wheels for several python versions" | ||
@echo " clean: Removes distribution folders and artifacts from building" | ||
@echo " build: Builds source and wheel distributions" | ||
@echo " upload: Uploads built source and wheel distributions to repository" | ||
@echo " Requires env vars `REPO`, `USER`, `PASSWORD`" | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf dist wheelhouse build __pycache__ *.so *.egg-info | ||
rm -rf wheelhouse dist/ build/ __pycache__/ *.egg-info/ tletools/*.pyc venv .pytest_cache/ | ||
|
||
.PHONY: build | ||
build: sdist manylinux-wheels | ||
|
||
.PHONY: manylinux-wheels | ||
manylinux-wheels: | ||
docker run --user $(shell id -u):$(shell id -g) -v $(shell pwd):/io quay.io/pypa/manylinux1_x86_64:latest \ | ||
manylinux-wheels: $(wheels) | ||
|
||
$(wheels) &: $(src) | ||
docker run --user $(shell id -u):$(shell id -g) -v $(shell pwd):/io \ | ||
quay.io/pypa/manylinux1_x86_64:latest \ | ||
/io/bin/build-manylinux-wheel.sh 27 35 36 37 38 | ||
|
||
.PHONY: sdist | ||
sdist: $(sdist) | ||
|
||
$(sdist): $(src) | ||
python setup.py sdist | ||
|
||
.PHONY: upload | ||
upload: build check-env | ||
twine upload --repository-url ${REPO} --username ${USER} --password "${PASSWORD}" dist/* | ||
|
||
.PHONY: check-env | ||
check-env: | ||
ifndef REPO | ||
$(error $REPO must be specified) | ||
endif | ||
ifndef USER | ||
$(error USER must be specified) | ||
endif | ||
ifndef PASSWORD | ||
$(error PASSWORD must be specified) | ||
endif |
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
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,20 +1,21 @@ | ||
#!/usr/bin/env python | ||
|
||
from setuptools import setup, Extension | ||
|
||
setup( | ||
name='pypredict', | ||
version='1.6.0', | ||
name="pypredict", | ||
version="1.6.1", | ||
author="Jesse Trutna", | ||
author_email="[email protected]", | ||
url="https://github.com/nsat/pypredict", | ||
py_modules=['predict'], | ||
ext_modules=[Extension('cpredict', ['predict.c'])], | ||
py_modules=["predict"], | ||
ext_modules=[Extension("cpredict", ["predict.c"])], | ||
classifiers=[ | ||
'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.8', | ||
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", | ||
"Programming Language :: Python :: 2.7", | ||
"Programming Language :: Python :: 3.5", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
], | ||
) | ||
) |