This commit is contained in:
Jason R. Coombs 2018-03-04 22:02:07 -05:00
commit 9e0a04079f
12 changed files with 146 additions and 71 deletions

2
.flake8 Normal file
View File

@ -0,0 +1,2 @@
[flake8]
ignore = W191,W503

0
.gitignore vendored
View File

5
.readthedocs.yml Normal file
View File

@ -0,0 +1,5 @@
python:
version: 3
extra_requirements:
- docs
pip_install: true

View File

@ -1,27 +1,35 @@
dist: trusty
sudo: false sudo: false
language: python language: python
python: python:
- 2.7 - 2.7
- 3.4 - &latest_py3 3.6
- 3.5
- pypy - pypy
matrix:
allow_failures: jobs:
- python: pypy fast_finish: true
script: include:
- pip install -U pytest - stage: deploy
- python setup.py test if: tag IS present
branches: python: *latest_py3
except: install: skip
- skeleton script: skip
deploy: deploy:
provider: pypi provider: pypi
server: https://upload.pypi.org/legacy/ on:
on: tags: true
tags: true all_branches: true
all_branches: true user: jaraco
python: 3.5 password:
user: jaraco secure: 2JIGwS5V4TRi8+T1PzH9hardS+woul2s0y0a7l0KyLxta8ThUihZjLqqDvniX3aOPKoYRx+wrg73Qs+t1ISkjGENsmuIqkdtG++EvfN6Goopv7qePZlm41plsGZBS/EDT6woLNy1Mk6uRAmp7UrVqgXPkyPTJPOh+C8SdZ/AvbqlXOpTNfOJaUGJb3GbCQy1nX8SbFAteVRVe1sWGuNS0MRyDb6DOOwhRmGUHwVMNyvLoNZ3QGsTViju7CJUmie+XjKgKiPDbF+OCBHR+VAbY6vZiWC2I0rV6CmKoXfgaaF0BGZLq4iOw7LUNTIVInRSuyQd+bkoUNP2/aU84mFD9bAHcp5uGJ7xy4ahh8ieTkvKk0kudrmu+mtUPZ/fW6Zu51sDjrfdsNLlUZ7tHc1CsIJnjYYU/SasuQ1BT6s4NpsQ7/gNFAdO6JOfSLmTM3arOJIAeDPYEBW8yCEVaxK4EnYl0vE6kuFRq2ey8eyqkwr8Kahn13qUwaOiSmecIWgI/pZ1ettfoVdEh/aL4qONOFD6trfpeqjKFUugLyNmh+PvAfNTjxL+pe309Y8Uw2yaouDLZNI1jUDlNrV9025LJMwNGXs3ViVTTdmTfJza0+SVOfJ77ttLvQxdDvQd9jfYFmDpeeKtReJrFiTt00xSksJd4kbi6iarzRblUplemmA=
distributions: dists distributions: dists
password: skip_cleanup: true
secure: 2JIGwS5V4TRi8+T1PzH9hardS+woul2s0y0a7l0KyLxta8ThUihZjLqqDvniX3aOPKoYRx+wrg73Qs+t1ISkjGENsmuIqkdtG++EvfN6Goopv7qePZlm41plsGZBS/EDT6woLNy1Mk6uRAmp7UrVqgXPkyPTJPOh+C8SdZ/AvbqlXOpTNfOJaUGJb3GbCQy1nX8SbFAteVRVe1sWGuNS0MRyDb6DOOwhRmGUHwVMNyvLoNZ3QGsTViju7CJUmie+XjKgKiPDbF+OCBHR+VAbY6vZiWC2I0rV6CmKoXfgaaF0BGZLq4iOw7LUNTIVInRSuyQd+bkoUNP2/aU84mFD9bAHcp5uGJ7xy4ahh8ieTkvKk0kudrmu+mtUPZ/fW6Zu51sDjrfdsNLlUZ7tHc1CsIJnjYYU/SasuQ1BT6s4NpsQ7/gNFAdO6JOfSLmTM3arOJIAeDPYEBW8yCEVaxK4EnYl0vE6kuFRq2ey8eyqkwr8Kahn13qUwaOiSmecIWgI/pZ1ettfoVdEh/aL4qONOFD6trfpeqjKFUugLyNmh+PvAfNTjxL+pe309Y8Uw2yaouDLZNI1jUDlNrV9025LJMwNGXs3ViVTTdmTfJza0+SVOfJ77ttLvQxdDvQd9jfYFmDpeeKtReJrFiTt00xSksJd4kbi6iarzRblUplemmA= skip_upload_docs: true
cache: pip
install:
- pip install tox tox-venv
script: tox

