VeraGridServer 6.2.4__tar.gz → 6.2.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: VeraGridServer
3
- Version: 6.2.4
3
+ Version: 6.2.6
4
4
  Summary: VeraGrid is a Power Systems simulation program intended for professional use and research
5
5
  Home-page: https://github.com/SanPen/VeraGrid
6
6
  Author: Santiago Peñate Vera et. Al.
@@ -6,7 +6,7 @@ import datetime
6
6
  _current_year_ = datetime.datetime.now().year
7
7
 
8
8
  # remember to keep a three-number version!!!
9
- __VeraGridServer_VERSION__ = "6.2.4"
9
+ __VeraGridServer_VERSION__ = "6.2.6"
10
10
 
11
11
  url = 'https://github.com/SanPen/VeraGrid'
12
12
 
@@ -10,34 +10,44 @@ https://github.com/pypa/sampleproject
10
10
  """
11
11
 
12
12
  # Always prefer setuptools over distutils
13
+ import ast
14
+ from pathlib import Path
13
15
  from setuptools import setup, find_packages
14
- import os
15
16
 
16
- from VeraGridServer.__version__ import __VeraGridServer_VERSION__
17
+ description = 'VeraGrid is a Power Systems simulation program intended for professional use and research'
17
18
 
18
- here = os.path.abspath(os.path.dirname(__file__))
19
19
 
20
- long_description = """# VeraGrid
20
+ def read_module_constant(module_path: Path, constant_name: str) -> str:
21
+ module_ast = ast.parse(module_path.read_text(encoding='utf-8'), filename=str(module_path))
21
22
 
22
- This software aims to be a complete platform for power systems research and simulation.
23
+ for node in module_ast.body:
24
+ if isinstance(node, ast.Assign):
25
+ for target in node.targets:
26
+ if isinstance(target, ast.Name) and target.id == constant_name:
27
+ return str(ast.literal_eval(node.value))
23
28
 
24
- [Watch the video https](https://youtu.be/SY66WgLGo54)
29
+ raise ValueError(f"Constant {constant_name!r} not found in {module_path}")
25
30
 
26
- [Check out the documentation](https://gridcal.readthedocs.io)
27
31
 
32
+ def read_long_description() -> str:
33
+ src_root = Path(__file__).resolve().parent
28
34
 
29
- ## Installation
35
+ for candidate in (
36
+ src_root / 'README.md',
37
+ src_root.parent / 'README.md',
38
+ src_root.parent.parent / 'README.md',
39
+ ):
40
+ if candidate.exists():
41
+ return candidate.read_text(encoding='utf-8')
30
42
 
31
- pip install VeraGridServer
43
+ raise FileNotFoundError('README.md not found next to setup.py or in its parent folders')
32
44
 
33
- For more options (including a standalone setup one), follow the
34
- [installation instructions]( https://gridcal.readthedocs.io/en/latest/getting_started/install.html)
35
- from the project's [documentation](https://gridcal.readthedocs.io)
36
- """
37
45
 
38
- description = 'VeraGrid is a Power Systems simulation program intended for professional use and research'
39
-
40
- base_path = os.path.join('VeraGridServer')
46
+ long_description = read_long_description()
47
+ __VeraGridServer_VERSION__ = read_module_constant(
48
+ Path(__file__).resolve().parent / '__version__.py',
49
+ '__VeraGridServer_VERSION__',
50
+ )
41
51
 
42
52
  pkgs_to_exclude = ['docs', 'research', 'tests', 'tutorials', 'VeraGridEngine']
43
53
 
File without changes