File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 1+
2+ [build-system ]
3+ requires = [" setuptools" ]
4+ build-backend = " setuptools.build_meta"
Original file line number Diff line number Diff line change 44# LICENSE file in the root directory of this source tree.
55#
66import os
7+ import pathlib
78from pathlib import Path
89
910from setuptools import find_packages , setup
@@ -17,6 +18,19 @@ def package_files(directory):
1718 return paths
1819
1920
21+ def get_version ():
22+ """Gets the benchmarl version."""
23+ path = CWD / "benchmarl" / "__init__.py"
24+ content = path .read_text ()
25+
26+ for line in content .splitlines ():
27+ if line .startswith ("__version__" ):
28+ return line .strip ().split ()[- 1 ].strip ().strip ('"' )
29+ raise RuntimeError ("bad version data in __init__.py" )
30+
31+
32+ CWD = pathlib .Path (__file__ ).absolute ().parent
33+
2034extra_files = package_files (
2135 str (
2236 Path (os .path .dirname (os .path .realpath (__file__ )))
@@ -27,7 +41,7 @@ def package_files(directory):
2741
2842setup (
2943 name = "benchmarl" ,
30- version = "1.1.1" ,
44+ version = get_version () ,
3145 description = "BenchMARL" ,
3246 url = "https://github.com/facebookresearch/BenchMARL" ,
3347 author = "Matteo Bettini" ,
You can’t perform that action at this time.
0 commit comments