move to py37 and requirements*txt

This commit is contained in:
Manuel Barkhau 2018-09-05 08:42:48 +02:00
parent 6aa16f7b37
commit 7125934418
5 changed files with 50 additions and 32 deletions

3
.gitignore vendored
View file

@ -28,6 +28,9 @@ var/
.eggs/ .eggs/
.pytest_cache/ .pytest_cache/
# source dirs have to be explicitly added
src/
# PyInstaller # PyInstaller
# Usually these files are written by a python script from a template # Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it. # before PyInstaller builds the exe, so as to inject date/other infos into it.

View file

@ -31,18 +31,22 @@ BUILD_LOG_DIR = "test_build_logs/"
BUILD_LOG_FILE := $(shell date +"$(BUILD_LOG_DIR)%Y%m%dt%H%M%S%N.log") BUILD_LOG_FILE := $(shell date +"$(BUILD_LOG_DIR)%Y%m%dt%H%M%S%N.log")
build/.install.make_marker: setup.py build/envs.txt build/.install.make_marker: setup.py build/envs.txt requirements*.txt
$(PYTHON36) -m pip install --upgrade --quiet \ $(PYTHON37) -m pip install --upgrade --quiet $$(cat requirements.txt);
pip setuptools wheel twine \ $(PYTHON36) -m pip install --upgrade --quiet $$(cat requirements.txt);
flake8 mypy typing-extensions \ $(PYTHON27) -m pip install --upgrade --quiet $$(cat requirements.txt);
rst2html5 \
pytest pytest-cov \
ipython pudb \
pathlib2 click;
$(PYTHON37) -m pip install --upgrade --quiet pip setuptools wheel; $(PYTHON37) -m pip install --upgrade \
$(PYTHON36) -m pip install --upgrade --quiet pip setuptools wheel; $$(cat requirements-test.txt) \
$(PYTHON27) -m pip install --upgrade --quiet pip setuptools wheel; $$(cat requirements-dev.txt);
# NOTE (mb 2018-08-23): The linter has an issue running with
# python 3.7 because some code in pycodestyle=2.3.1
# but we have to wait for a flake8 update because
# reasons... https://github.com/PyCQA/pycodestyle/issues/728
@mkdir -p lib/
$(PYTHON37) -m pip install --src lib/ \
-e "git+https://gitlab.com/pycqa/flake8@master#egg=flake8";
@mkdir -p build/ @mkdir -p build/
@touch build/.install.make_marker @touch build/.install.make_marker
@ -54,28 +58,22 @@ clean:
rm -f build/.install.make_marker rm -f build/.install.make_marker
# NOTE (mb 2018-08-23): The linter has an issue running with
# python 3.7 because some code in pycodestyle=2.3.1
# but we have to wait for a flake8 update because
# reasons... https://github.com/PyCQA/pycodestyle/issues/728
lint: build/.install.make_marker lint: build/.install.make_marker
@echo -n "lint.." @echo -n "lint.."
@$(PYTHON36) -m flake8 src/pycalver/ @$(PYENV37)/bin/flake8 src/pycalver/
@echo "ok" @echo "ok"
mypy: build/.install.make_marker mypy: build/.install.make_marker
@echo -n "mypy.." @echo -n "mypy.."
@MYPYPATH=stubs/ $(PYTHON36) -m mypy \ @MYPYPATH=stubs/ $(PYTHON37) -m mypy \
src/pycalver/ src/pycalver/
@echo "ok" @echo "ok"
test: build/.install.make_marker test: build/.install.make_marker
@PYTHONPATH=src/:$$PYTHONPATH \ @PYTHONPATH=src/:$$PYTHONPATH \
$(PYTHON36) -m pytest \ $(PYTHON37) -m pytest \
--cov-report html \ --cov-report html \
--cov=pycalver \ --cov=pycalver \
test/ test/
@ -83,7 +81,7 @@ test: build/.install.make_marker
devtest: build/.install.make_marker devtest: build/.install.make_marker
PYTHONPATH=src/:$$PYTHONPATH \ PYTHONPATH=src/:$$PYTHONPATH \
$(PYTHON36) -m pytest -v \ $(PYTHON37) -m pytest -v \
--cov-report term \ --cov-report term \
--cov=pycalver \ --cov=pycalver \
--capture=no \ --capture=no \
@ -107,7 +105,7 @@ build/README.html: build/.install.make_marker README.rst CHANGELOG.rst
@cat README.rst > build/.full_readme.rst @cat README.rst > build/.full_readme.rst
@echo "\n" >> build/.full_readme.rst @echo "\n" >> build/.full_readme.rst
@cat CHANGELOG.rst >> build/.full_readme.rst @cat CHANGELOG.rst >> build/.full_readme.rst
@$(PYENV36)/bin/rst2html5 --strict \ @$(PYENV37)/bin/rst2html5 --strict \
build/.full_readme.rst > build/README.html.tmp build/.full_readme.rst > build/README.html.tmp
@mv build/README.html.tmp build/README.html @mv build/README.html.tmp build/README.html
@echo "updated build/README.html" @echo "updated build/README.html"
@ -123,17 +121,18 @@ build/.src_files.txt: setup.py build/envs.txt src/pycalver/*.py
rm_site_packages: rm_site_packages:
rm -rf $(PYENV36)/lib/python3.6/site-packages/pycalver/ # whackamole
rm -rf $(PYENV36)/lib/python3.6/site-packages/pycalver*.dist-info/ rm -rf $(PYENV37)/lib/python3.6/site-packages/pycalver/
rm -rf $(PYENV36)/lib/python3.6/site-packages/pycalver*.egg-info/ rm -rf $(PYENV37)/lib/python3.6/site-packages/pycalver*.dist-info/
rm -f $(PYENV36)/lib/python3.6/site-packages/pycalver*.egg rm -rf $(PYENV37)/lib/python3.6/site-packages/pycalver*.egg-info/
rm -f $(PYENV37)/lib/python3.6/site-packages/pycalver*.egg
build/.local_install.make_marker: build/.src_files.txt rm_site_packages build/.local_install.make_marker: build/.src_files.txt rm_site_packages
@echo "installing pycalver.." @echo "installing pycalver.."
@$(PYTHON36) setup.py install --no-compile --verbose @$(PYTHON37) setup.py install --no-compile --verbose
@mkdir -p build/ @mkdir -p build/
@$(PYTHON36) -c "import pycalver" @$(PYTHON37) -c "import pycalver"
@echo "install completed for pycalver" @echo "install completed for pycalver"
@touch build/.local_install.make_marker @touch build/.local_install.make_marker
@ -142,13 +141,13 @@ build: build/.local_install.make_marker
@mkdir -p $(BUILD_LOG_DIR) @mkdir -p $(BUILD_LOG_DIR)
@echo "writing full build log to $(BUILD_LOG_FILE)" @echo "writing full build log to $(BUILD_LOG_FILE)"
@echo "building pycalver.." @echo "building pycalver.."
@$(PYTHON36) setup.py bdist_wheel --python-tag=py2.py3 >> $(BUILD_LOG_FILE) @$(PYTHON37) setup.py bdist_wheel --python-tag=py2.py3 >> $(BUILD_LOG_FILE)
@echo "build completed for pycalver" @echo "build completed for pycalver"
upload: build/.install.make_marker build/README.html upload: build/.install.make_marker build/README.html
$(PYTHON36) setup.py bdist_wheel --python-tag=py2.py3 $(PYTHON37) setup.py bdist_wheel --python-tag=py2.py3
$(PYENV36)/bin/twine upload $(BDIST_WHEEL_PYCALVER) $(PYENV37)/bin/twine upload $(BDIST_WHEEL_PYCALVER)
setup_conda_envs: build/.setup_conda_envs.make_marker setup_conda_envs: build/.setup_conda_envs.make_marker
@ -156,4 +155,4 @@ setup_conda_envs: build/.setup_conda_envs.make_marker
install: build/.install.make_marker install: build/.install.make_marker
run_main: run_main:
PYTHONPATH=src/:$$PYTHONPATH $(PYTHON36) -m pycalver --help PYTHONPATH=src/:$$PYTHONPATH $(PYTHON37) -m pycalver --help

5
requirements-dev.txt Normal file
View file

@ -0,0 +1,5 @@
wheel
pip
twine
ipython
pudb

7
requirements-test.txt Normal file
View file

@ -0,0 +1,7 @@
flake8
mypy
typing-extensions
rst2html5
pytest
pytest-cov
codecov

4
requirements.txt Normal file
View file

@ -0,0 +1,4 @@
setuptools
pathlib2
typing
click