Skip to content
Snippets Groups Projects
Commit 8422a7b6 authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
Pipeline #12955 failed
[run]
source = km3io
[report]
include =
km3io/*
omit =
tests/*
km3io/definitions/*
km3io/version.py
exclude_lines =
pragma: no cover
raise AssertionError
raise NotImplementedError
if 0:
if __name__ == .__main__.:
if self.debug:
if settings.DEBUG
def __repr__
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*.pyxbldc
# Version info
km3net_testdata/version.py
# Build stuff
build/
develop-eggs/
dist/
eggs/
sdist/
*.egg-info/
*.egg
.eggs
pip-wheel-metadata
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml
.coverage.*
junit*.xml
reports
# Sphinx documentation
doc/_build/
doc/auto_examples/
doc/modules/
doc/api
# Virtual env
venv
image: docker.km3net.de/base/python:3
# 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"
cache:
paths:
- .cache/pip
- venv/
key: "$CI_COMMIT_REF_SLUG"
stages:
- test
- coverage
- doc
- release
.virtualenv_template: &virtualenv_definition |
python -V
pip install virtualenv
virtualenv venv
source venv/bin/activate
pip install -r requirements-dev.txt
make install
.junit_template: &junit_definition
artifacts:
reports:
junit: "reports/junit*.xml"
test-py3.5:
image: docker.km3net.de/base/python:3.5
stage: test
script:
- *virtualenv_definition
- make test
<<: *junit_definition
allow_failure: true
test-py3.6:
image: docker.km3net.de/base/python:3.6
stage: test
script:
- *virtualenv_definition
- make test
<<: *junit_definition
test-py3.7:
image: docker.km3net.de/base/python:3.7
stage: test
script:
- *virtualenv_definition
- make test
<<: *junit_definition
test-py3.8:
image: docker.km3net.de/base/python:3.8
stage: test
script:
- *virtualenv_definition
- make test
<<: *junit_definition
code-style:
image: docker.km3net.de/base/python:3.7
stage: test
script:
- *virtualenv_definition
- yapf -r -d -e "venv" .
allow_failure: true
coverage:
image: docker.km3net.de/base/python:3.6
stage: coverage
script:
- *virtualenv_definition
- make install-dev
- "make test-cov|grep TOTAL| awk '{printf \"COVERAGE: %.2f%%\", (1-$3/$2)*100 }'"
coverage: '/COVERAGE:\s*([0-9]*\.[0-9]*%)/'
# - make test-cov
# coverage: '/TOTAL.+ ([0-9]{1,3}%)/'
artifacts:
paths:
- reports/coverage
build-docs:
image: docker.km3net.de/base/python:3.6
stage: doc
script:
- *virtualenv_definition
- cd doc && make clean && make html
cache: {}
pages:
image: docker.km3net.de/base/python:3.6
stage: doc
script:
- *virtualenv_definition
- cd doc && make clean && make html
- mv _build/html ../public/
- cd .. && mv reports/coverage public/coverage
artifacts:
paths:
- public
cache: {}
only:
- tags
- master
pypi:
image: docker.km3net.de/base/python:3
stage: release
cache: {}
script:
- pip install -U twine wheel
- python setup.py sdist
- python setup.py bdist_wheel
- twine upload dist/*
only:
- tags
Unreleased changes
------------------
* Remove template artifacts
Version 0
---------
0.1.0 / 2020-07-17
~~~~~~~~~~~~~~~~~~
* Project generated using the cookiecutter template from
https://git.km3net.de/templates/python-project
LICENSE 0 → 100644
The MIT License (MIT)
Copyright (c) 2014 Tamas Gal
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
include README.rst
include LICENSE
include requirements.txt
Makefile 0 → 100644
PKGNAME=km3net_testdata
default: build
all: install
install:
pip install .
install-dev: dependencies-dev
pip install -e .
venv:
python3 -m venv venv
clean:
python3 setup.py clean --all
rm -rf venv
test:
py.test --junitxml=./reports/junit.xml -o junit_suite_name=$(PKGNAME) tests
test-cov:
py.test --cov ./$(PKGNAME) --cov-report term-missing --cov-report xml:reports/coverage.xml --cov-report html:reports/coverage tests
test-loop:
py.test tests
ptw --ext=.py,.pyx --ignore=doc tests
dependencies:
pip install -Ur requirements.txt
dependencies-dev:
pip install -Ur requirements-dev.txt
yapf:
yapf -i -r $(PKGNAME)
yapf -i -r tests
yapf -i setup.py
.PHONY: all clean install install-dev venv test test-cov test-loop dependencies dependencies-dev yapf
KM3NeT TestData
===============
.. image:: https://git.km3net.de/km3py/km3net_testdata.git/badges/master/pipeline.svg
:target: https://git.km3net.de/km3py/km3net_testdata.git/pipelines
.. image:: https://git.km3net.de/km3py/km3net_testdata.git/badges/master/coverage.svg
:target: https://km3py.pages.km3net.de/km3net_testdata/coverage
.. image:: https://examples.pages.km3net.de/km3badges/docs-latest-brightgreen.svg
:target: https://km3py.pages.km3net.de/km3net_testdata
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.rst-content .highlight>pre {
line-height: 18px;
}
doc/_static/default_gallery_thumbnail.png

23.7 KiB

Changelog
=========
.. include:: ../CHANGELOG.rst
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import sys
import os
from datetime import date
import sphinx_rtd_theme
from pkg_resources import get_distribution
# -- Project information -----------------------------------------------------
version = get_distribution('km3net_testdata').version
short_version = '.'.join(version.split('.')[:2])
project = 'km3net_testdata {}'.format(short_version)
copyright = '{0}, Tamas Gal'.format(date.today().year)
author = 'Tamas Gal'
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.viewcode',
'autoapi.extension', 'numpydoc',
'sphinx_gallery.gen_gallery'
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'version.py']
# AutoAPI
autoapi_type = 'python'
autoapi_dirs = ['../km3net_testdata']
autoapi_ignore = ['*version.py*']
autoapi_add_toctree_entry = True
# Gallery
sphinx_gallery_conf = {
'backreferences_dir': 'modules/generated',
'default_thumb_file': '_static/default_gallery_thumbnail.png',
'examples_dirs': '../examples', # path to your example scripts
'gallery_dirs':
'auto_examples', # path to where to save gallery generated output
'show_memory': True,
}
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_title = "km3net_testdata {}".format(version)
========
Examples
========
.. include:: auto_examples/index.rst
.. include:: ../README.rst
.. toctree::
:maxdepth: 2
:caption: Contents:
examples
changelog
autoapi/index
Code Coverage <http://km3py.pages.km3net.de/km3net_testdata/coverage>
Source (Git) <https://git.km3net.de/km3py/km3net_testdata.git>
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd
Collection of Examples
======================
All of these examples are auto-generated each time the documentation is built.
"""
How to use the Calculator
=========================
The following example shows how to use the `Calculator` class.
"""
from km3net_testdata import Calculator
#####################################################
# Initialising a Calculator
# -------------------------
# Initialising is a simple as this:
calc = Calculator()
#####################################################
# Adding numbers
# ~~~~~~~~~~~~~~
#
# You can add two numbers by calling the `.add(a, b)` method:
print(calc.add(5, 23))
import os
from pkg_resources import get_distribution, DistributionNotFound
version = get_distribution(__name__).version
def testdata(*path_elements):
return os.path.join(*path_elements)
[build-system]
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]
[tool.setuptools_scm]
write_to = "km3net_testdata/version.py"
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