Skip to content

Commit

Permalink
Improve CI and packaging (pydata#109)
Browse files Browse the repository at this point in the history
* Improve CI.

* Fix setup.py script.

* Fix setup.cfg.

* Add docs status to README.rst.

* Codecov.

* Tags for Python versions.

* .coveragerc

* Coverage in README.
  • Loading branch information
hameerabbasi committed Feb 24, 2018
1 parent 302a83c commit 4bbb4ba
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
source=sparse
16 changes: 13 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,23 @@ install:
- conda update conda

# Install dependencies
- conda create -n test-sparse python=$TRAVIS_PYTHON_VERSION pytest numpy scipy flake8 nomkl
- conda create -n test-sparse python=$TRAVIS_PYTHON_VERSION pytest numpy scipy flake8 pytest-cov nomkl
- source activate test-sparse

- pip install -e .[tests]
# For CodeCov
- pip install --user codecov

# Install sparse
- pip install -e .[tests-all]

before_script:
- flake8

script:
- py.test
- py.test --cov=./

after_success:
- codecov -F python-$TRAVIS_PYTHON_VERSION

notifications:
email: false
11 changes: 10 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
Sparse Multidimensional Arrays
==============================

|Build Status|
|Build Status| |Docs Status| |Coverage|

This library provides multi-dimensional sparse arrays.

* `Documentation <https://sparse.pydata.org/en/latest>`_
* `Contributing <https://github.com/pydata/sparse/blob/master/docs/contributing.rst>`_
* `Bug Reports/Feature Requests <https://github.com/pydata/sparse/issues>`_

.. |Docs Status| image:: https://readthedocs.org/projects/sparse-nd/badge/?version=latest
:target: http://sparse.pydata.org/en/latest/?badge=latest
:alt: Documentation Status

.. |Build Status| image:: https://travis-ci.org/pydata/sparse.svg?branch=master
:target: https://travis-ci.org/pydata/sparse
:alt: Build status

.. |Coverage| image:: https://codecov.io/gh/pydata/sparse/branch/master/graph/badge.svg
:target: https://codecov.io/gh/pydata/sparse
:alt: Coverage Report
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ parentdir_prefix = distributed-
universal=1

[tool:pytest]
addopts = --flake8 --doctest-modules sparse --cov-report term-missing --cov sparse
addopts = --doctest-modules sparse
47 changes: 33 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,38 @@
with open('README.rst') as f:
long_desc = f.read()

extras_require = {
'tests': [
'pytest',
'packaging',
],
'docs': [
'sphinx',
'sphinxcontrib-napoleon',
'sphinx_rtd_theme',
],
'tox': [
'tox',
],
'tests-linting': [
'flake8'
],
'tests-cov': [
'pytest-cov'
]
}

all_requires = []
tests_requires = []
for k, v in extras_require.items():
all_requires.extend(v)

if k.startswith('tests'):
tests_requires.extend(v)

extras_require['all'] = all_requires
extras_require['tests-all'] = tests_requires

setup(
name='sparse',
version=__version__,
Expand All @@ -21,19 +53,6 @@
packages=['sparse'],
long_description=long_desc,
install_requires=reqs,
extras_require={
'tests': [
'tox',
'pytest',
'pytest-cov',
'pytest-flake8',
'packaging',
],
'docs': [
'sphinx',
'sphinxcontrib-napoleon',
'sphinx_rtd_theme',
],
},
extras_require=extras_require,
zip_safe=False
)
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
envlist = py27,py36
[testenv]
commands=
flake8
py.test {posargs}
extras=
docs
Expand Down

0 comments on commit 4bbb4ba

Please sign in to comment.