Skip to content

Commit

Permalink
Merge branch 'develop' for release 0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
skasberger committed May 28, 2019
2 parents 2b1f2b8 + 04a1f6d commit 55bf52b
Show file tree
Hide file tree
Showing 8 changed files with 150 additions and 88 deletions.
1 change: 0 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ python:
version: 3.6
install:
- requirements: tools/docs-requirements.txt
- requirements: requirements.txt
- method: pip
path: .
system_packages: true
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ matrix:
env: TOXENV=py36
- python: 3.7
env: TOXENV=py37
- python: 3.6
env: TOXENV=packaging
- python: 3.6
env: TOXENV=docs
- python: 3.6
env: TOXENV=coverage
- python: 3.6
env: TOXENV=coveralls
- python: 3.6
env: TOXENV=flake8
- python: 3.6
env: TOXENV=packaging
- python: 3.6
env: TOXENV=dist

branches:
only:
Expand Down
22 changes: 0 additions & 22 deletions requirements.txt

This file was deleted.

11 changes: 7 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,13 @@ def run_tests(self):
INSTALL_REQUIREMENTS = [
# A string or list of strings specifying what other distributions need to
# be installed when this one is.
'requests'
]

SETUP_REQUIREMENTS = [
]

TESTS_REQUIREMENTS = [
'tox'
]

