-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsetup.py
More file actions
111 lines (91 loc) · 3.99 KB
/
setup.py
File metadata and controls
111 lines (91 loc) · 3.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/usr/bin/env python
# Standard library modules.
from pathlib import Path
import logging
# Third party modules.
from setuptools import setup, find_packages
import setuptools.command.build_py as _build_py
# Local modules.
import versioneer
# Globals and constants variables.
BASEDIR = Path(__file__).parent.resolve()
logger = logging.getLogger("pyxray")
class build_py(_build_py.build_py):
def run(self):
# Build SQL database
import sqlalchemy
import pyxray.sql.build
logging.basicConfig()
logger.setLevel(logging.INFO)
filepath = BASEDIR.joinpath("pyxray", "data", "pyxray.db").resolve()
if filepath.exists():
filepath.unlink()
engine = sqlalchemy.create_engine("sqlite:///" + str(filepath))
builder = pyxray.sql.build.SqlDatabaseBuilder(engine)
builder.build()
try:
del self.data_files # Force reinitialization of files to copy
except AttributeError:
pass
super().run()
with open(BASEDIR.joinpath("README.rst"), "r") as fp:
LONG_DESCRIPTION = fp.read()
PACKAGES = find_packages()
PACKAGE_DATA = {"pyxray": ["data/pyxray.db"]}
with open(BASEDIR.joinpath("requirements.txt"), "r") as fp:
INSTALL_REQUIRES = fp.read().splitlines()
EXTRAS_REQUIRE = {}
with open(BASEDIR.joinpath("requirements-dev.txt"), "r") as fp:
EXTRAS_REQUIRE["dev"] = fp.read().splitlines()
with open(BASEDIR.joinpath("requirements-test.txt"), "r") as fp:
EXTRAS_REQUIRE["test"] = fp.read().splitlines()
CMDCLASS = versioneer.get_cmdclass()
CMDCLASS["build_py"] = build_py
ENTRY_POINTS = {
"pyxray.parser": [
"element symbol = pyxray.parser.notation:ElementSymbolParser",
"atomic shell notation = pyxray.parser.notation:AtomicShellNotationParser",
"atomic subshell notation = pyxray.parser.notation:AtomicSubshellNotationParser",
"generic x-ray transition notation = pyxray.parser.notation:GenericXrayTransitionNotationParser",
"known x-ray transition notation = pyxray.parser.notation:KnownXrayTransitionNotationParser",
"series x-ray transition notation = pyxray.parser.notation:SeriesXrayTransitionNotationParser",
"family x-ray transition notation = pyxray.parser.notation:FamilyXrayTransitionNotationParser",
"wikipedia element name = pyxray.parser.wikipedia:WikipediaElementNameParser",
"sargent-welch element atomic weight = pyxray.parser.sargent_welch:SargentWelchElementAtomicWeightParser",
"sargent-welch element mass density = pyxray.parser.sargent_welch:SargentWelchElementMassDensityParser",
"perkins1991 = pyxray.parser.perkins1991:Perkins1991Parser",
"nist atomic weight = pyxray.parser.nist:NISTElementAtomicWeightParser",
"jeol transition = pyxray.parser.jeol:JEOLTransitionParser",
"campbell2001 = pyxray.parser.campbell2001:CampbellAtomicSubshellRadiativeWidthParser",
"dtsa1992 subshell = pyxray.parser.dtsa:DtsaSubshellParser",
"dtsa1992 transition = pyxray.parser.dtsa:DtsaLineParser",
],
}
setup(
name="pyxray",
version=versioneer.get_version(),
url="https://github.com/openmicroanalysis/pyxray",
author="Philippe T. Pinard",
author_email="philippe.pinard@gmail.com",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Physics",
],
description="Definitions and properties of X-ray transitions",
long_description=LONG_DESCRIPTION,
long_description_content_type="text/markdown",
license="MIT license",
packages=PACKAGES,
package_data=PACKAGE_DATA,
include_package_data=True,
install_requires=INSTALL_REQUIRES,
extras_require=EXTRAS_REQUIRE,
cmdclass=CMDCLASS,
entry_points=ENTRY_POINTS,
)