Skip to content

Commit ca1d233

Browse files
authored
refactor: move __version__ and __version_info__ into _version.py (#865)
Extract the version definitions from brainpy/__init__.py into a dedicated brainpy/_version.py module and re-export them from the package root, so the canonical version string lives in a single small file. pyproject already reads brainpy.__version__ and lists _version.py in its coverage omit lists.
1 parent 8c58975 commit ca1d233

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

brainpy/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
# limitations under the License.
1515
# ==============================================================================
1616

17-
__version__ = "2.8.0"
18-
__version_info__ = tuple(map(int, __version__.split(".")))
17+
from brainpy._version import __version__ as __version__
18+
from brainpy._version import __version_info__ as __version_info__
1919

2020
from brainpy import _errors as errors
2121
# fundamental supporting modules

brainpy/_version.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2025 BrainX Ecosystem Limited. All Rights Reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
# ==============================================================================
16+
17+
__version__ = "2.8.0"
18+
__version_info__ = tuple(map(int, __version__.split(".")))

0 commit comments

Comments
 (0)