Skip to content

Commit

Permalink
Merge pull request #310 from brian-team/update_build_system
Browse files Browse the repository at this point in the history
Update build system
  • Loading branch information
mstimberg committed Jul 9, 2023
2 parents 89851a2 + a39e522 commit 16b48e3
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 2,862 deletions.
4 changes: 4 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
ref-names: $Format:%D$
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
brian2cuda/_version.py export-subst
.git_archival.txt export-subst
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Versioneer files
include versioneer.py
include brian2cuda/_version.py

# Documentation
Expand All @@ -10,3 +9,5 @@ include docs_sphinx/make.bat
include docs_sphinx/Makefile
recursive-include docs_sphinx *.rst
prune docs_sphinx/reference # will be generated automatically
prune dev
prune brian2cuda/tools
23 changes: 20 additions & 3 deletions brian2cuda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,26 @@
from . import timedarray


from . import _version
try:
from ._version import __version__, __version_tuple__
except ImportError:
try:
from setuptools_scm import get_version

__version__ = _version.get_versions()["version"]
__version__ = get_version(
root="..",
relative_to=__file__,
version_scheme="post-release",
local_scheme="no-local-version",
)
__version_tuple__ = tuple(int(x) for x in __version__.split(".")[:3])
except ImportError:
logging.getLogger("brian2cuda").warn(
"Cannot determine Brian2CUDA version, running from source and "
"setuptools_scm is not installed."
)
__version__ = "unknown"
__version_tuple__ = (0, 0, 0)


# make the test suite available via brian2cuda.test()
Expand Down Expand Up @@ -56,4 +73,4 @@ def example_run(device_name="cuda_standalone", directory=None, **build_options):
assert_allclose(G.v, np.arange(N) / N * np.exp(-1 * ms / tau))
device.reinit()
device.activate()
print("\nExample run was successful.")
print("\nExample run was successful.")

0 comments on commit 16b48e3

Please sign in to comment.