Skip to content

Commit 55bf52b

Browse files
committed
Merge branch 'develop' for release 0.1.1
2 parents 2b1f2b8 + 04a1f6d commit 55bf52b

8 files changed

Lines changed: 150 additions & 88 deletions

File tree

.readthedocs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ python:
1717
version: 3.6
1818
install:
1919
- requirements: tools/docs-requirements.txt
20-
- requirements: requirements.txt
2120
- method: pip
2221
path: .
2322
system_packages: true

.travis.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,18 @@ matrix:
1414
env: TOXENV=py36
1515
- python: 3.7
1616
env: TOXENV=py37
17-
- python: 3.6
18-
env: TOXENV=packaging
1917
- python: 3.6
2018
env: TOXENV=docs
2119
- python: 3.6
2220
env: TOXENV=coverage
21+
- python: 3.6
22+
env: TOXENV=coveralls
2323
- python: 3.6
2424
env: TOXENV=flake8
25+
- python: 3.6
26+
env: TOXENV=packaging
27+
- python: 3.6
28+
env: TOXENV=dist
2529

2630
branches:
2731
only:

requirements.txt

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

setup.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,13 @@ def run_tests(self):
5353
INSTALL_REQUIREMENTS = [
5454
# A string or list of strings specifying what other distributions need to
5555
# be installed when this one is.
56+
'requests'
57+
]
58+
59+
SETUP_REQUIREMENTS = [
5660
]
5761

5862
TESTS_REQUIREMENTS = [
59-
'tox'
6063
]
6164

6265
CLASSIFIERS = [
@@ -83,7 +86,7 @@ def run_tests(self):
8386
author_email='stefan.kasberger@univie.ac.at',
8487
name='pyDataverse',
8588
version=find_version('src', 'pyDataverse', '__init__.py'),
86-
description='A Dataverse API wrapper',
89+
description='A wrapper for the Dataverse API',
8790
long_description=read_file('README.md'),
8891
long_description_content_type="text/markdown",
8992
license='MIT',
@@ -94,11 +97,11 @@ def run_tests(self):
9497
install_requires=INSTALL_REQUIREMENTS,
9598
packages=find_packages('src'),
9699
package_dir={'': 'src'},
97-
setup_requires=['pytest-runner'],
100+
setup_requires=SETUP_REQUIREMENTS,
98101
tests_require=TESTS_REQUIREMENTS,
99102
cmdclass={'test': Tox},
100103
include_package_data=True,
101-
keywords=['pydataverse', 'dataverse', 'api'],
104+
keywords=['pyDataverse', 'dataverse', 'api'],
102105
zip_safe=False,
103106
project_urls={
104107
'Documentation': 'https://pydataverse.readthedocs.io/',

src/pyDataverse/docs/source/developer.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,17 @@ Exceptions
3131
Install
3232
-----------------------------
3333

34-
Install from the local git repository:
34+
Install from the local git repository, with all it's dependencies:
3535

3636
.. code-block:: shell
3737
3838
virtualenv venv
3939
source venv/bin/activate
40-
pip install -r requirements.txt
40+
pip install -r tools/tests-requirements.txt
41+
pip install -r tools/lint-requirements.txt
42+
pip install -r tools/docs-requirements.txt
43+
pip install -r tools/packaging-requirements.txt
44+
pip install -e .
4145
4246
4347
Testing
@@ -80,6 +84,8 @@ When you only want to run one test, e.g. the py36 test:
8084
8185
tox -e py36
8286
87+
To find out more about which tests are available, have a look inside the tox.ini file.
88+
8389

8490
Documentation
8591
-----------------------------

src/pyDataverse/docs/source/index.rst

Lines changed: 46 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,24 @@ pyDataverse
33

44
Release v\ |version|.
55

6+
.. image:: https://travis-ci.com/AUSSDA/pyDataverse.svg?branch=master
7+
:target: https://travis-ci.com/AUSSDA/pyDataverse
8+
9+
.. image:: https://img.shields.io/pypi/v/pyDataverse.svg
10+
:target: https://pypi.org/project/pyDataverse/
11+
12+
.. image:: https://img.shields.io/pypi/wheel/pyDataverse.svg
13+
:target: https://pypi.org/project/pyDataverse/
14+
15+
.. image:: https://img.shields.io/pypi/pyversions/pyDataverse.svg
16+
:target: https://pypi.org/project/pyDataverse/
17+
18+
.. image:: https://readthedocs.org/projects/pydataverse/badge/?version=latest
19+
:target: https://pydataverse.readthedocs.io/en/latest
20+
21+
.. image:: https://coveralls.io/repos/github/AUSSDA/pyDataverse/badge.svg
22+
:target: https://coveralls.io/github/AUSSDA/pyDataverse
23+
624
.. image:: https://img.shields.io/github/license/aussda/pydataverse.svg
725
:target: https://opensource.org/licenses/MIT
826

@@ -19,26 +37,34 @@ to create, update and remove Dataverses, Datasets and Datafiles.
1937
Quickstart
2038
-----------------------------
2139

22-
>>> from pyDataverse.api import Api
23-
>>> # establish connection
24-
>>> base_url = 'http://demo.dataverse.org'
25-
>>> api = Api(base_url)
26-
>>> api.status
27-
'OK'
28-
>>> # get dataverse
29-
>>> dv = 'ecastro' # dataverse alias or id
30-
>>> resp = api.get_dataverse(dv)
31-
>>> resp.json()['data']['creationDate']
32-
'2015-04-20T09:29:39Z'
33-
>>> # get dataset
34-
>>> resp = api.get_dataset(identifier)
35-
>>> resp.json()['data']['id']
36-
24
37-
>>> # get datafile
38-
>>> datafile_id = '32' # file id of the datafile
39-
>>> resp = api.get_datafile(datafile_id)
40-
>>> resp
41-
<Response [200]>
40+
**Install**
41+
42+
.. code-block:: shell
43+
44+
pip install pyDataverse
45+
46+
**Usage**
47+
48+
>>> from pyDataverse.api import Api
49+
>>> # establish connection
50+
>>> base_url = 'http://demo.dataverse.org'
51+
>>> api = Api(base_url)
52+
>>> api.status
53+
'OK'
54+
>>> # get dataverse
55+
>>> dv = 'ecastro' # dataverse alias or id
56+
>>> resp = api.get_dataverse(dv)
57+
>>> resp.json()['data']['creationDate']
58+
'2015-04-20T09:29:39Z'
59+
>>> # get dataset
60+
>>> resp = api.get_dataset(identifier)
61+
>>> resp.json()['data']['id']
62+
24
63+
>>> # get datafile
64+
>>> datafile_id = '32' # file id of the datafile
65+
>>> resp = api.get_datafile(datafile_id)
66+
>>> resp
67+
<Response [200]>
4268

4369

4470
Requirements

tools/tests-requirements.txt

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
codecov
2-
coverage
3-
coveralls
4-
check-manifest
5-
future
6-
pycodestyle
7-
pytest>=3.0.0
8-
pytest-cov
9-
pytest-env>=0.6.2
10-
pytest-runner
11-
pytest-xdist
12-
setuptools
13-
tox==3.11.0
14-
wheel
1+
coverage==4.5.3
2+
atomicwrites==1.3.0
3+
attrs==19.1.0
4+
certifi==2019.3.9
5+
chardet==3.0.4
6+
idna==2.8
7+
importlib-metadata==0.15
8+
more-itertools==5.0.0
9+
pluggy==0.12.0
10+
py==1.8.0
11+
pytest==4.5.0
12+
pytest-cov==2.7.1
13+
six==1.12.0
14+
urllib3==1.25.3
15+
wcwidth==0.1.7
16+
zipp==0.5.1

tox.ini

Lines changed: 67 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,102 @@
11
[tox]
2-
envlist = py36,coverage,coveralls,packaging,docs,flake8
2+
envlist = py36,coverage,coveralls,docs,flake8,packaging,dist
33
skip_missing_interpreters = True
44
ignore_basepython_conflict = True
55

66
[testenv]
77
description = default settings for unspecified tests
8-
usedevelop = True
8+
usedevelop = False
9+
skip_install = False
910
passenv = *
1011
basepython = python3.6
11-
deps = -r{toxinidir}/tools/tests-requirements.txt
12+
13+
[testenv:py27]
14+
deps =
15+
-r{toxinidir}/tools/tests-requirements.txt
16+
commands =
17+
pytest tests/ --cov=src/pyDataverse --basetemp={envtmpdir}
18+
19+
[testenv:py34]
20+
deps =
21+
-r{toxinidir}/tools/tests-requirements.txt
22+
commands =
23+
pytest tests/ --cov=src/pyDataverse --basetemp={envtmpdir}
24+
25+
[testenv:py35]
26+
deps =
27+
-r{toxinidir}/tools/tests-requirements.txt
28+
commands =
29+
pytest tests/ --cov=src/pyDataverse --basetemp={envtmpdir}
30+
31+
[testenv:py36]
32+
deps =
33+
-r{toxinidir}/tools/tests-requirements.txt
34+
commands =
35+
pytest tests/ --cov=src/pyDataverse --basetemp={envtmpdir}
36+
37+
[testenv:py37]
38+
deps =
39+
-r{toxinidir}/tools/tests-requirements.txt
1240
commands =
1341
pytest tests/ --cov=src/pyDataverse --basetemp={envtmpdir}
1442

1543
[testenv:coverage]
1644
description = create report for coverage
17-
basepython = python3.6
18-
deps = -r{toxinidir}/tools/tests-requirements.txt
45+
deps =
46+
-r{toxinidir}/tools/tests-requirements.txt
1947
commands =
2048
pytest tests/ --cov=src/pyDataverse --cov-report=term-missing --cov-report=xml --cov-report=html
2149

2250
[testenv:coveralls]
2351
description = create reports for coveralls
24-
basepython = python3.6
25-
deps = -r{toxinidir}/tools/tests-requirements.txt
52+
deps =
53+
-r{toxinidir}/tools/tests-requirements.txt
2654
commands =
2755
pytest tests/ --doctest-modules -v --cov=src/pyDataverse
2856

29-
[testenv:packaging]
30-
description = check packaging with twine
31-
usedevelop = True
32-
basepython = python3.6
33-
skip_install = True
34-
deps = -r{toxinidir}/tools/packaging-requirements.txt
35-
commands =
36-
twine check -h
37-
3857
[flake8]
3958
exclude =
40-
src/pyDataverse/docs/source/conf.py
59+
src/pyDataverse/docs/source/conf.py
60+
.tox
61+
.egg
4162

4263
[testenv:flake8]
4364
description = flake8 for style guide testing
44-
usedevelop = True
45-
basepython = python3.6
46-
deps = -r{toxinidir}/tools/lint-requirements.txt
65+
deps =
66+
-r{toxinidir}/tools/lint-requirements.txt
4767
commands =
4868
flake8 src/pyDataverse/
4969
flake8 tests/
5070
isort --check-only --diff src/pyDataverse
51-
skip_install = true
5271

5372
[testenv:docs]
5473
description = invoke sphinx-build to build the HTML docs
55-
basepython = python3.6
56-
deps = -r{toxinidir}/tools/docs-requirements.txt
74+
deps =
75+
-r{toxinidir}/tools/docs-requirements.txt
5776
commands =
5877
sphinx-build -d src/pyDataverse/docs/build/docs_doctree src/pyDataverse/docs/source docs/build/html --color -b html {posargs}
78+
79+
[testenv:packaging]
80+
description = check packaging with twine
81+
skip_install = True
82+
recreate = True
83+
deps =
84+
-r{toxinidir}/tools/packaging-requirements.txt
85+
commands =
86+
python setup.py sdist bdist_wheel
87+
twine check dist/*
88+
89+
[testenv:dist]
90+
description = install from dist
91+
recreate = True
92+
commands =
93+
pip freeze
94+
python -c "import pyDataverse; print(pyDataverse.__name__); print(pyDataverse.__version__)"
95+
96+
[testenv:pypitest]
97+
description = install from test pypi
98+
skip_install = True
99+
recreate = True
100+
commands =
101+
pip install --index-url https://test.pypi.org/simple/ pyDataverse
102+
pip freeze

0 commit comments

Comments
 (0)