|
1 | | -"""Usage: pip install .""" |
| 1 | +#!/usr/bin/env python |
2 | 2 |
|
3 | | -import re |
4 | | -from setuptools import setup, find_packages |
| 3 | +import setuptools |
5 | 4 |
|
6 | | -import sys |
7 | | -if sys.version_info < (3, 6): |
8 | | - raise 'must use Python version 3.6 or higher' |
9 | | - |
10 | | -README = r"""Z2Pack is a tool that computes topological invariants and illustrates non-trivial features of Berry curvature. It works as a post-processing tool with all major first-principles codes (z2pack.fp), as well as with tight-binding models (z2pack.tb) and explicit Hamiltonian matrices -- such as the ones obtained from a k.p model (z2pack.hm). |
11 | | -
|
12 | | -It tracks the charge centers of hybrid Wannier functions - as described `here <http://journals.aps.org/prb/abstract/10.1103/PhysRevB.83.235401>`_ - to calculate these topological invariants. |
13 | | -
|
14 | | -The Wannier charge centers are computed from overlap matrices that are obtained either directly (for tb) or via the Wannier90 code package (fp). |
15 | | -
|
16 | | -`Documentation: <https://z2pack.greschd.ch>`_ |
17 | | -""" |
18 | | - |
19 | | -with open('./z2pack/__init__.py', 'r') as f: |
20 | | - MATCH_EXPR = "__version__[^'\"]+(['\"])([^'\"]+)" |
21 | | - VERSION = re.search(MATCH_EXPR, f.read()).group(2).strip() |
22 | | - |
23 | | -EXTRAS = { |
24 | | - 'plot': ['matplotlib'], |
25 | | - 'tb': ['tbmodels>=1.1.1'], |
26 | | - 'doc': ['sphinx', 'sphinx-rtd-theme', 'sphinx-pyreverse', 'pylint==2.4.4'], |
27 | | - 'dev': |
28 | | - ['pytest~=6.0', 'pytest-cov', 'yapf==0.29', 'pre-commit', 'pylint==2.4.4'], |
29 | | -} |
30 | | -EXTRAS['dev'] += EXTRAS['plot'] + EXTRAS['tb'] + EXTRAS['doc'] |
31 | | - |
32 | | -setup( |
33 | | - name='z2pack', |
34 | | - version=VERSION, |
35 | | - url='https://z2pack.greschd.ch', |
36 | | - author='Dominik Gresch', |
37 | | - |
38 | | - description= |
39 | | - 'Automating the computation of topological numbers of band-structures', |
40 | | - install_requires=[ |
41 | | - 'numpy', 'scipy', 'decorator', 'blessings', 'sortedcontainers', |
42 | | - 'msgpack-python', 'fsc.locker', 'fsc.export', 'fsc.formatting', |
43 | | - 'fsc.iohelper' |
44 | | - ], |
45 | | - extras_require=EXTRAS, |
46 | | - python_requires=">=3.6", |
47 | | - long_description=README, |
48 | | - classifiers=[ |
49 | | - 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', |
50 | | - 'Natural Language :: English', 'Operating System :: Unix', |
51 | | - 'Programming Language :: Python :: 3', |
52 | | - 'Programming Language :: Python :: 3.6', |
53 | | - 'Programming Language :: Python :: 3.7', |
54 | | - 'Programming Language :: Python :: 3.8', |
55 | | - 'Intended Audience :: Science/Research', |
56 | | - 'Topic :: Scientific/Engineering :: Physics', |
57 | | - 'Development Status :: 5 - Production/Stable' |
58 | | - ], |
59 | | - license='GPL', |
60 | | - keywords=[ |
61 | | - 'topology', 'topological', 'invariant', 'bandstructure', 'chern', 'z2', |
62 | | - 'solid-state', 'tight-binding' |
63 | | - ], |
64 | | - packages=find_packages() |
65 | | -) |
| 5 | +if __name__ == "__main__": |
| 6 | + setuptools.setup() |
0 commit comments