def build_response(self, code: int, json_message: Optional[Union[dict, list]]) -> MITMResponse:
        try:
            body = json_dumps(json_message, indent=2)
        except JSONDecodeError:
            body = ''

        return MITMResponse(
            status_code=code,
            body=body,
            headers=MITMHeaders({
                'Content-Type': ['application/json; encoding=UTF-8'],
                'Server': [
                    'inspire-mitmproxy/' + get_current_version(project_name='inspire_mitmproxy')
                ]
            }),
        )
Beispiel #2
0
# The encoding of source files.
#source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'Workflow'
copyright = u'2014, Roman Chyla'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
version = get_current_version(
    project_name='workflow'
)

# The full version, including alpha/beta/rc tags.
release = version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
Beispiel #3
0
# General information about the project.
project = u'HEPCrawl'
copyright = u'2016, CERN'
author = u'CERN'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.

# Get the version string. Cannot be done with import!

version = get_current_version(
    project_name='hepcrawl',
    project_dir=os.path.join(os.path.dirname(__file__), '..')
)

# The full version, including alpha/beta/rc tags.
release = version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#
Beispiel #4
0
# -*- coding: utf-8 -*-
#
# This file is part of refextract.
# Copyright (C) 2015, 2016, 2017, 2018, 2020 CERN.
#
# refextract is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# refextract is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with refextract; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#
# In applying this license, CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.

"""The version of refextract."""

from autosemver.packaging import get_current_version


__version__ = get_current_version(project_name='refextract')
Beispiel #5
0
# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'autosemver'
copyright = u'2016, David Caro'
author = u'David Caro'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.

# Get the version string. Cannot be done with import!
version = get_current_version(project_dir='..')

# The full version, including alpha/beta/rc tags.
release = version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
Beispiel #6
0
# -*- coding: utf-8 -*-
#
# This file is part of hepcrawl.
# Copyright (C) 2015, 2016, 2017 CERN.
#
# hepcrawl is a free software; you can redistribute it and/or modify it
# under the terms of the Revised BSD License; see LICENSE file for
# more details.

"""Version information for hepcrawl.

This file is imported by ``hepcrawl.__init__``,
and parsed by ``setup.py``.
"""

from __future__ import absolute_import, division, print_function

from autosemver.packaging import get_current_version

__version__ = get_current_version(
    project_name='hepcrawl',
)
Beispiel #7
0
# General information about the project.
project = u'HEPCrawl'
copyright = u'2016, CERN'
author = u'CERN'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.

# Get the version string. Cannot be done with import!

version = get_current_version(project_name='hepcrawl',
                              project_dir=os.path.join(
                                  os.path.dirname(__file__), '..'))

# The full version, including alpha/beta/rc tags.
release = version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#
Beispiel #8
0
# -*- coding: utf-8 -*-
#
# This file is part of hepcrawl.
# Copyright (C) 2015, 2016 CERN.
#
# hepcrawl is a free software; you can redistribute it and/or modify it
# under the terms of the Revised BSD License; see LICENSE file for
# more details.
"""Version information for hepcrawl.

This file is imported by ``hepcrawl.__init__``,
and parsed by ``setup.py``.
"""

from __future__ import absolute_import, print_function

from autosemver.packaging import get_current_version

__version__ = get_current_version(project_name='hepcrawl', )
# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'invenio-workflows-ui'
copyright = u'2016, CERN'
author = u'CERN'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.

version = get_current_version(project_dir='..')

# The full version, including alpha/beta/rc tags.
release = version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
Beispiel #10
0
import os
import sys

from autosemver.packaging import get_changelog, get_current_version

module_path = os.path.abspath('../inspire_mitmproxy')
sys.path.insert(0, module_path)

# -- Project information -----------------------------------------------------

project = 'inspire-mitmproxy'
copyright = '2018, CERN'
author = 'CERN'

# The short X.Y version
version = get_current_version('inspire-mitmproxy')
# The full version, including alpha/beta/rc tags
release = ''

# -- General configuration ---------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# 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',
]
Beispiel #11
0
source_suffix = '.rst'

# The encoding of source files.
#source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'Workflow'
copyright = u'2014, Roman Chyla'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
version = get_current_version(project_name='workflow')

# The full version, including alpha/beta/rc tags.
release = version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'

# List of patterns, relative to source directory, that match files and
Beispiel #12
0
"""Automatic semantic versioning from git history for python packages"""

import os

from setuptools import setup

IN_A_PACKAGE = False
PKG_INFO = os.path.join(os.path.dirname('__file__'), 'PKG-INFO')
if not os.path.exists(PKG_INFO):
    from autosemver import PROJECT_NAME
    from autosemver.packaging import (
        get_authors,
        get_changelog,
        get_current_version,
    )
    __version__ = get_current_version(project_name=PROJECT_NAME)
else:
    IN_A_PACKAGE = True
    with open(PKG_INFO) as info_fd:
        for line in info_fd.readlines():
            if line.startswith('Version: '):
                __version__ = line.split(' ', 1)[-1]
                break
        else:
            raise ImportError('Unable to find version for autosemver')

if __name__ == '__main__':
    URL = 'https://github.com/david-caro/python-autosemver'
    if not IN_A_PACKAGE:
        with open('AUTHORS', 'w') as authors_fd:
            authors_fd.write('\n'.join(get_authors()))
Beispiel #13
0
# The master toctree document.
master_doc = "index"

# General information about the project.
project = "autosemver"
copyright = "2016, David Caro"
author = "David Caro"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.

# Get the version string. Cannot be done with import!
version = get_current_version(project_dir="..")

# The full version, including alpha/beta/rc tags.
release = version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
# today = ''
# Else, today_fmt is used as the format for a strftime call.