File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4646]
4747
4848
49- __version__ = "1.6.dev0"
50-
51-
5249# Instantiate or import these objects.
5350
5451
7976 get_service_address , get_service_shards , contest_id_from_args , \
8077 default_argument_parser
8178from .plugin import plugin_list
79+
80+ # Define version here for backwards compatibility, just in case anything reads it.
81+ import importlib .metadata
82+ __version__ = importlib .metadata .version ("cms" )
Original file line number Diff line number Diff line change 1313
1414import sys
1515import os
16+ import tomllib
1617
1718# If extensions (or modules to document with autodoc) are in another directory,
1819# add these directories to sys.path here. If the directory is relative to the
5455#
5556# See: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-version
5657#
57- version = "1.5"
58- release = "1.5.1"
58+ with open ("../pyproject.toml" , 'rb' ) as f :
59+ version = tomllib .load (f )['project' ]['version' ]
60+ release = version
5961
6062# The language for content autogenerated by Sphinx. Refer to documentation
6163# for a list of supported languages.
101103# Theme options are theme-specific and customize the look and feel of a theme
102104# further. For a list of options available for each theme, see the
103105# documentation.
104- #html_theme_options = {}
106+ html_theme_options = {
107+ 'fixed_sidebar' : True ,
108+ 'description' : "Version " + version ,
109+ }
105110
106111# Add any paths that contain custom themes here, relative to this directory.
107112#html_theme_path = []
Original file line number Diff line number Diff line change 11[project ]
2- dynamic = [" version " , " entry-points" , " scripts" ]
2+ dynamic = [" entry-points" , " scripts" ]
33name = " cms"
4+ version = " 1.6.dev0"
45license = " AGPL-3.0-or-later"
56maintainers = [ { name = " The CMS development team" , email = " contestms@googlegroups.com" } ]
67readme = " README.md"
Original file line number Diff line number Diff line change 2828
2929"""
3030
31- import os
32- import re
33-
3431from setuptools import setup , find_packages
3532from setuptools .command .build import build
3633
9289 ],
9390}
9491
95-
96- def find_version ():
97- """Return the version string obtained from cms/__init__.py"""
98- path = os .path .join ("cms" , "__init__.py" )
99- with open (path , "rt" , encoding = "utf-8" ) as f :
100- version_match = re .search (r"^__version__ = ['\"]([^'\"]*)['\"]" ,
101- f .read (), re .M )
102- if version_match is not None :
103- return version_match .group (1 )
104- raise RuntimeError ("Unable to find version string." )
105-
106-
10792# We piggyback the translation catalogs compilation onto build since
10893# the po and mofiles will be part of the package data for cms.locale,
10994# which is collected at this stage.
@@ -113,7 +98,6 @@ class build_with_l10n(build):
11398
11499setup (
115100 name = "cms" ,
116- version = find_version (),
117101 packages = find_packages (),
118102 package_data = PACKAGE_DATA ,
119103 cmdclass = {"build" : build_with_l10n },
You can’t perform that action at this time.
0 commit comments