Skip to content

Commit

Permalink
replace pipenv with pip-tools
Browse files Browse the repository at this point in the history
  • Loading branch information
siddhantgoel committed Nov 30, 2018
1 parent 9d88476 commit 12df119
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 328 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
language: python

cache: pip

python:
- "3.4"
- "3.5"
- "3.6"

install:
- pip install pipenv
- make install-local
- make install-deps
- make build

script:
- make test
81 changes: 37 additions & 44 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,64 +1,57 @@
help:
$(info The following make commands are available:)
$(info clean - remove all generated files and directories)
$(info test-all - install locally, prepare for PyPI, run tests, speed test, profiler)
$(info build - prepare PyPI module archive)
$(info upload - upload built module archive to PyPI)
$(info install-local - build the module in the current directory)
$(info it will be available for import from the project root directory)
$(info test - run tests and check code formatting)
$(info profile - gather library function call statistics (time, count, ...))
$(info speedtest - calculate library bandwidth)
@:
cython-file := streaming_form_data/_parser.pyx

clean:
rm -rf build/
rm -rf dist/
rm -rf streaming_form_data.egg-info

cython-file := streaming_form_data/_parser.pyx
install-local-output := build/install.touch
requirements-output := build/requirements.touch
#
# Development
#

test-all: build test speedtest profile annotate ;
annotate:
cython -a $(cython-file) -o build/annotation.html

build: $(requirements-output)
python setup.py sdist
@echo "Build PyPI archive is complete."
compile:
cython $(cython-file)

upload: build
twine upload dist/*
test:
flake8
py.test

install-local: $(install-local-output) ;
update-deps:
pip-compile requirements.dev.in > requirements.dev.txt

test: $(install-local-output)
py.test
flake8
install-deps:
pip install -r requirements.dev.txt

speedtest: $(install-local-output)
python utils/speedtest.py
build:
python setup.py build_ext --inplace

profile: $(install-local-output)
python utils/profile.py --data-size 17555000 -c binary/octet-stream
local: update-deps install-deps build

annotate: $(requirements-output)
mkdir -p build
cython -a $(cython-file) -o build/annotation.html
#
# Utils
#

# All targets where the names do not match any real file name
speed-test:
python utils/speedtest.py

.PHONY: help clean test-all build upload install-local test speedtest profile annotate
profile:
python utils/profile.py --data-size 17555000 -c binary/octet-stream

# Real file rules
#
# PyPI
#

library_inputs := setup.py \
$(shell find streaming_form_data -maxdepth 1 -name "*.py") \
$(cython-file)
dist:
python setup.py sdist

$(requirements-output):
pipenv install --dev
@mkdir -p "$(@D)" && touch "$@"
publish: package
twine upload dist/*

$(install-local-output): $(requirements-output) $(library_inputs)
pipenv install
@mkdir -p "$(@D)" && touch "$@"
.PHONY: clean \
annotate compile test \
speed-test profile \
update-deps install-deps build local \
dist publish
19 changes: 0 additions & 19 deletions Pipfile

This file was deleted.

0 comments on commit 12df119

Please sign in to comment.