Skip to content

Commit 8d270af

Browse files
committed
use meta for package variables
1 parent 1a973a9 commit 8d270af

File tree

3 files changed

+49
-19
lines changed

3 files changed

+49
-19
lines changed

pygem/__init__.py

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
"""
22
PyGeM init
33
"""
4+
__all__ = [
5+
"deformation",
6+
"ffd",
7+
"rbf",
8+
"idw",
9+
"rbf_factory",
10+
"custom_deformation",
11+
]
12+
413
from .deformation import Deformation
514
from .ffd import FFD
615
from .rbf import RBF
716
from .idw import IDW
817
from .rbf_factory import RBFFactory
918
from .custom_deformation import CustomDeformation
10-
11-
def get_current_year():
12-
""" Return current year """
13-
from datetime import datetime
14-
return datetime.now().year
15-
16-
__project__ = 'PyGeM'
17-
__title__ = "pygem"
18-
__author__ = "Marco Tezzele, Nicola Demo"
19-
__copyright__ = "Copyright 2017-{}, PyGeM contributors".format(get_current_year())
20-
__license__ = "MIT"
21-
__version__ = "2.0.0"
22-
23-
__maintainer__ = __author__
24-
__status__ = "Stable"
19+
from .meta import *

pygem/meta.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
__all__ = [
2+
"__project__",
3+
"__title__",
4+
"__author__",
5+
"__copyright__",
6+
"__license__",
7+
"__version__",
8+
"__mail__",
9+
"__maintainer__",
10+
"__status__",
11+
]
12+
13+
14+
def get_current_year():
15+
""" Return current year """
16+
from datetime import datetime
17+
18+
return datetime.now().year
19+
20+
21+
__project__ = "PyGeM"
22+
__title__ = "pygem"
23+
__author__ = "Marco Tezzele, Nicola Demo"
24+
__copyright__ = "Copyright 2017-{}, PyGeM contributors".format(
25+
get_current_year()
26+
)
27+
__license__ = "MIT"
28+
__version__ = "2.0.0"
29+
30+
__maintainer__ = __author__
31+
__status__ = "Stable"

setup.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@
66
from setuptools import setup, find_packages, Command
77
import pygem
88

9+
meta = {}
10+
with open("pygem/meta.py") as fp:
11+
exec(fp.read(), meta)
12+
913
# Package meta-data.
10-
NAME = pygem.__title__
14+
NAME = meta['__title__']
1115
DESCRIPTION = 'Python Geometrical Morphing.'
1216
URL = 'https://github.com/mathLab/PyGeM'
13-
MAIL = pygem.__mail__
14-
AUTHOR = pygem.__author__
15-
VERSION = pygem.__version__
17+
MAIL = meta['__mail__']
18+
AUTHOR = meta['__author__']
19+
VERSION = meta['__version__']
1620
KEYWORDS = 'dimension_reduction mathematics ffd morphing iges stl vtk openfoam'
1721

1822
REQUIRED = [

0 commit comments

Comments
 (0)