CLASSIFIERS = [
Expand All @@ -83,7 +86,7 @@ def run_tests(self):
author_email='[email protected]',
name='pyDataverse',
version=find_version('src', 'pyDataverse', '__init__.py'),
description='A Dataverse API wrapper',
description='A wrapper for the Dataverse API',
long_description=read_file('README.md'),
long_description_content_type="text/markdown",
license='MIT',
Expand All @@ -94,11 +97,11 @@ def run_tests(self):
install_requires=INSTALL_REQUIREMENTS,
packages=find_packages('src'),
package_dir={'': 'src'},
setup_requires=['pytest-runner'],
setup_requires=SETUP_REQUIREMENTS,
tests_require=TESTS_REQUIREMENTS,
cmdclass={'test': Tox},
include_package_data=True,
keywords=['pydataverse', 'dataverse', 'api'],
keywords=['pyDataverse', 'dataverse', 'api'],
zip_safe=False,
project_urls={
'Documentation': 'https://pydataverse.readthedocs.io/',
Expand Down
10 changes: 8 additions & 2 deletions src/pyDataverse/docs/source/developer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@ Exceptions
Install
-----------------------------

Install from the local git repository:
Install from the local git repository, with all it's dependencies:

.. code-block:: shell
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
pip install -r tools/tests-requirements.txt
pip install -r tools/lint-requirements.txt
pip install -r tools/docs-requirements.txt
pip install -r tools/packaging-requirements.txt
pip install -e .
Testing
Expand Down Expand Up @@ -80,6 +84,8 @@ When you only want to run one test, e.g. the py36 test:
tox -e py36
To find out more about which tests are available, have a look inside the tox.ini file.


Documentation
-----------------------------
Expand Down
66 changes: 46 additions & 20 deletions src/pyDataverse/docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@ pyDataverse

Release v\ |version|.

.. image:: https://travis-ci.com/AUSSDA/pyDataverse.svg?branch=master
:target: https://travis-ci.com/AUSSDA/pyDataverse

.. image:: https://img.shields.io/pypi/v/pyDataverse.svg
:target: https://pypi.org/project/pyDataverse/

.. image:: https://img.shields.io/pypi/wheel/pyDataverse.svg
:target: https://pypi.org/project/pyDataverse/

.. image:: https://img.shields.io/pypi/pyversions/pyDataverse.svg
:target: https://pypi.org/project/pyDataverse/

.. image:: https://readthedocs.org/projects/pydataverse/badge/?version=latest
:target: https://pydataverse.readthedocs.io/en/latest

.. image:: https://coveralls.io/repos/github/AUSSDA/pyDataverse/badge.svg
:target: https://coveralls.io/github/AUSSDA/pyDataverse

.. image:: https://img.shields.io/github/license/aussda/pydataverse.svg
:target: https://opensource.org/licenses/MIT

Expand All @@ -19,26 +37,34 @@ to create, update and remove Dataverses, Datasets and Datafiles.
Quickstart
-----------------------------

>>> from pyDataverse.api import Api
>>> # establish connection
>>> base_url = 'http://demo.dataverse.org'
>>> api = Api(base_url)
>>> api.status
'OK'
>>> # get dataverse
>>> dv = 'ecastro' # dataverse alias or id
>>> resp = api.get_dataverse(dv)
>>> resp.json()['data']['creationDate']
'2015-04-20T09:29:39Z'
>>> # get dataset
>>> resp = api.get_dataset(identifier)
>>> resp.json()['data']['id']
24
>>> # get datafile
>>> datafile_id = '32' # file id of the datafile
>>> resp = api.get_datafile(datafile_id)
>>> resp
<Response [200]>
**Install**

.. code-block:: shell
pip install pyDataverse
**Usage**

>>> from pyDataverse.api import Api
>>> # establish connection
>>> base_url = 'http://demo.dataverse.org'
>>> api = Api(base_url)
>>> api.status
'OK'
>>> # get dataverse
>>> dv = 'ecastro' # dataverse alias or id
>>> resp = api.get_dataverse(dv)
>>> resp.json()['data']['creationDate']
'2015-04-20T09:29:39Z'
>>> # get dataset
>>> resp = api.get_dataset(identifier)
>>> resp.json()['data']['id']
24
>>> # get datafile
>>> datafile_id = '32' # file id of the datafile
>>> resp = api.get_datafile(datafile_id)
>>> resp
<Response [200]>


Requirements
Expand Down
30 changes: 16 additions & 14 deletions tools/tests-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
codecov
coverage
coveralls
check-manifest
future
pycodestyle
pytest>=3.0.0
pytest-cov
pytest-env>=0.6.2
pytest-runner
pytest-xdist
setuptools
tox==3.11.0
wheel
coverage==4.5.3
atomicwrites==1.3.0
attrs==19.1.0
certifi==2019.3.9
chardet==3.0.4
idna==2.8
importlib-metadata==0.15
more-itertools==5.0.0
pluggy==0.12.0
py==1.8.0
pytest==4.5.0
pytest-cov==2.7.1
six==1.12.0
urllib3==1.25.3
wcwidth==0.1.7
zipp==0.5.1
90 changes: 67 additions & 23 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,58 +1,102 @@
[tox]
envlist = py36,coverage,coveralls,packaging,docs,flake8
envlist = py36,coverage,coveralls,docs,flake8,packaging,dist
skip_missing_interpreters = True
ignore_basepython_conflict = True

[testenv]
description = default settings for unspecified tests
usedevelop = True
usedevelop = False
skip_install = False
passenv = *
basepython = python3.6
deps = -r{toxinidir}/tools/tests-requirements.txt

[testenv:py27]
deps =
-r{toxinidir}/tools/tests-requirements.txt
commands =
pytest tests/ --cov=src/pyDataverse --basetemp={envtmpdir}

[testenv:py34]
deps =
-r{toxinidir}/tools/tests-requirements.txt
commands =
pytest tests/ --cov=src/pyDataverse --basetemp={envtmpdir}

[testenv:py35]
deps =
-r{toxinidir}/tools/tests-requirements.txt
commands =
pytest tests/ --cov=src/pyDataverse --basetemp={envtmpdir}

[testenv:py36]
deps =
-r{toxinidir}/tools/tests-requirements.txt
commands =
pytest tests/ --cov=src/pyDataverse --basetemp={envtmpdir}

[testenv:py37]
deps =
-r{toxinidir}/tools/tests-requirements.txt
commands =
pytest tests/ --cov=src/pyDataverse --basetemp={envtmpdir}

[testenv:coverage]
description = create report for coverage
basepython = python3.6
deps = -r{toxinidir}/tools/tests-requirements.txt
deps =
-r{toxinidir}/tools/tests-requirements.txt
commands =
pytest tests/ --cov=src/pyDataverse --cov-report=term-missing --cov-report=xml --cov-report=html

[testenv:coveralls]
description = create reports for coveralls
basepython = python3.6
deps = -r{toxinidir}/tools/tests-requirements.txt
deps =
-r{toxinidir}/tools/tests-requirements.txt
commands =
pytest tests/ --doctest-modules -v --cov=src/pyDataverse

[testenv:packaging]
description = check packaging with twine
usedevelop = True
basepython = python3.6
skip_install = True
deps = -r{toxinidir}/tools/packaging-requirements.txt
commands =
twine check -h

[flake8]
exclude =
src/pyDataverse/docs/source/conf.py
src/pyDataverse/docs/source/conf.py
.tox
.egg

[testenv:flake8]
description = flake8 for style guide testing
usedevelop = True
basepython = python3.6
deps = -r{toxinidir}/tools/lint-requirements.txt
deps =
-r{toxinidir}/tools/lint-requirements.txt
commands =
flake8 src/pyDataverse/
flake8 tests/
isort --check-only --diff src/pyDataverse
skip_install = true

[testenv:docs]
description = invoke sphinx-build to build the HTML docs
basepython = python3.6
deps = -r{toxinidir}/tools/docs-requirements.txt
deps =
-r{toxinidir}/tools/docs-requirements.txt
commands =
sphinx-build -d src/pyDataverse/docs/build/docs_doctree src/pyDataverse/docs/source docs/build/html --color -b html {posargs}

[testenv:packaging]
description = check packaging with twine
skip_install = True
recreate = True
deps =
-r{toxinidir}/tools/packaging-requirements.txt
commands =
python setup.py sdist bdist_wheel
twine check dist/*

[testenv:dist]
description = install from dist
recreate = True
commands =
pip freeze
python -c "import pyDataverse; print(pyDataverse.__name__); print(pyDataverse.__version__)"

[testenv:pypitest]
description = install from test pypi
skip_install = True
recreate = True
commands =
pip install --index-url https://test.pypi.org/simple/ pyDataverse
pip freeze

0 comments on commit 55bf52b

Please sign in to comment.