mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-12 14:30:09 +01:00
bootstrapit update
This commit is contained in:
parent
afe90a8d74
commit
4bf07261d8
8 changed files with 201 additions and 93 deletions
7
activate
Normal file
7
activate
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
# This is a convenience for development purposes,
|
||||||
|
# for deployments you should set the appropriate
|
||||||
|
# environment variables explicitly and use fully
|
||||||
|
# qualified paths to the interpreter, as is done
|
||||||
|
# for example in the Dockerfile
|
||||||
|
|
||||||
|
source <(make activate;);
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
# Stages:
|
# Stages:
|
||||||
# alpine_base : Common base image, both for the builder and for the final image.
|
# base_image : Common base image, both for the builder and for the final image.
|
||||||
# This contains only minimal dependencies required in both cases
|
# This contains only minimal dependencies required in both cases
|
||||||
# for miniconda and the makefile.
|
# for miniconda and the makefile.
|
||||||
# builder : stage in which the conda envrionment is created
|
# builder : stage in which the conda envrionment is created
|
||||||
# and dependencies are installed
|
# and dependencies are installed
|
||||||
# final : the final image containing only the required environment files,
|
# final : the final image containing only the required environment files,
|
||||||
# and none of the infrastructure required to generate them.
|
# and none of the infrastructure required to generate them.
|
||||||
|
|
||||||
FROM frolvlad/alpine-glibc AS alpine_base
|
FROM debian:stable-slim AS base_image
|
||||||
|
|
||||||
ENV LC_ALL=C.UTF-8
|
ENV LC_ALL=C.UTF-8
|
||||||
ENV LANG=C.UTF-8
|
ENV LANG=C.UTF-8
|
||||||
|
|
@ -17,14 +17,27 @@ ENV CONDA_DIR /opt/conda
|
||||||
ENV PATH $CONDA_DIR/bin:$PATH
|
ENV PATH $CONDA_DIR/bin:$PATH
|
||||||
ENV SHELL /bin/bash
|
ENV SHELL /bin/bash
|
||||||
|
|
||||||
RUN apk add --no-cache bash make sed grep gawk curl bzip2 unzip
|
RUN if [ $(which apk) ]; then \
|
||||||
RUN apk add --no-cache git mercurial
|
apk add --no-cache bash make sed grep gawk curl git bzip2 unzip; \
|
||||||
|
elif [ $(which apt-get) ]; then \
|
||||||
|
apt-get update && apt-get install --yes bash make sed grep gawk curl git bzip2 unzip; \
|
||||||
|
else \
|
||||||
|
echo "Invalid Distro: $(uname -a)"; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
CMD [ "/bin/bash" ]
|
CMD [ "/bin/bash" ]
|
||||||
|
|
||||||
FROM alpine_base AS builder
|
FROM base_image AS builder
|
||||||
|
|
||||||
RUN apk add --no-cache ca-certificates openssh-client openssh-keygen
|
RUN if [ $(which apk) ]; then \
|
||||||
|
apk add --no-cache ca-certificates openssh-client openssh-keygen; \
|
||||||
|
elif [ $(which apt-get) ]; then \
|
||||||
|
apt-get --yes install ca-certificates openssh-client; \
|
||||||
|
else \
|
||||||
|
echo "Invalid Distro: $(uname -a)"; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
ENV MINICONDA_VER latest
|
ENV MINICONDA_VER latest
|
||||||
ENV MINICONDA Miniconda3-$MINICONDA_VER-Linux-x86_64.sh
|
ENV MINICONDA Miniconda3-$MINICONDA_VER-Linux-x86_64.sh
|
||||||
|
|
@ -90,7 +103,7 @@ RUN conda clean --all --yes && \
|
||||||
rm -rf /opt/conda/pkgs/
|
rm -rf /opt/conda/pkgs/
|
||||||
|
|
||||||
|
|
||||||
FROM alpine_base
|
FROM base_image
|
||||||
|
|
||||||
COPY --from=builder /opt/conda/ /opt/conda/
|
COPY --from=builder /opt/conda/ /opt/conda/
|
||||||
COPY --from=builder /vendor/ /vendor
|
COPY --from=builder /vendor/ /vendor
|
||||||
|
|
|
||||||
220
makefile
220
makefile
|
|
@ -14,10 +14,6 @@ SHELL := /bin/bash
|
||||||
|
|
||||||
PROJECT_DIR := $(notdir $(abspath .))
|
PROJECT_DIR := $(notdir $(abspath .))
|
||||||
|
|
||||||
ifndef MODULE_SRC_PATH
|
|
||||||
MODULE_SRC_PATH := $(notdir $(abspath .))
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef DEVELOPMENT_PYTHON_VERSION
|
ifndef DEVELOPMENT_PYTHON_VERSION
|
||||||
DEVELOPMENT_PYTHON_VERSION := python=3.6
|
DEVELOPMENT_PYTHON_VERSION := python=3.6
|
||||||
endif
|
endif
|
||||||
|
|
@ -27,7 +23,6 @@ ifndef SUPPORTED_PYTHON_VERSIONS
|
||||||
endif
|
endif
|
||||||
|
|
||||||
PKG_NAME := $(PACKAGE_NAME)
|
PKG_NAME := $(PACKAGE_NAME)
|
||||||
MODULE_SRC_PATH = src/$(PKG_NAME)/
|
|
||||||
|
|
||||||
# TODO (mb 2018-09-23): Support for bash on windows
|
# TODO (mb 2018-09-23): Support for bash on windows
|
||||||
# perhaps we need to install conda using this
|
# perhaps we need to install conda using this
|
||||||
|
|
@ -35,7 +30,7 @@ MODULE_SRC_PATH = src/$(PKG_NAME)/
|
||||||
PLATFORM = $(shell uname -s)
|
PLATFORM = $(shell uname -s)
|
||||||
|
|
||||||
# miniconda is shared between projects
|
# miniconda is shared between projects
|
||||||
CONDA_ROOT := $(shell if [[ -d /opt/conda ]]; then echo "/opt/conda"; else echo "$$HOME/miniconda3"; fi;)
|
CONDA_ROOT := $(shell if [[ -d /opt/conda/envs ]]; then echo "/opt/conda"; else echo "$$HOME/miniconda3"; fi;)
|
||||||
CONDA_BIN := $(CONDA_ROOT)/bin/conda
|
CONDA_BIN := $(CONDA_ROOT)/bin/conda
|
||||||
|
|
||||||
ENV_PREFIX := $(CONDA_ROOT)/envs
|
ENV_PREFIX := $(CONDA_ROOT)/envs
|
||||||
|
|
@ -49,6 +44,15 @@ CONDA_ENV_NAMES := \
|
||||||
CONDA_ENV_PATHS := \
|
CONDA_ENV_PATHS := \
|
||||||
$(subst py,${ENV_PREFIX}/$(PKG_NAME)_py,$(subst .,,$(subst =,,$(subst thon,,$(SUPPORTED_PYTHON_VERSIONS)))))
|
$(subst py,${ENV_PREFIX}/$(PKG_NAME)_py,$(subst .,,$(subst =,,$(subst thon,,$(SUPPORTED_PYTHON_VERSIONS)))))
|
||||||
|
|
||||||
|
literal_space := $() $()
|
||||||
|
|
||||||
|
BDIST_WHEEL_PYTHON_TAG := \
|
||||||
|
$(subst python,py,$(subst $(literal_space),.,$(subst .,,$(subst =,,$(SUPPORTED_PYTHON_VERSIONS)))))
|
||||||
|
|
||||||
|
SDIST_FILE_CMD = ls -1t dist/*.tar.gz | head -n 1
|
||||||
|
|
||||||
|
BDIST_WHEEL_FILE_CMD = ls -1t dist/*.whl | head -n 1
|
||||||
|
|
||||||
|
|
||||||
# default version for development
|
# default version for development
|
||||||
DEV_ENV := $(ENV_PREFIX)/$(DEV_ENV_NAME)
|
DEV_ENV := $(ENV_PREFIX)/$(DEV_ENV_NAME)
|
||||||
|
|
@ -56,6 +60,7 @@ DEV_ENV_PY := $(DEV_ENV)/bin/python
|
||||||
|
|
||||||
RSA_KEY_PATH := ${HOME}/.ssh/${PKG_NAME}_gitlab_runner_id_rsa
|
RSA_KEY_PATH := ${HOME}/.ssh/${PKG_NAME}_gitlab_runner_id_rsa
|
||||||
|
|
||||||
|
DOCKER_BASE_IMAGE := registry.gitlab.com/mbarkhau/pycalver/base:latest
|
||||||
|
|
||||||
build/envs.txt: requirements/conda.txt
|
build/envs.txt: requirements/conda.txt
|
||||||
@mkdir -p build/;
|
@mkdir -p build/;
|
||||||
|
|
@ -130,11 +135,9 @@ build/deps.txt: build/envs.txt requirements/*.txt
|
||||||
@mv build/deps.txt.tmp build/deps.txt
|
@mv build/deps.txt.tmp build/deps.txt
|
||||||
|
|
||||||
|
|
||||||
## This help message
|
## Short help message for each task.
|
||||||
.PHONY: help
|
.PHONY: help
|
||||||
help:
|
help:
|
||||||
@printf "Available make targets for \033[97m$(PKG_NAME)\033[0m:\n";
|
|
||||||
|
|
||||||
@awk '{ \
|
@awk '{ \
|
||||||
if ($$0 ~ /^.PHONY: [a-zA-Z\-\_0-9]+$$/) { \
|
if ($$0 ~ /^.PHONY: [a-zA-Z\-\_0-9]+$$/) { \
|
||||||
helpCommand = substr($$0, index($$0, ":") + 2); \
|
helpCommand = substr($$0, index($$0, ":") + 2); \
|
||||||
|
|
@ -143,15 +146,20 @@ help:
|
||||||
helpCommand, helpMessage; \
|
helpCommand, helpMessage; \
|
||||||
helpMessage = ""; \
|
helpMessage = ""; \
|
||||||
} \
|
} \
|
||||||
} else if ($$0 ~ /^##/) { \
|
} else if ($$0 ~ /^[a-zA-Z\-\_0-9.]+:/) { \
|
||||||
|
helpCommand = substr($$0, 0, index($$0, ":")); \
|
||||||
if (helpMessage) { \
|
if (helpMessage) { \
|
||||||
helpMessage = helpMessage"\n "substr($$0, 3); \
|
printf "\033[36m%-20s\033[0m %s\n", \
|
||||||
} else { \
|
helpCommand, helpMessage; \
|
||||||
|
helpMessage = ""; \
|
||||||
|
} \
|
||||||
|
} else if ($$0 ~ /^##/) { \
|
||||||
|
if (! (helpMessage)) { \
|
||||||
helpMessage = substr($$0, 3); \
|
helpMessage = substr($$0, 3); \
|
||||||
} \
|
} \
|
||||||
} else { \
|
} else { \
|
||||||
if (helpMessage) { \
|
if (helpMessage) { \
|
||||||
print "\n "helpMessage"\n" \
|
print " "helpMessage \
|
||||||
} \
|
} \
|
||||||
helpMessage = ""; \
|
helpMessage = ""; \
|
||||||
} \
|
} \
|
||||||
|
|
@ -177,6 +185,42 @@ help:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
## Full help message for each task.
|
||||||
|
.PHONY: fullhelp
|
||||||
|
fullhelp:
|
||||||
|
@printf "Available make targets for \033[97m$(PKG_NAME)\033[0m:\n";
|
||||||
|
|
||||||
|
@awk '{ \
|
||||||
|
if ($$0 ~ /^.PHONY: [a-zA-Z\-\_0-9]+$$/) { \
|
||||||
|
helpCommand = substr($$0, index($$0, ":") + 2); \
|
||||||
|
if (helpMessage) { \
|
||||||
|
printf "\033[36m%-20s\033[0m %s\n", \
|
||||||
|
helpCommand, helpMessage; \
|
||||||
|
helpMessage = ""; \
|
||||||
|
} \
|
||||||
|
} else if ($$0 ~ /^[a-zA-Z\-\_0-9.]+:/) { \
|
||||||
|
helpCommand = substr($$0, 0, index($$0, ":")); \
|
||||||
|
if (helpMessage) { \
|
||||||
|
printf "\033[36m%-20s\033[0m %s\n", \
|
||||||
|
helpCommand, helpMessage; \
|
||||||
|
helpMessage = ""; \
|
||||||
|
} \
|
||||||
|
} else if ($$0 ~ /^##/) { \
|
||||||
|
if (helpMessage) { \
|
||||||
|
helpMessage = helpMessage"\n "substr($$0, 3); \
|
||||||
|
} else { \
|
||||||
|
helpMessage = substr($$0, 3); \
|
||||||
|
} \
|
||||||
|
} else { \
|
||||||
|
if (helpMessage) { \
|
||||||
|
print "\n "helpMessage"\n" \
|
||||||
|
} \
|
||||||
|
helpMessage = ""; \
|
||||||
|
} \
|
||||||
|
}' \
|
||||||
|
$(MAKEFILE_LIST)
|
||||||
|
|
||||||
|
|
||||||
## -- Project Setup --
|
## -- Project Setup --
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -236,21 +280,7 @@ git_hooks:
|
||||||
ln -s "${PWD}/scripts/pre-push-hook.sh" "${PWD}/.git/hooks/pre-push"
|
ln -s "${PWD}/scripts/pre-push-hook.sh" "${PWD}/.git/hooks/pre-push"
|
||||||
|
|
||||||
|
|
||||||
|
## -- Integration --
|
||||||
# TODO make target to publish on pypi
|
|
||||||
# .PHONY: publish
|
|
||||||
# publish:
|
|
||||||
# echo "Not Implemented"
|
|
||||||
|
|
||||||
|
|
||||||
## -- Development --
|
|
||||||
|
|
||||||
|
|
||||||
## Run code formatter on src/ and test/
|
|
||||||
.PHONY: fmt
|
|
||||||
fmt:
|
|
||||||
@$(DEV_ENV)/bin/sjfmt --py36 --skip-string-normalization --line-length=100 \
|
|
||||||
src/ test/
|
|
||||||
|
|
||||||
|
|
||||||
## Run flake8 linter
|
## Run flake8 linter
|
||||||
|
|
@ -294,24 +324,24 @@ test:
|
||||||
@rm -rf "src/__pycache__";
|
@rm -rf "src/__pycache__";
|
||||||
@rm -rf "test/__pycache__";
|
@rm -rf "test/__pycache__";
|
||||||
|
|
||||||
ifndef FILTER
|
# First we test the local source tree using the dev environment
|
||||||
ENV=$${ENV-dev} PYTHONPATH=src/:vendor/:$$PYTHONPATH \
|
ENV=$${ENV-dev} PYTHONPATH=src/:vendor/:$$PYTHONPATH \
|
||||||
$(DEV_ENV_PY) -m pytest -v \
|
$(DEV_ENV_PY) -m pytest -v \
|
||||||
--doctest-modules \
|
--doctest-modules \
|
||||||
|
--verbose \
|
||||||
--cov-report html \
|
--cov-report html \
|
||||||
--cov-report term \
|
--cov-report term \
|
||||||
$(shell ls -1 src/ | awk '{ print "--cov "$$1 }') \
|
$(shell cd src/ && ls -1 */__init__.py | awk '{ print "--cov "substr($$1,0,index($$1,"/")-1) }') \
|
||||||
test/ src/;
|
test/ src/;
|
||||||
else
|
|
||||||
ENV=$${ENV-dev} PYTHONPATH=src/:vendor/:$$PYTHONPATH \
|
# Next we install the package and run the test suite against it.
|
||||||
$(DEV_ENV_PY) -m pytest -v \
|
|
||||||
--doctest-modules \
|
IFS=' ' read -r -a env_paths <<< "$(CONDA_ENV_PATHS)"; \
|
||||||
--cov-report html \
|
for i in $${!env_paths[@]}; do \
|
||||||
--cov-report term \
|
env_py=$${env_paths[i]}/bin/python; \
|
||||||
$(shell ls -1 src/ | awk '{ print "--cov "$$1 }') \
|
$${env_py} -m pip install --upgrade .; \
|
||||||
-k $(FILTER) \
|
ENV=$${ENV-dev} $${env_py} -m pytest test/; \
|
||||||
test/ src/;
|
done;
|
||||||
endif
|
|
||||||
|
|
||||||
@rm -rf ".pytest_cache";
|
@rm -rf ".pytest_cache";
|
||||||
@rm -rf "src/__pycache__";
|
@rm -rf "src/__pycache__";
|
||||||
|
|
@ -321,27 +351,58 @@ endif
|
||||||
## -- Helpers --
|
## -- Helpers --
|
||||||
|
|
||||||
|
|
||||||
|
## Run code formatter on src/ and test/
|
||||||
|
.PHONY: fmt
|
||||||
|
fmt:
|
||||||
|
@$(DEV_ENV)/bin/sjfmt --py36 --skip-string-normalization --line-length=100 \
|
||||||
|
src/ test/
|
||||||
|
|
||||||
|
|
||||||
## Shortcut for make fmt lint pylint test
|
## Shortcut for make fmt lint pylint test
|
||||||
.PHONY: check
|
.PHONY: check
|
||||||
check: fmt lint mypy test
|
check: fmt lint mypy test
|
||||||
|
|
||||||
|
|
||||||
## Start shell with environ variables set.
|
## Start subshell with environ variables set.
|
||||||
.PHONY: env
|
.PHONY: env_subshell
|
||||||
env:
|
env_subshell:
|
||||||
@bash --init-file <(echo '\
|
@bash --init-file <(echo '\
|
||||||
source $$HOME/.bashrc; \
|
source $$HOME/.bashrc; \
|
||||||
<<<<<<< HEAD
|
|
||||||
source $(CONDA_ROOT)/etc/profile.d/conda.sh \
|
|
||||||
=======
|
|
||||||
source $(CONDA_ROOT)/etc/profile.d/conda.sh; \
|
source $(CONDA_ROOT)/etc/profile.d/conda.sh; \
|
||||||
>>>>>>> fix make/bash escape issue
|
|
||||||
export ENV=$${ENV-dev}; \
|
export ENV=$${ENV-dev}; \
|
||||||
export PYTHONPATH="src/:vendor/:$$PYTHONPATH"; \
|
export PYTHONPATH="src/:vendor/:$$PYTHONPATH"; \
|
||||||
conda activate $(DEV_ENV_NAME) \
|
conda activate $(DEV_ENV_NAME) \
|
||||||
')
|
')
|
||||||
|
|
||||||
|
|
||||||
|
## Usage: "source activate", to deactivate: "deactivate"
|
||||||
|
.PHONY: activate
|
||||||
|
activate:
|
||||||
|
@echo 'source $(CONDA_ROOT)/etc/profile.d/conda.sh;'
|
||||||
|
@echo 'if [[ -z $$ENV ]]; then'
|
||||||
|
@echo ' export _env_before_activate_$(DEV_ENV_NAME)=$${ENV};'
|
||||||
|
@echo 'fi'
|
||||||
|
@echo 'if [[ -z $$PYTHONPATH ]]; then'
|
||||||
|
@echo ' export _pythonpath_before_activate_$(DEV_ENV_NAME)=$${PYTHONPATH};'
|
||||||
|
@echo 'fi'
|
||||||
|
@echo 'export ENV=$${ENV-dev};'
|
||||||
|
@echo 'export PYTHONPATH="src/:vendor/:$$PYTHONPATH";'
|
||||||
|
@echo 'conda activate $(DEV_ENV_NAME);'
|
||||||
|
@echo 'function deactivate {'
|
||||||
|
@echo ' if [[ -z $${_env_before_activate_$(DEV_ENV_NAME)} ]]; then'
|
||||||
|
@echo ' export ENV=$${_env_before_activate_$(DEV_ENV_NAME)}; '
|
||||||
|
@echo ' else'
|
||||||
|
@echo ' unset ENV;'
|
||||||
|
@echo ' fi'
|
||||||
|
@echo ' if [[ -z $${_pythonpath_before_activate_$(DEV_ENV_NAME)} ]]; then'
|
||||||
|
@echo ' export PYTHONPATH=$${_pythonpath_before_activate_$(DEV_ENV_NAME)}; '
|
||||||
|
@echo ' else'
|
||||||
|
@echo ' unset PYTHONPATH;'
|
||||||
|
@echo ' fi'
|
||||||
|
@echo ' conda deactivate;'
|
||||||
|
@echo '};'
|
||||||
|
|
||||||
|
|
||||||
## Drop into an ipython shell with correct env variables set
|
## Drop into an ipython shell with correct env variables set
|
||||||
.PHONY: ipy
|
.PHONY: ipy
|
||||||
ipy:
|
ipy:
|
||||||
|
|
@ -356,8 +417,7 @@ devtest:
|
||||||
@rm -rf "src/__pycache__";
|
@rm -rf "src/__pycache__";
|
||||||
@rm -rf "test/__pycache__";
|
@rm -rf "test/__pycache__";
|
||||||
|
|
||||||
|
ifdef FILTER
|
||||||
ifndef FILTER
|
|
||||||
ENV=$${ENV-dev} PYTHONPATH=src/:vendor/:$$PYTHONPATH \
|
ENV=$${ENV-dev} PYTHONPATH=src/:vendor/:$$PYTHONPATH \
|
||||||
$(DEV_ENV_PY) -m pytest -v \
|
$(DEV_ENV_PY) -m pytest -v \
|
||||||
--doctest-modules \
|
--doctest-modules \
|
||||||
|
|
@ -365,6 +425,7 @@ ifndef FILTER
|
||||||
--verbose \
|
--verbose \
|
||||||
--capture=no \
|
--capture=no \
|
||||||
--exitfirst \
|
--exitfirst \
|
||||||
|
-k $(FILTER) \
|
||||||
test/ src/;
|
test/ src/;
|
||||||
else
|
else
|
||||||
ENV=$${ENV-dev} PYTHONPATH=src/:vendor/:$$PYTHONPATH \
|
ENV=$${ENV-dev} PYTHONPATH=src/:vendor/:$$PYTHONPATH \
|
||||||
|
|
@ -374,7 +435,6 @@ else
|
||||||
--verbose \
|
--verbose \
|
||||||
--capture=no \
|
--capture=no \
|
||||||
--exitfirst \
|
--exitfirst \
|
||||||
-k $(FILTER) \
|
|
||||||
test/ src/;
|
test/ src/;
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
@ -386,34 +446,54 @@ endif
|
||||||
## -- Build/Deploy --
|
## -- Build/Deploy --
|
||||||
|
|
||||||
|
|
||||||
## Generate Documentation
|
# Generate Documentation
|
||||||
# .PHONY: doc
|
# .PHONY: doc
|
||||||
# doc:
|
# doc:
|
||||||
# echo "Not Implemented"
|
# echo "Not Implemented"
|
||||||
|
|
||||||
|
|
||||||
## Bump Version number in all files
|
|
||||||
# .PHONY: bump_version
|
|
||||||
# bump_version:
|
|
||||||
# echo "Not Implemented"
|
|
||||||
|
|
||||||
|
|
||||||
## Freeze dependencies of the current development env.
|
## Freeze dependencies of the current development env.
|
||||||
## The requirements files this produces should be used
|
## The requirements files this produces should be used
|
||||||
## in order to have reproducable builds, otherwise you
|
## in order to have reproducable builds, otherwise you
|
||||||
## should minimize the number of pinned versions in
|
## should minimize the number of pinned versions in
|
||||||
## your requirements.
|
## your requirements.
|
||||||
# .PHONY: freeze
|
.PHONY: freeze
|
||||||
# freeze:
|
freeze:
|
||||||
# echo "Not Implemented"
|
$(DEV_ENV_PY) -m pip freeze \
|
||||||
|
> requirements/$(shell date -u +"%Y%m%dt%H%M%S")_freeze.txt
|
||||||
|
|
||||||
|
|
||||||
## Create python sdist and bdist_wheel distributions
|
## Bump Version number in all files
|
||||||
.PHONY: build_dist
|
.PHONY: bump_version
|
||||||
build_dist:
|
bump_version:
|
||||||
$(DEV_ENV_PY) setup.py sdist bdist_wheel
|
echo "Not Implemented"
|
||||||
twine check dist/*
|
# $(DEV_ENV)/bin/pycalver bump;
|
||||||
echo "To a PUBLIC release on pypi run:\n\t\$(DEV_ENV_PY) setup.py upload"
|
|
||||||
|
|
||||||
|
## Create python sdist and bdist_wheel files
|
||||||
|
.PHONY: build_dists
|
||||||
|
build_dists:
|
||||||
|
$(DEV_ENV_PY) setup.py sdist;
|
||||||
|
$(DEV_ENV_PY) setup.py bdist_wheel --python-tag=$(BDIST_WHEEL_PYTHON_TAG);
|
||||||
|
|
||||||
|
|
||||||
|
## Upload sdist and bdist files to pypi
|
||||||
|
.PHONY: upload_dists
|
||||||
|
upload_dists:
|
||||||
|
@if [[ "1" != "1" ]]; then \
|
||||||
|
echo "FAILSAFE! Not publishing a private package."; \
|
||||||
|
echo " To avoid this set IS_PUBLIC=1 in bootstrap.sh and run it."; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
$(DEV_ENV)/bin/twine check $$($(SDIST_FILE_CMD));
|
||||||
|
$(DEV_ENV)/bin/twine check $$($(BDIST_WHEEL_FILE_CMD));
|
||||||
|
$(DEV_ENV)/bin/twine upload $$($(SDIST_FILE_CMD)) $$($(BDIST_WHEEL_FILE_CMD));
|
||||||
|
|
||||||
|
|
||||||
|
## Publish on pypi
|
||||||
|
.PHONY: publish
|
||||||
|
publish: bump_version build_dists upload_dists
|
||||||
|
|
||||||
|
|
||||||
## Build docker images. Must be run when dependencies are added
|
## Build docker images. Must be run when dependencies are added
|
||||||
|
|
@ -430,16 +510,18 @@ build_docker:
|
||||||
docker build \
|
docker build \
|
||||||
--build-arg SSH_PRIVATE_RSA_KEY="$$(cat '${RSA_KEY_PATH}')" \
|
--build-arg SSH_PRIVATE_RSA_KEY="$$(cat '${RSA_KEY_PATH}')" \
|
||||||
--file docker_base.Dockerfile \
|
--file docker_base.Dockerfile \
|
||||||
--tag $(DOCKER_REGISTRY_URL)/base:latest \
|
--tag $(DOCKER_BASE_IMAGE) \
|
||||||
.; \
|
.; \
|
||||||
else \
|
else \
|
||||||
docker build \
|
docker build \
|
||||||
--file docker_base.Dockerfile \
|
--file docker_base.Dockerfile \
|
||||||
--tag $(DOCKER_REGISTRY_URL)/base:latest \
|
--tag $(DOCKER_BASE_IMAGE) \
|
||||||
.; \
|
.; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker push $(DOCKER_REGISTRY_URL)/base:latest
|
docker push $(DOCKER_BASE_IMAGE)
|
||||||
|
|
||||||
|
|
||||||
|
## -- Extra/Custom/Project Specific Tasks --
|
||||||
|
|
||||||
-include makefile.extra.make
|
-include makefile.extra.make
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,9 @@ DOCKER_REGISTRY_URL := registry.gitlab.com/mbarkhau/pycalver
|
||||||
# - `make devtest`
|
# - `make devtest`
|
||||||
DEVELOPMENT_PYTHON_VERSION := python=3.6
|
DEVELOPMENT_PYTHON_VERSION := python=3.6
|
||||||
|
|
||||||
# These must be valid conda package names. A separate
|
# These must be valid (space separated) conda package names.
|
||||||
# conda environment will be created for each of these.
|
# A separate conda environment will be created for each of these.
|
||||||
|
#
|
||||||
# Some valid options are:
|
# Some valid options are:
|
||||||
# - python=2.7
|
# - python=2.7
|
||||||
# - python=3.5
|
# - python=3.5
|
||||||
|
|
|
||||||
|
|
@ -24,11 +24,15 @@ ujson
|
||||||
|
|
||||||
# The hot new pkdf on the block is argon2, winner of
|
# The hot new pkdf on the block is argon2, winner of
|
||||||
# the https://password-hashing.net/ competition.
|
# the https://password-hashing.net/ competition.
|
||||||
argon2_cffi
|
# argon2_cffi
|
||||||
|
|
||||||
# https://blake2.net/
|
# https://blake2.net/
|
||||||
# BLAKE2 is a cryptographic hash function faster than MD5, SHA-1,
|
# BLAKE2 is a cryptographic hash function faster than MD5, SHA-1,
|
||||||
# SHA-2, and SHA-3, yet is at least as secure as the latest standard
|
# SHA-2, and SHA-3, yet is at least as secure as the latest standard
|
||||||
# SHA-3. BLAKE2 has been adopted by many projects due to its high
|
# SHA-3. BLAKE2 has been adopted by many projects due to its high
|
||||||
# speed, security, and simplicity.
|
# speed, security, and simplicity.
|
||||||
pyblake2
|
# pyblake2
|
||||||
|
|
||||||
|
# pytest is required in every environment to run the test suite
|
||||||
|
# against the installed modules.
|
||||||
|
pytest
|
||||||
|
|
|
||||||
|
|
@ -34,4 +34,3 @@ snakeviz
|
||||||
# add one after you've tested it and found it to be actually useful.
|
# add one after you've tested it and found it to be actually useful.
|
||||||
|
|
||||||
ipython # nuff said
|
ipython # nuff said
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ pytest
|
||||||
pytest-cov
|
pytest-cov
|
||||||
pylint
|
pylint
|
||||||
|
|
||||||
|
readme_renderer[md]
|
||||||
twine
|
twine
|
||||||
|
|
||||||
md-toc
|
md-toc
|
||||||
|
|
|
||||||
13
setup.cfg
13
setup.cfg
|
|
@ -64,19 +64,20 @@ addopts = --doctest-modules
|
||||||
|
|
||||||
|
|
||||||
[pycalver]
|
[pycalver]
|
||||||
current_version = v201811.0007-beta
|
current_version = v201812.0007-beta
|
||||||
commit = True
|
commit = True
|
||||||
tag = True
|
tag = True
|
||||||
push = True
|
push = True
|
||||||
|
|
||||||
|
|
||||||
[pycalver:file_patterns]
|
[pycalver:file_patterns]
|
||||||
"setup.cfg" =
|
bootstrapit.sh =
|
||||||
|
PACKAGE_VERSION="{version}"
|
||||||
|
setup.cfg =
|
||||||
current_version = {version}
|
current_version = {version}
|
||||||
"setup.py" =
|
setup.py =
|
||||||
version="{pep440_version}"
|
version="{pep440_version}"
|
||||||
"src/pycalver/__init__.py" =
|
src/pycalver/__init__.py =
|
||||||
__version__ = "{version}"
|
__version__ = "{version}"
|
||||||
"README.md" =
|
README.md =
|
||||||
[PyCalVer {calver}{build}-{release}]
|
[PyCalVer {calver}{build}-{release}]
|
||||||
img.shields.io/badge/PyCalVer-{calver}{build}--{release}-blue
|
img.shields.io/badge/PyCalVer-{calver}{build}--{release}-blue
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue