-
Notifications
You must be signed in to change notification settings - Fork 68
/
setup.py
executable file
·88 lines (83 loc) · 2.92 KB
/
setup.py
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
from setuptools import setup
from setuptools.command.install import install
import os
class CustomInstallCommand(install):
def run(self):
# Check if the custom environment variable is set
if os.getenv("INSTALL_JULIA") == "1":
print("CustomInstallCommand: Installing Julia packages...")
try:
from juliacall import Main as jl
jl.seval("using Pkg")
jl.seval('Pkg.add(Pkg.PackageSpec(name="CrystalNets", uuid="7952bbbe-a946-4118-bea0-081a0932faa9"))')
print("CrystalNets has been installed successfully.")
except ImportError:
print("juliacall is not installed. Skipping Julia package installation.")
except Exception as e:
print(f"An error occurred during Julia package installation: {e}")
sys.exit(1) # Optionally, stop the installation if this step fails
else:
print("CustomInstallCommand: Skipping Julia package installation.")
# Run the standard install process
install.run(self)
with open("README.md") as fh:
long_description = fh.read()
setup(
name="pyxtal",
version="1.0.5",
author="Scott Fredericks, Kevin Parrish, Qiang Zhu",
author_email="[email protected]",
description="Python code for generation of crystal structures based on symmetry constraints.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/MaterSim/PyXtal",
packages=[
"pyxtal",
"pyxtal.database",
"pyxtal.interface",
"pyxtal.lego",
"pyxtal.optimize",
"pyxtal.potentials",
"pyxtal.database.cifs",
],
package_data={
"pyxtal.database": ["*.csv", "*.json", "*.db"],
"pyxtal.database.cifs": ["*.cif", "*.vasp"],
"pyxtal.potentials": ["*"],
},
scripts=[
"scripts/pyxtal_main.py",
"scripts/pyxtal_symmetry.py",
],
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
setup_requires=["juliacall>=0.9.0"],
install_requires=[
"spglib>=2.5.0",
"pymatgen>=2024.3.1",
"pandas>=2.0.2",
"networkx>=2.3",
"ase>=3.23.0",
"scipy>=1.7.3",
"numpy>=1.26,<2", # prevent the use of numpy2
"vasprun-xml>=1.0.4", # prevent the use of numpy2
"importlib_metadata>=1.4",
"typing-extensions>=4.12",
"pyocse>=0.1.1",
"psutil",
],
extras_require={
"visualization": ["py3Dmol>=0.8.0"],
"descriptor": ["pyshtools>=4.10.3"],
"molecules": ["openbabel", "pybel"],
"test": ["wheel", "pytest", "coverage", "pytest-cov", "monty>=2024.2.26"],
},
cmdclass={
'install': CustomInstallCommand,
},
python_requires=">=3.9",
license="MIT",
)