Skip to content

Commit 2b8e069

Browse files
committed
Add travis config
Beta release for PyPi
1 parent 25bb091 commit 2b8e069

File tree

7 files changed

+87
-9
lines changed

7 files changed

+87
-9
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ dist
33
freesasa.egg-info
44
*~
55
freesasa.c
6-
freesasa.so
6+
*.so
7+
__pycache__
78
test.pyc

.travis.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# A lot of inspiration from https://github.com/project-rig/rig_c_sa
2+
3+
language: generic
4+
5+
sudo: false
6+
7+
cache:
8+
directories:
9+
- "$HOME/.cache/pip"
10+
- "$HOME/.pyenv_cache"
11+
os:
12+
- linux
13+
- osx
14+
env:
15+
matrix:
16+
- PYVER=2.7
17+
- PYVER=3.4
18+
- PYVER=3.5
19+
- PYVER=3.6
20+
global:
21+
- USE_CYTHON=1
22+
23+
install:
24+
# Install 'pyenv': a utility for downloading and switching between multiple
25+
# Python interpreters on the same system.
26+
- git clone https://github.com/yyuu/pyenv.git ~/.pyenv
27+
- PYENV_ROOT="$HOME/.pyenv"
28+
- PATH="$PYENV_ROOT/bin:$PATH"
29+
- eval "$(pyenv init -)"
30+
# Install the latest release of the specified Python version using pyenv.
31+
- PYVER="$(pyenv install --list | grep -E "^\\s*$PYVER" | sort -n -t. -k3 | tail -n1)"
32+
- echo "Selected Python $PYVER"
33+
- pyenv install $PYVER
34+
# Make the newly installed version the default "python" command.
35+
- pyenv global $PYVER
36+
- python --version
37+
- pip install -r requirements.txt
38+
- git submodule update --init
39+
40+
script:
41+
- python setup.py install
42+
- python setup.py test
43+
44+
after_success:
45+
- >
46+
if [ -n "$TRAVIS_TAG" ]; then
47+
# can only upload binaries for osx
48+
if [ "x$TRAVIS_OS_NAME" == "xosx" ]; then
49+
python setup.py bdist_wheel;
50+
# only submit sdist once
51+
if [ "x$PYENV" == "x2.7" ]; then
52+
python setup.py sdist
53+
fi
54+
fi
55+
# twine env variables are set in Travis web config
56+
twine upload --skip-existing dist/*;
57+
else
58+
echo "Will only deploy tagged releases"
59+
fi

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
FreeSASA Python module
22
======================
3-
[![Build status](https://ci.appveyor.com/api/projects/status/nyo51pv2ufj2yhcj?svg=true)](https://ci.appveyor.com/project/mittinatten/freesasa-python)
3+
[![Appveyor build status](https://ci.appveyor.com/api/projects/status/nyo51pv2ufj2yhcj/branch/master?svg=true)](https://ci.appveyor.com/project/mittinatten/freesasa-python/branch/master)
4+
[![Travis build status](https://travis-ci.org/freesasa/freesasa-python.svg?branch=master)](https://travis-ci.org/freesasa/freesasa-python.svg?branch=master)
45

5-
The module has the FreeSASA C source as a submodule. It works with Python 2.7 and 3.4+, on Linux, Mac OS X and Windows.
6+
The module has the [FreeSASA C Library](https://github.com/mittinatten/freesasa>) as a submodule.
7+
It works with Python 2.7 and 3.4+, on Linux, Mac OS X and Windows.
68

7-
After cloning, build the module by the following
9+
It can be installed using
10+
~~~~sh
11+
pip install freesasa
12+
~~~~
13+
14+
Developers can clone the library, and then build the module by the following
815
~~~~sh
916
git submodule update --init
1017
python setup.py build

appveyor.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ environment:
55
# See: http://stackoverflow.com/a/13751649/163740
66
CMD_IN_ENV: "cmd /E:ON /V:O N /C .\\appveyor\\run_with_env.cmd"
77
USE_CYTHON: 1
8-
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
98
TWINE_USERNAME: mittinatten
109
TWINE_PASSWORD:
1110
secure: PE3DJXf2VYmUlH1Vo6CoMA==
@@ -85,7 +84,7 @@ install:
8584
# compiled extensions and are not provided as pre-built wheel packages,
8685
# pip will build them from source using the MSVC compiler matching the
8786
# target Python version and architecture
88-
- "%CMD_IN_ENV% pip install wheel cython biopython twine"
87+
- "%CMD_IN_ENV% pip install -r requirements.txt"
8988

9089
- git submodule update --init
9190

lib

Submodule lib updated 1 file

requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
twine
2+
cython
3+
biopython
4+
wheel
5+
nose

setup.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,16 @@
3333
else:
3434
sources.append("freesasa.c")
3535

36+
compile_args=['-DHAVE_CONFIG_H']
37+
38+
if os.name == 'posix':
39+
compile_args.append('-std=gnu99')
40+
3641
extension_src = [
3742
Extension("freesasa", sources,
3843
language='c',
3944
include_dirs=[os.path.join('lib', 'src'), '.'],
40-
extra_compile_args = ['-DHAVE_CONFIG_H']
45+
extra_compile_args = compile_args
4146
)
4247
]
4348

@@ -58,7 +63,9 @@
5863
keywords=['structural biology', 'proteins', 'bioinformatics'],
5964
headers=glob(os.path.join('lib', 'src', '*')),
6065
classifiers=[
61-
'Development Status :: 5 - Production/Stable',
66+
'Development Status :: 4 - Beta',
67+
'Topic :: Scientific/Engineering :: Bio-Informatics',
68+
'Topic :: Scientific/Engineering :: Chemistry',
6269
'License :: OSI Approved :: MIT License',
6370
'Programming Language :: Python :: 2.7',
6471
'Programming Language :: Python :: 3.4',

0 commit comments

Comments
 (0)