Skip to content

Commit 83825f6

Browse files
committed
Merge branch 'pip-install'
2 parents a66f099 + b9514f2 commit 83825f6

12 files changed

Lines changed: 2047 additions & 3 deletions

File tree

.appveyor.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
environment:
2+
3+
matrix:
4+
- PYTHON: "C:\\Python36-x64"
5+
PYTHON_VERSION: "3.6"
6+
PYTHON_ARCH: "64"
7+
8+
- PYTHON: "C:\\Python37-x64"
9+
PYTHON_VERSION: "3.7"
10+
PYTHON_ARCH: "64"
11+
12+
13+
install:
14+
# Make sure pip is around
15+
- python -m ensurepip
16+
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
17+
18+
# Install the package locally
19+
#- pip install --upgrade pip setuptools
20+
- pip install pytest pytest-cov codecov
21+
- pip install -e src
22+
23+
build: false
24+
25+
test_script:
26+
- pytest -v --cov=hsd test
27+
28+
on_success:
29+
- codecov

.codecov.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Codecov configuration to make it a bit less noisy
2+
coverage:
3+
status:
4+
patch: false
5+
project:
6+
default:
7+
threshold: 50%
8+
comment:
9+
layout: "header"
10+
require_changes: false
11+
branches: null
12+
behavior: default
13+
flags: null
14+
paths: null

.lgtm.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Configure LGTM for this package
2+
3+
extraction:
4+
python: # Configure Python
5+
python_setup: # Configure the setup
6+
version: 3 # Specify Version 3
7+
path_classifiers:
8+
library:
9+
- src/versioneer.py # Set Versioneer.py to an external "library" (3rd party code)
10+
- devtools/*
11+
generated:
12+
- src/hsd/_version.py

.travis.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
language: python
2+
3+
# Run jobs on container-based infrastructure, can be overridden per job
4+
5+
matrix:
6+
include:
7+
# Extra includes for OSX since python language is not available by default on OSX
8+
- os: osx
9+
language: generic
10+
env: PYTHON_VER=3.6
11+
- os: osx
12+
language: generic
13+
env: PYTHON_VER=3.7
14+
15+
16+
# Pip can use Travis build-in Python
17+
- os: linux
18+
python: 3.6
19+
- os: linux
20+
dist: xenial # Travis Trusty image does not have Python 3.7, Xenial does
21+
python: 3.7
22+
23+
24+
before_install:
25+
# Additional info about the build
26+
- uname -a
27+
- df -h
28+
- ulimit -a
29+
30+
# Install the Python environment
31+
- source devtools/travis-ci/before_install.sh
32+
- python -V
33+
34+
install:
35+
36+
# Install the package locally
37+
- pip install -U pytest pytest-cov codecov
38+
- pip install -e src/
39+
40+
41+
script:
42+
- pytest -v --cov=hsd test/
43+
44+
notifications:
45+
email: false
46+
47+
after_success:
48+
- codecov
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Temporarily change directory to $HOME to install software
2+
pushd .
3+
cd $HOME
4+
# Make sure some level of pip is installed
5+
python -m ensurepip
6+
7+
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
8+
HOMEBREW_NO_AUTO_UPDATE=1 brew upgrade pyenv
9+
# Pyenv requires minor revision, get the latest
10+
PYENV_VERSION=$(pyenv install --list |grep $PYTHON_VER | sed -n "s/^[ \t]*\(${PYTHON_VER}\.*[0-9]*\).*/\1/p" | tail -n 1)
11+
# Install version
12+
pyenv install $PYENV_VERSION
13+
# Use version for this
14+
pyenv global $PYENV_VERSION
15+
# Setup up path shims
16+
eval "$(pyenv init -)"
17+
fi
18+
pip install --upgrade pip setuptools
19+
20+
# Restore original directory
21+
popd

src/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../LICENSE

src/MANIFEST.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
include LICENSE
2+
include MANIFEST.in
3+
include versioneer.py
4+
5+
graft hsd
6+
global-exclude *.py[cod] __pycache__ *.so

src/setup.cfg

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Helper file to handle all configs
2+
3+
[coverage:run]
4+
# .coveragerc to control coverage.py and pytest-cov
5+
omit =
6+
# Omit the tests
7+
*/tests/*
8+
# Omit generated versioneer
9+
hsd/_version.py
10+
11+
[yapf]
12+
# YAPF, in .style.yapf files this shows up as "[style]" header
13+
COLUMN_LIMIT = 119
14+
INDENT_WIDTH = 4
15+
USE_TABS = False
16+
17+
[flake8]
18+
# Flake8, PyFlakes, etc
19+
max-line-length = 119
20+
21+
[versioneer]
22+
# Automatic version numbering scheme
23+
VCS = git
24+
style = pep440
25+
versionfile_source = hsd/_version.py
26+
versionfile_build = hsd/_version.py
27+
tag_prefix = ''
28+
29+
[aliases]
30+
test = pytest

src/setup.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
"""
2+
hsd
3+
Python routines to manipulate HSD data
4+
"""
5+
import sys
6+
from setuptools import setup, find_packages
7+
import versioneer
8+
9+
short_description = __doc__.split("\n")
10+
11+
# from https://github.com/pytest-dev/pytest-runner#conditional-requirement
12+
needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
13+
pytest_runner = ['pytest-runner'] if needs_pytest else []
14+
15+
try:
16+
with open("README.rst", "r") as handle:
17+
long_description = handle.read()
18+
except:
19+
long_description = "\n".join(short_description[2:])
20+
21+
22+
setup(
23+
# Self-descriptive entries which should always be present
24+
name='hsd',
25+
author='DFTB+ developers group',
26+
author_email='info@dftbplus.org',
27+
description=short_description[0],
28+
long_description=long_description,
29+
long_description_content_type="text/x-rst",
30+
version=versioneer.get_version(),
31+
cmdclass=versioneer.get_cmdclass(),
32+
license='BSD 2-clause license',
33+
34+
# Which Python importable modules should be included when your package is installed
35+
# Handled automatically by setuptools. Use 'exclude' to prevent some specific
36+
# subpackage(s) from being added, if needed
37+
packages=find_packages(),
38+
39+
# Optional include package data to ship with your package
40+
# Customize MANIFEST.in if the general case does not suit your needs
41+
# Comment out this line to prevent the files from being packaged with your software
42+
include_package_data=True,
43+
44+
# Allows `setup.py test` to work correctly with pytest
45+
setup_requires=[] + pytest_runner,
46+
47+
# Additional entries you may want simply uncomment the lines you want and fill in the data
48+
# url='http://www.my_package.com', # Website
49+
install_requires=['numpy'], # Required packages, pulls from pip if needed; do not use for Conda deployment
50+
# platforms=['Linux',
51+
# 'Mac OS-X',
52+
# 'Unix',
53+
# 'Windows'], # Valid platforms your code works on, adjust to your flavor
54+
# python_requires=">=3.5", # Python version restrictions
55+
56+
# Manual control if final package is compressible or not, set False to prevent the .egg from being made
57+
# zip_safe=False,
58+
59+
)

0 commit comments

Comments
 (0)