Skip to content

Commit 460a307

Browse files
committed
setup: autogenerated version.py
1 parent 50211c0 commit 460a307

File tree

6 files changed

+39
-61
lines changed

6 files changed

+39
-61
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Automatically generated by setuptools_scm
2+
renku/version.py
3+
14
# Byte-compiled / optimized / DLL files
25
__pycache__/
36
.pytest_cache/

renku/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,9 @@
2020
from __future__ import absolute_import, print_function
2121

2222
from .api import LocalClient
23+
from .version import __version__
2324

24-
__all__ = ('LocalClient', )
25+
__all__ = (
26+
'LocalClient',
27+
'__version__',
28+
)

renku/__version__.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

renku/version.py

Lines changed: 0 additions & 26 deletions
This file was deleted.

run-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ set -o nounset
2525

2626
pydocstyle renku tests docs
2727
isort -rc -c -df
28-
check-manifest --ignore ".travis-*"
28+
check-manifest --ignore ".travis-*,renku/version.py"
2929
find . -iname \*.sh -print0 | xargs -0 shellcheck
3030
sphinx-build -qnNW docs docs/_build/html
3131
python setup.py test

setup.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
# limitations under the License.
1818
"""Python SDK and CLI for the Renku platform."""
1919

20+
import os
21+
2022
from setuptools import find_packages, setup
2123

2224
readme = open('README.rst').read()
@@ -81,9 +83,36 @@
8183

8284
packages = find_packages()
8385

86+
version_template = """\
87+
# -*- coding: utf-8 -*-
88+
#
89+
# Copyright 2017-2018 - Swiss Data Science Center (SDSC)
90+
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
91+
# Eidgenössische Technische Hochschule Zürich (ETHZ).
92+
#
93+
# Licensed under the Apache License, Version 2.0 (the "License");
94+
# you may not use this file except in compliance with the License.
95+
# You may obtain a copy of the License at
96+
#
97+
# http://www.apache.org/licenses/LICENSE-2.0
98+
#
99+
# Unless required by applicable law or agreed to in writing, software
100+
# distributed under the License is distributed on an "AS IS" BASIS,
101+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
102+
# See the License for the specific language governing permissions and
103+
# limitations under the License.
104+
\"\"\"Version information for Renku.\"\"\"
105+
106+
__version__ = {version!r}
107+
"""
108+
84109
setup(
85110
name='renku',
86-
use_scm_version=True,
111+
use_scm_version={
112+
'local_scheme': 'dirty-tag',
113+
'write_to': os.path.join('renku', 'version.py'),
114+
'write_to_template': version_template,
115+
},
87116
description=__doc__,
88117
long_description=readme + '\n\n' + history,
89118
long_description_content_type='text/x-rst',

0 commit comments

Comments
 (0)