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

Modernise versioning

parent 70d5ff61
No related branches found
No related tags found
1 merge request!16Modernise versioning
This commit is part of merge request !16. Comments created here will be created in the context of that merge request.
......@@ -6,8 +6,8 @@ __pycache__/
# C extensions
*.so
# Version info for PyPI
km3io/version.txt
# Version info
km3io/version.py
# Distribution / packaging
.Python
......
include README.rst
include LICENSE
include requirements.txt
include km3io/version.txt
......@@ -18,13 +18,11 @@ import os
from datetime import date
import sphinx_rtd_theme
from pkg_resources import get_distribution
import km3io
# -- Project information -----------------------------------------------------
release = get_distribution('km3io').version
version = '.'.join(release.split('.')[:2])
project = 'km3io {}'.format(km3io.__version__)
version = get_distribution('km3io').version
project = 'km3io {}'.format(version)
copyright = '{0}, Zineb Aly and Tamas Gal'.format(date.today().year)
author = 'Zineb Aly, Tamas Gal, Johannes Schumann'
......@@ -74,4 +72,4 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# 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 = "km3io {}".format(km3io.__version__)
html_title = "km3io {}".format(version)
from .__version__ import version
__version__ = version
from pkg_resources import get_distribution, DistributionNotFound
try:
version = get_distribution(__name__).version
except DistributionNotFound:
version = "unknown version"
from .offline import OfflineReader
from .daq import DAQReader
#!/usr/bin/env python
# Filename: __version__.py
# pylint: disable=C0103
"""
Pep 386 compliant version info.
(major, minor, micro, alpha/beta/rc/final, #)
(1, 1, 2, 'alpha', 0) => "1.1.2.dev"
(1, 2, 0, 'beta', 2) => "1.2b2"
"""
from __future__ import absolute_import, print_function, division
from os.path import dirname, realpath, join
from setuptools_scm import get_version
version = 'unknown version'
try:
version = get_version(root='..', relative_to=__file__)
except LookupError:
with open(join(realpath(dirname(__file__)), "version.txt"), 'r') as fobj:
version = fobj.read()
pyproject.toml 0 → 100644
[build-system]
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]
[tool.setuptools_scm]
write_to = "km3io/version.py"
......@@ -26,10 +26,7 @@ setup(
include_package_data=True,
platforms='any',
setup_requires=['setuptools_scm'],
use_scm_version={
'write_to': 'km3io/version.txt',
'tag_regex': r'^(?P<prefix>v)?(?P<version>[^\+]+)(?P<suffix>.*)?$',
},
use_scm_version=True,
install_requires=requirements,
python_requires='>=3.5',
entry_points={
......
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