Skip to content

Commit 57eb315

Browse files
authored
Use setup.cfg for installation (#103)
* Set '--no-plot-compare' option on CI tests. * Move setup configuration to setup.cfg file * Remove prospector config file * Use editable install in 'dev' test type to enable coverage report
1 parent 4b255c8 commit 57eb315

File tree

7 files changed

+70
-82
lines changed

7 files changed

+70
-82
lines changed

.ci/install_script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pip install -U pip setuptools wheel
1010

1111
case "$INSTALL_TYPE" in
1212
dev)
13-
pip install .[dev]
13+
pip install -e .[dev]
1414
;;
1515
dev_sdist)
1616
python setup.py sdist

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ examples/fp/**/results
2626
examples/fp/Bi2Se3_qe/scf
2727
examples/fp/Bi2Se3_qe/input/bi2se3.win
2828
# VASP license
29-
POTCAR
29+
POTCAR
3030
# to work with old git on Brutus
3131
tests/samples/vasp/POTCAR
3232
examples/fp/Bi_vasp/input/POTCAR
@@ -50,8 +50,6 @@ decorator.py
5050
tests/.pytest_cache
5151
.pytest_cache/v/cache
5252
.coverage
53-
.coverage*
54-
!.coveragerc
5553
htmlcov
5654

5755
# editors

.prospector.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

setup.cfg

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
[metadata]
2+
name = z2pack
3+
author = Dominik Gresch
4+
author_email = [email protected]
5+
version = attr: z2pack.__version__
6+
url = https://z2pack.greschd.ch
7+
description = Automating the computation of topological numbers of band-structures.
8+
long_description = file: README.md
9+
long_description_content_type = text/markdown
10+
keywords =
11+
topology
12+
topological
13+
invariant
14+
bandstructure
15+
chern
16+
z2
17+
solid-state
18+
tight-binding
19+
license = GPL
20+
classifiers =
21+
License :: OSI Approved :: GNU General Public License v3 (GPLv3)
22+
Natural Language :: English
23+
Operating System :: Unix
24+
Programming Language :: Python :: 3
25+
Programming Language :: Python :: 3.6
26+
Programming Language :: Python :: 3.7
27+
Programming Language :: Python :: 3.8
28+
Intended Audience :: Science/Research
29+
Topic :: Scientific/Engineering :: Physics
30+
Development Status :: 5 - Production/Stable
31+
32+
[options]
33+
python_requires = >=3.6
34+
install_requires =
35+
numpy
36+
scipy
37+
decorator
38+
blessings
39+
sortedcontainers
40+
msgpack-python
41+
fsc.locker
42+
fsc.export
43+
fsc.formatting
44+
fsc.iohelper
45+
packages = find:
46+
47+
[options.extras_require]
48+
plot =
49+
matplotlib
50+
tb =
51+
tbmodels>=1.1.1
52+
dev =
53+
matplotlib
54+
tbmodels>=1.1.1
55+
sphinx
56+
sphinx-rtd-theme
57+
sphinx-pyreverse
58+
pytest~=6.0
59+
pytest-cov
60+
yapf==0.29
61+
pre-commit
62+
pylint==2.4.4
63+
ruamel.yaml

setup.py

Lines changed: 4 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,6 @@
1-
"""Usage: pip install ."""
1+
#!/usr/bin/env python
22

3-
import re
4-
from setuptools import setup, find_packages
3+
import setuptools
54

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-
author_email='[email protected]',
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()

tests/coverage.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
py.test -p no:cov-exclude --cov=z2pack --cov-report=html -Q -A
2+
pytest -p no:cov-exclude --cov=z2pack --cov-report=html -Q -A

tests/local_config.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)