7
LICENSE Normal file
View File

@ -0,0 +1,7 @@
Copyright Jason R. Coombs
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -3,14 +3,14 @@
.. image:: https://img.shields.io/pypi/pyversions/wolframalpha.svg .. image:: https://img.shields.io/pypi/pyversions/wolframalpha.svg
.. image:: https://img.shields.io/pypi/dm/wolframalpha.svg
.. image:: https://img.shields.io/travis/jaraco/wolframalpha/master.svg .. image:: https://img.shields.io/travis/jaraco/wolframalpha/master.svg
:target: http://travis-ci.org/jaraco/wolframalpha :target: https://travis-ci.org/jaraco/wolframalpha
.. image:: https://readthedocs.org/projects/wolframalpha/badge/?version=latest
:target: https://wolframalpha.readthedocs.io/en/latest/?badge=latest
Python Client built against the `Wolfram|Alpha <http://wolframalpha.com>`_ Python Client built against the `Wolfram|Alpha <http://wolframalpha.com>`_
v2.0 API. This project is hosted on `Github v2.0 API.
<https://github.com/jaraco/wolframalpha>`_.
Usage Usage
===== =====

24
appveyor.yml Normal file
View File

@ -0,0 +1,24 @@
environment:
APPVEYOR: true
matrix:
- PYTHON: "C:\\Python36-x64"
- PYTHON: "C:\\Python27-x64"
install:
# symlink python from a directory with a space
- "mklink /d \"C:\\Program Files\\Python\" %PYTHON%"
- "SET PYTHON=\"C:\\Program Files\\Python\""
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
build: off
cache:
- '%LOCALAPPDATA%\pip\Cache'
test_script:
- "python -m pip install tox tox-venv"
- "tox"
version: '{build}'

View File

@ -1,38 +1,31 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import setuptools_scm
extensions = [ extensions = [
'sphinx.ext.autodoc', 'sphinx.ext.autodoc',
'rst.linker', 'jaraco.packaging.sphinx',
'rst.linker',
] ]
# General information about the project.
project = 'wolframalpha'
copyright = '2016 Jason R. Coombs'
# The short X.Y version.
version = setuptools_scm.get_version(root='..', relative_to=__file__)
# The full version, including alpha/beta/rc tags.
release = version
master_doc = 'index' master_doc = 'index'
link_files = { link_files = {
'CHANGES.rst': dict( '../CHANGES.rst': dict(
using=dict( using=dict(
GH='https://github.com', GH='https://github.com',
project=project,
), ),
replace=[ replace=[
dict( dict(
pattern=r"(Issue )?#(?P<issue>\d+)", pattern=r'(Issue )?#(?P<issue>\d+)',
url='{GH}/jaraco/{project}/issues/{issue}', url='{package_url}/issues/{issue}',
), ),
dict( dict(
pattern=r"^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n", pattern=r'^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n',
with_scm="{text}\n{rev[timestamp]:%d %b %Y}\n", with_scm='{text}\n{rev[timestamp]:%d %b %Y}\n',
),
dict(
pattern=r'PEP[- ](?P<pep_number>\d+)',
url='https://www.python.org/dev/peps/pep-{pep_number:0>4}/',
), ),
], ],
), ),

View File

@ -1,4 +1,4 @@
[pytest] [pytest]
norecursedirs=*.egg .eggs dist build norecursedirs=dist build .tox .eggs
addopts=--doctest-modules addopts=--doctest-modules --flake8
doctest_optionflags=ALLOW_UNICODE ELLIPSIS doctest_optionflags=ALLOW_UNICODE ELLIPSIS

View File

@ -1,10 +1,9 @@
[aliases] [aliases]
release = dists build_sphinx upload upload_docs release = dists upload
dists = clean --all sdist bdist_wheel dists = clean --all sdist bdist_wheel
test = pytest
[wheel] [bdist_wheel]
universal = 1 universal = 1
[upload] [metadata]
repository = https://upload.pypi.org/legacy/ license_file = LICENSE

View File

@ -3,24 +3,21 @@
# Project skeleton maintained at https://github.com/jaraco/skeleton # Project skeleton maintained at https://github.com/jaraco/skeleton
import io import io
import sys
import setuptools import setuptools
with io.open('README.rst', encoding='utf-8') as readme: with io.open('README.rst', encoding='utf-8') as readme:
long_description = readme.read() long_description = readme.read()
needs_pytest = {'pytest', 'test'}.intersection(sys.argv)
pytest_runner = ['pytest_runner'] if needs_pytest else []
needs_sphinx = {'release', 'build_sphinx', 'upload_docs'}.intersection(sys.argv)
sphinx = ['sphinx', 'rst.linker'] if needs_sphinx else []
needs_wheel = {'release', 'bdist_wheel'}.intersection(sys.argv)
wheel = ['wheel'] if needs_wheel else []
name = 'wolframalpha' name = 'wolframalpha'
description = 'Wolfram|Alpha 2.0 API client' description = 'Wolfram|Alpha 2.0 API client'
nspkg_technique = 'native'
"""
Does this package use "native" namespace packages or
pkg_resources "managed" namespace packages?
"""
setup_params = dict( params = dict(
name=name, name=name,
use_scm_version=True, use_scm_version=True,
author="Jason R. Coombs", author="Jason R. Coombs",
@ -30,20 +27,38 @@ setup_params = dict(
url="https://github.com/jaraco/" + name, url="https://github.com/jaraco/" + name,
packages=setuptools.find_packages(), packages=setuptools.find_packages(),
include_package_data=True, include_package_data=True,
namespace_packages=name.split('.')[:-1], namespace_packages=(
name.split('.')[:-1] if nspkg_technique == 'managed'
else []
),
python_requires='>=2.7',
install_requires=[ install_requires=[
'six', 'six',
'xmltodict', 'xmltodict',
'jaraco.itertools>=2.0', 'jaraco.itertools>=2.0',
], ],
extras_require={ extras_require={
'testing': [
# upstream
'pytest>=2.8',
'pytest-sugar>=0.9.1',
'collective.checkdocs',
'pytest-flake8',
# local
'pmxbot',
],
'docs': [
# upstream
'sphinx',
'jaraco.packaging>=3.2',
'rst.linker>=1.9',
# local
],
}, },
setup_requires=[ setup_requires=[
'setuptools_scm>=1.9', 'setuptools_scm>=1.15.0',
] + pytest_runner + sphinx + wheel,
tests_require=[
'pytest>=2.8',
'pmxbot',
], ],
classifiers=[ classifiers=[
"Development Status :: 5 - Production/Stable", "Development Status :: 5 - Production/Stable",
@ -54,9 +69,9 @@ setup_params = dict(
], ],
entry_points={ entry_points={
'pmxbot_handlers': [ 'pmxbot_handlers': [
'Wolfram|Alpha = wolframalpha.pmxbot', 'Wolfram|Alpha = wolframalpha.pmxbot',
], ],
}, },
) )
if __name__ == '__main__': if __name__ == '__main__':
setuptools.setup(**setup_params) setuptools.setup(**params)

22
tox.ini Normal file
View File

@ -0,0 +1,22 @@
[tox]
envlist = python
minversion = 2.4
[testenv]
deps =
setuptools>=31.0.1
# workaround for yaml/pyyaml#126
git+https://github.com/yaml/pyyaml@master#egg=pyyaml
commands =
py.test {posargs}
python setup.py checkdocs
usedevelop = True
extras = testing
[testenv:build-docs]
extras =
docs
testing
changedir = docs
commands =
python -m sphinx . {toxinidir}/build/html