Exemple #1
0
    def test_package_version_fallback(self):
        self.get_distribution_mock.side_effect = \
            pkg_resources.DistributionNotFound()
        self.git_describe_mock.return_value = '1.0.0'

        self.assertEqual(version.get_package_version('test'), '1.0.0')
        self.git_describe_mock.assert_called_once()
Exemple #2
0
 def get(self, request, format=None):
     # list supported API versions
     current = reverse('api:api_v1_root_view', args=[])
     data = dict(
         description='GALAXY REST API',
         current_version='v1',
         available_versions=dict(v1=current),
         server_version=version.get_package_version('galaxy'),
         version_name=version.get_version_name(),
         team_members=version.get_team_members(),
     )
     return Response(data)
Exemple #3
0
 def get(self, request, format=None):
     # list supported API versions
     data = dict(
         description='GALAXY REST API',
         current_version='v1',
         available_versions=dict(
             v1="v1/",
             v2="v2/",
         ),
         server_version=version.get_package_version('galaxy'),
         version_name=version.get_version_name(),
         team_members=version.get_team_members(),
     )
     return Response(data)
Exemple #4
0
# (at your option) any later version.
#
# Ansible Galaxy 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
# Apache License for more details.
#
# You should have received a copy of the Apache License
# along with Galaxy.  If not, see <http://www.apache.org/licenses/>.

import os
import sys
import mimetypes

from galaxy.common import version

__all__ = ['__version__']
__version__ = version.get_package_version(__name__)


def manage():
    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'galaxy.settings.default')

    # Fix for serving by dev server SVG images with correct content type
    mimetypes.add_type("image/svg+xml", ".svg", True)
    mimetypes.add_type("image/svg+xml", ".svgz", True)

    from django.core.management import execute_from_command_line
    from dynaconf.contrib import django_dynaconf  # noqa
    execute_from_command_line(sys.argv)
Exemple #5
0
 def test_package_version(self):
     dist = self.get_distribution_mock.return_value
     dist.version = '1.0.0'
     self.assertEqual(version.get_package_version('test'), '1.0.0')