Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions cms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@
]


__version__ = "1.6.dev0"


# Instantiate or import these objects.


Expand Down Expand Up @@ -79,3 +76,7 @@
get_service_address, get_service_shards, contest_id_from_args, \
default_argument_parser
from .plugin import plugin_list

# Define version here for backwards compatibility, just in case anything reads it.
import importlib.metadata
__version__ = importlib.metadata.version("cms")
11 changes: 8 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import sys
import os
import tomllib

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -54,8 +55,9 @@
#
# See: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-version
#
version = "1.5"
release = "1.5.1"
with open("../pyproject.toml", 'rb') as f:
version = tomllib.load(f)['project']['version']
release = version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -101,7 +103,10 @@
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
html_theme_options = {
'fixed_sidebar': True,
'description': "Version " + version,
}

# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[project]
dynamic = ["version", "entry-points", "scripts"]
dynamic = ["entry-points", "scripts"]
name = "cms"
version = "1.6.dev0"
license = "AGPL-3.0-or-later"
maintainers = [ { name = "The CMS development team", email = "contestms@googlegroups.com" } ]
readme = "README.md"
Expand Down
16 changes: 0 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@

"""

import os
import re

from setuptools import setup, find_packages
from setuptools.command.build import build

Expand Down Expand Up @@ -92,18 +89,6 @@
],
}


def find_version():
"""Return the version string obtained from cms/__init__.py"""
path = os.path.join("cms", "__init__.py")
with open(path, "rt", encoding="utf-8") as f:
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
f.read(), re.M)
if version_match is not None:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")


# We piggyback the translation catalogs compilation onto build since
# the po and mofiles will be part of the package data for cms.locale,
# which is collected at this stage.
Expand All @@ -113,7 +98,6 @@ class build_with_l10n(build):

setup(
name="cms",
version=find_version(),
packages=find_packages(),
package_data=PACKAGE_DATA,
cmdclass={"build": build_with_l10n},
Expand Down
Loading