Commit 1412f618 authored by Tomás Álvarez's avatar Tomás Álvarez 🏳️‍🌈
Browse files

[REF] gitlab_tools: refactored as a deployv addon

parent d08b9415
[bumpversion]
current_version = 0.1.0
commit = True
tag = True
[bumpversion:file:setup.py]
[bumpversion:file:README.rst]
[bumpversion:file:docs/conf.py]
[bumpversion:file:src/deployv_addon_gitlab_tools/__init__.py]
# This file exists so you can easily regenerate your project.
#
# `cookiepatcher` is a convenient shim around `cookiecutter`
# for regenerating projects (it will generate a .cookiecutterrc
# automatically for any template). To use it:
#
# pip install cookiepatcher
# cookiepatcher gh:ionelmc/cookiecutter-pylibrary project-path
#
# See:
# https://pypi.python.org/pypi/cookiecutter
#
# Alternatively, you can run:
#
# cookiecutter --overwrite-if-exists --config-file=project-path/.cookiecutterrc gh:ionelmc/cookiecutter-pylibrary
default_context:
appveyor: 'no'
c_extension_cython: 'no'
c_extension_optional: 'no'
c_extension_support: 'no'
codacy: 'no'
codeclimate: 'no'
codecov: 'no'
command_line_interface: 'click'
command_line_interface_bin_name: 'deployv-addon-gitlab-tools'
coveralls: 'no'
distribution_name: 'deployv-addon-gitlab-tools'
email: 'info@vauxoo.com'
full_name: 'Vauxoo'
github_username: 'Vauxoo'
landscape: 'no'
package_name: 'deployv_addon_gitlab_tools'
project_name: 'Deployv addon: Gitlab tools'
project_short_description: 'Deployv addon: Gitlab tools. Generated by cookiecutter and cookiecutter-deploy-addon.'
project_type: 'Deployv addon'
project_unique_name: 'Gitlab tools'
release_date: 'today'
repo_name: 'deployv-addon-gitlab-tools'
requiresio: 'no'
scrutinizer: 'no'
sphinx_doctest: 'no'
sphinx_theme: 'sphinx-rtd-theme'
test_matrix_configurator: 'no'
test_matrix_separate_coverage: 'no'
test_runner: 'pytest'
travis: 'no'
version: '0.1.0'
website: 'https://www.vauxoo.com'
year: 'now'
[paths]
source =
src/deployv_addon_gitlab_tools
*/site-packages/deployv_addon_gitlab_tools
[run]
branch = true
source =
deployv_addon_gitlab_tools
tests
parallel = true
[report]
show_missing = true
precision = 2
omit = *migrations*
# see http://editorconfig.org
root = true
[*]
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
charset = utf-8
[*.{bat,cmd,ps1}]
end_of_line = crlf
......@@ -8,19 +8,23 @@ __pycache__/
# Distribution / packaging
.Python
env/
bin/
build/
develop-eggs/
dist/
eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
*.egg-info
dist
build
eggs
.eggs
parts
bin
var
sdist
wheelhouse
develop-eggs
.installed.cfg
lib
lib64
venv*/
pyvenv*/
# Installer logs
pip-log.txt
......@@ -33,7 +37,17 @@ htmlcov/
.cache
nosetests.xml
coverage.xml
.eggs
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
.coverage.*
nosetests.xml
coverage.xml
htmlcov
# Translations
*.mo
......@@ -57,5 +71,26 @@ html
# Vi swap file
*.swp
# Pycharm project files
# Project files
.idea
*.iml
*.komodoproject
# Complexity
output/*.html
output/*/index.html
# Sphinx
docs/_build
.DS_Store
*~
.*.sw[po]
.build
.ve
.env
.cache
.pytest
.bootstrap
.appveyor.token
*.bak
Authors
=======
* Vauxoo - https://www.vauxoo.com
Changelog
=========
0.1.0 (2017-03-03)
-----------------------------------------
* First release on PyPI.
============
Contributing
============
Contributions are welcome, and they are greatly appreciated! Every
little bit helps, and credit will always be given.
Bug reports
===========
When `reporting a bug <https://github.com/Vauxoo/deployv-addon-gitlab-tools/issues>`_ please include:
* Your operating system name and version.
* Any details about your local setup that might be helpful in troubleshooting.
* Detailed steps to reproduce the bug.
Documentation improvements
==========================
Deployv addon: Gitlab tools could always use more documentation, whether as part of the
official Deployv addon: Gitlab tools docs, in docstrings, or even on the web in blog posts,
articles, and such.
Feature requests and feedback
=============================
The best way to send feedback is to file an issue at https://github.com/Vauxoo/deployv-addon-gitlab-tools/issues.
If you are proposing a feature:
* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that this is a volunteer-driven project, and that code contributions are welcome :)
Development
===========
To set up `deployv-addon-gitlab-tools` for local development:
1. Fork `deployv-addon-gitlab-tools <https://github.com/Vauxoo/deployv-addon-gitlab-tools>`_
(look for the "Fork" button).
2. Clone your fork locally::
git clone git@github.com:your_name_here/deployv-addon-gitlab-tools.git
3. Create a branch for local development::
git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally.
4. When you're done making changes, run all the checks, doc builder and spell checker with `tox <http://tox.readthedocs.io/en/latest/install.html>`_ one command::
tox
5. Commit your changes and push your branch to GitHub::
git add .
git commit -m "Your detailed description of your changes."
git push origin name-of-your-bugfix-or-feature
6. Submit a pull request through the GitHub website.
Pull Request Guidelines
-----------------------
If you need some code review or feedback while you're developing the code just make the pull request.
For merging, you should:
1. Include passing tests (run ``tox``) [1]_.
2. Update documentation when there's new API, functionality etc.
3. Add a note to ``CHANGELOG.rst`` about the changes.
4. Add yourself to ``AUTHORS.rst``.
.. [1] If you don't have all the necessary python versions available locally you can rely on Travis - it will
`run the tests <https://travis-ci.org/Vauxoo/deployv-addon-gitlab-tools/pull_requests>`_ for each change you add in the pull request.
It will be slower though ...
Tips
----
To run a subset of tests::
tox -e envname -- py.test -k test_myfeature
To run all the test environments in *parallel* (you need to ``pip install detox``)::
detox
Copyright (c) 2017, Vauxoo
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
graft docs
graft examples
graft src
graft ci
graft tests
include .bumpversion.cfg
include .coveragerc
include .cookiecutterrc
include .editorconfig
include .isort.cfg
include AUTHORS.rst
include CHANGELOG.rst
include CONTRIBUTING.rst
include LICENSE
include README.rst
include tox.ini .travis.yml appveyor.yml
global-exclude *.py[cod] __pycache__ *.so *.dylib
# Gitlab Tools
A small set of tools to automate the repetitive tasks that we need to do for testing the repos.
It is important to say that this is not by any mean a replacement for the MQT tools, is just the tools that we need in gitlab-ci to make ir work properly with the MQT tools
========
Overview
========
.. start-badges
.. list-table::
:stub-columns: 1
* - docs
- |docs|
* - tests
- |
|
* - package
- | |version| |downloads| |wheel| |supported-versions| |supported-implementations|
| |commits-since|
.. |docs| image:: https://readthedocs.org/projects/deployv-addon-gitlab-tools/badge/?style=flat
:target: https://readthedocs.org/projects/deployv-addon-gitlab-tools
:alt: Documentation Status
.. |version| image:: https://img.shields.io/pypi/v/deployv-addon-gitlab-tools.svg
:alt: PyPI Package latest release
:target: https://pypi.python.org/pypi/deployv-addon-gitlab-tools
.. |commits-since| image:: https://img.shields.io/github/commits-since/Vauxoo/deployv-addon-gitlab-tools/v0.1.0.svg
:alt: Commits since latest release
:target: https://github.com/Vauxoo/deployv-addon-gitlab-tools/compare/v0.1.0...master
.. |downloads| image:: https://img.shields.io/pypi/dm/deployv-addon-gitlab-tools.svg
:alt: PyPI Package monthly downloads
:target: https://pypi.python.org/pypi/deployv-addon-gitlab-tools
.. |wheel| image:: https://img.shields.io/pypi/wheel/deployv-addon-gitlab-tools.svg
:alt: PyPI Wheel
:target: https://pypi.python.org/pypi/deployv-addon-gitlab-tools
.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/deployv-addon-gitlab-tools.svg
:alt: Supported versions
:target: https://pypi.python.org/pypi/deployv-addon-gitlab-tools
.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/deployv-addon-gitlab-tools.svg
:alt: Supported implementations
:target: https://pypi.python.org/pypi/deployv-addon-gitlab-tools
.. end-badges
Deployv addon: Gitlab tools. Generated by cookiecutter and cookiecutter-deploy-addon.
A small set of tools to automate repetitive tasks for testing gitlab repositories.
It is important to say that this is not by any mean a replacement for the MQT tools, these are tools that we need in order to make gitlab-ci work properly with the MQT tools.
* Free software: BSD license
Installation
============
::
pip install deployv-addon-gitlab-tools
Documentation
=============
https://deployv-addon-gitlab-tools.readthedocs.io/
Development
===========
To run the all tests run::
tox
Note, to combine the coverage data from all the tox environments run:
.. list-table::
:widths: 10 90
:stub-columns: 1
- - Windows
- ::
set PYTEST_ADDOPTS=--cov-append
tox
- - Other
- ::
PYTEST_ADDOPTS=--cov-append tox
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import os
import sys
from os.path import abspath
from os.path import dirname
from os.path import exists
from os.path import join
if __name__ == "__main__":
base_path = dirname(dirname(abspath(__file__)))
print("Project path: {0}".format(base_path))
env_path = join(base_path, ".tox", "bootstrap")
if sys.platform == "win32":
bin_path = join(env_path, "Scripts")
else:
bin_path = join(env_path, "bin")
if not exists(env_path):
import subprocess
print("Making bootstrap env in: {0} ...".format(env_path))
try:
subprocess.check_call(["virtualenv", env_path])
except subprocess.CalledProcessError:
subprocess.check_call([sys.executable, "-m", "virtualenv", env_path])
print("Installing `jinja2` into bootstrap environment...")
subprocess.check_call([join(bin_path, "pip"), "install", "jinja2"])
activate = join(bin_path, "activate_this.py")
# noinspection PyCompatibility
exec(compile(open(activate, "rb").read(), activate, "exec"), dict(__file__=activate))
import jinja2
import subprocess
jinja = jinja2.Environment(
loader=jinja2.FileSystemLoader(join(base_path, "ci", "templates")),
trim_blocks=True,
lstrip_blocks=True,
keep_trailing_newline=True
)
tox_environments = [
line.strip()
# WARNING: 'tox' must be installed globally or in the project's virtualenv
for line in subprocess.check_output(['tox', '--listenvs'], universal_newlines=True).splitlines()
]
tox_environments = [line for line in tox_environments if line not in ['clean', 'report', 'docs', 'check']]
for name in os.listdir(join("ci", "templates")):
with open(join(base_path, name), "w") as fh:
fh.write(jinja.get_template(name).render(tox_environments=tox_environments))
print("Wrote {}".format(name))
print("DONE.")
.. include:: ../AUTHORS.rst
.. include:: ../CHANGELOG.rst
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.coverage',
'sphinx.ext.doctest',
'sphinx.ext.extlinks',
'sphinx.ext.ifconfig',
'sphinx.ext.napoleon',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
]
if os.getenv('SPELLCHECK'):
extensions += 'sphinxcontrib.spelling',
spelling_show_suggestions = True
spelling_lang = 'en_US'
source_suffix = '.rst'
master_doc = 'index'
project = u'Deployv addon: Gitlab tools'
year = '2017'
author = u'Vauxoo'
copyright = '{0}, {1}'.format(year, author)
version = release = u'0.1.0'
pygments_style = 'trac'
templates_path = ['.']
extlinks = {
'issue': ('https://github.com/Vauxoo/deployv-addon-gitlab-tools/issues/%s', '#'),
'pr': ('https://github.com/Vauxoo/deployv-addon-gitlab-tools/pull/%s', 'PR #'),
}
# on_rtd is whether we are on readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if not on_rtd: # only set the theme if we're building docs locally
html_theme = 'sphinx_rtd_theme'
html_use_smartypants = True
html_last_updated_fmt = '%b %d, %Y'
html_split_index = False
html_sidebars = {
'**': ['searchbox.html', 'globaltoc.html', 'sourcelink.html'],
}
html_short_title = '%s-%s' % (project, version)
napoleon_use_ivar = True
napoleon_use_rtype = False
napoleon_use_param = False
.. include:: ../CONTRIBUTING.rst
========
Contents
========
.. toctree::
:maxdepth: 2
readme
installation
usage
reference/index
contributing
authors
changelog
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
============
Installation
============
At the command line::
pip install deployv-addon-gitlab-tools
.. include:: ../README.rst
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment