forked from puntonim/inspire-service-orcid
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
25 lines (24 loc) · 3.12 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from setuptools import setup
setup(**{'author': 'puntonim',
'author_email': 'foo@gmail.com',
'classifiers': ['Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Topic :: Internet :: WWW/HTTP'],
'description': 'ORCID service client',
'include_package_data': True,
'install_requires': ['pkgsettings<1.0.0,>=0.12.0',
'orcid<2,>=1.0.3'],
'long_description': "[![Build Status](https://travis-ci.org/puntonim/inspire-service-orcid.svg?branch=master)](https://travis-ci.org/puntonim/inspire-service-orcid)\n\n# Inspire ORCID service client\n\nThis package is service client for ORCID API used in inspire-next.\n\n## Client usage\n\n```python\n# Configure settings.\nimport inspire_service_orcid.conf\nd = dict(\n DO_USE_SANDBOX=False,\n CONSUMER_KEY='myorcidappkey',\n CONSUMER_SECRET='myorcidappsecret',\n REQUEST_TIMEOUT=30,\n)\ninspire_service_orcid.conf.settings.configure(**d)\n\n# Use the client.\nfrom inspire_service_orcid.client import OrcidClient\nclient = OrcidClient('mytoken', '0000-0002-0942-3697')\nresponse = client.get_all_works_summary()\nresponse.raise_for_result()\nputcode = response['group'][0]['work-summary'][0]['put-code']\n```\n\nIn order to use time_execution to collect metrics, configure it first:\n```python\nimport time_execution\nfrom inspire_service_orcid import hooks\n\nhooks = [\n hooks.status_code_hook,\n hooks.orcid_error_code_hook,\n hooks.orcid_service_exception_hook,\n]\ntime_execution.settings.configure(\n backends=[mybackend],\n hooks=hooks,\n origin='inspire_next'\n)\n```\n\n## Development\n\n```bash\n# Create a venv and install the requirements:\n$ make venv\n\n# Run isort and lint:\n$ make isort\n$ make lint\n\n# Run all the tests:\n$ make test # tox against Python27 and Python36.\n$ tox -e py27 # tox against a specific Python version.\n$ pytest # pytest against the active venv.\n\n# Run a specific test:\n$ make test/tests/test_client.py # tox against Python27 and Python36.\n$ tox -e py27 -- tests/test_client.py # tox against a specific Python version.\n$ pytest tests/test_client.py # pytest against the active venv.\n```\n\nTo publish on PyPi, first set the PyPi credentials:\n\n```bash\n# Edit .pypirc:\n$ cat $HOME/.pypirc\n[pypi]\nusername: myuser\npassword: mypass\n```\n\n```bash\n# Tag the new version:\n$ git tag 1.1.1\n# Then generate setup.py and publish:\n$ make setup.py\n$ make publish\n# Commit the setup.py file:\n$ git add .\n$ git commit -m '1.1.1 released'\n$ git push origin master --tags\n```\n",
'name': 'inspire-service-orcid',
'packages': ['inspire_service_orcid'],
'tests_require': ['tox'],
'url': 'https://github.com/puntonim/inspire-service-orcid',
'version': u'9.0.0',
'zip_safe': False})