Skip to content
Snippets Groups Projects
Commit d8035e59 authored by dboe's avatar dboe
Browse files

prep for cookieinvsion

parent cef44be7
No related branches found
No related tags found
No related merge requests found
# This file is a template, and might need editing before it works on your project.
# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/python/tags/
image: python:latest
# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
# Pip's cache doesn't store the python packages
# https://pip.pypa.io/en/stable/reference/pip_install/#caching
#
# If you want to also cache the installed packages, you have to install
# them in a virtualenv and cache it as well.
cache:
paths:
- .cache/pip
- venv/
before_script:
- python -V # Print out python version for debugging
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
# hack because of bug in setuptools (Optimal would be 'pip install .' but install_requires in setup.cfg not read. See https://github.com/pypa/setuptools/issues/456)
- python -c "import configparser; config = configparser.ConfigParser(); config.read('setup.cfg'); deps = config['metadata']['install_requires'].split('\n'); import subprocess; subprocess.call(['pip', 'install'] + [x for x in deps if x])"
test:
script:
- python setup.py test
- pip install tox flake8 # you can also use tox
- tox -e py36,flake8
run:
script:
- python setup.py bdist_wheel
# an alternative approach is to install and run:
- pip install dist/*
# run the command here
artifacts:
paths:
- dist/*.whl
pages:
script:
- pip install sphinx sphinx-rtd-theme
- cd docs ; make html
- mv build/html/ ../public/
artifacts:
paths:
- public
only:
- master
CURRENT_PATH := $(shell pwd)
MODULE := $(shell basename "$(CURRENT_PATH)")
VERSION := $(shell python -c "import sys; import $(MODULE); sys.stdout.write($(MODULE).__version__)")
SOURCES := $(shell find $(MODULE) -name '*.py')
DOCUMENTATION := $(shell find $(MODULE) -name '*.rst')
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SPHINXSOURCEDIR = ./docs
SPHINXBUILDDIR = docs/_build
test: FORCE
flake8 tfields tests
py.test --doctest-modules --ignore=make --ignore=docs
coverage:
# coverage run $(MODULE) test
py.test --doctest-modules --ignore=make --ignore=docs --cov=$(MODULE) || true
# coverage report
coverage html
python -m webbrowser htmlcov/index.html
clean:
coverage erase
rm -rf htmlcov
rm -rf docs/_build
rm -rf docs/source
build:
@while [ -z "$$CONTINUE" ]; do \
read -r -p "Have you changed the __version__ attribute in tfields/__init__.py??? If yes, type Y or y to continue. Type anything else to exit. [y/N]: " CONTINUE; \
done ; \
[ $$CONTINUE = "y" ] || [ $$CONTINUE = "Y" ] || (echo "Exiting."; exit 1;)
@echo "... publishing ..."
@echo "New Version: $(VERSION)"
git tag -a v$(VERSION) -m "Version $(VERSION) tag" # tag version
git push origin v$(VERSION) # explicitly push tag to the shared server
rm -f dist/* # could become unnecessary, if you find a way to specify 'twine upload dist/transcoding-$(VERSION).tag.gz' in last step
python setup.py sdist # building package
publish_test: build
twine upload --repository-url https://test.pypi.org/legacy/ dist/* # publish to test.pypi.org
publish: build
twine upload dist/* # publish package
untag:
# remove last tag. mostly, because publishing failed
git tag -d v$(VERSION)
git push origin :refs/tags/v$(VERSION)
docs: Makefile $(SOURCES) $(DOCUMENTATION)
# link apidoc to source
sphinx-apidoc -o docs/source/ $(MODULE)
# build html documentation with sphinx
# @$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(0)
sphinx-build -M html docs docs/_build
# open the html slides
python -m webbrowser docs/_build/html/index.html
FORCE: ;
{
"_template": "https://gitlab.com/dboe/dough.git",
"author": "Daniel B\u00f6ckenhoff",
"continuous_integration": "y",
"copyright_holder": "Daniel B\u00f6ckenhoff",
"copyright_license": "MIT License",
"data_science": "n",
"distribution_name": "tfields",
"email": "dboe@ipp.mpg.de",
"keywords": "tensors, tensor-fields, graphs, mesh, numpy, math",
"package_name": "tfields",
"pypi_username": "dboe",
"remote_namespace": "dboe",
"remote_provider": "gitlab.mpcdf.mpg.de",
"remote_username": "dboe",
"summary": "Tensors, tensor fields, graphs, mesh manipulation, CAD and more on the basis of numpy.ndarrays. All objects keep track of their coordinate system. Symbolic math operations work for object manipulation."
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment