Skip to content

Commit

Permalink
Merge pull request #22 from Pylons/travis-setup
Browse files Browse the repository at this point in the history
Travis setup and RTD fixes
  • Loading branch information
stevepiercy committed May 5, 2018
2 parents 0ee9778 + a198fb7 commit 58282d6
Show file tree
Hide file tree
Showing 7 changed files with 127 additions and 43 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ include/
.idea/
distribute-*.tar.gz
env*/
coverage.xml
coverage*.xml
nosetests*.xml
.python-version
37 changes: 37 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Wire up travis
language: python
sudo: false

matrix:
include:
- python: 2.7
env: TOXENV=py27
- python: 3.6
env: TOXENV=py36
- python: 3.6
env: TOXENV=py2-cover,py3-cover,coverage
- python: 3.6
env: TOXENV=docs
- python: 3.6
env: TOXENV=pep8
- python: nightly
env: TOXENV=py37
allow_failures:
- env: TOXENV=py37

install:
- travis_retry pip install tox

script:
- travis_retry tox

cache:
directories:
- $HOME/.cache/pip

notifications:
email:
- pyramid-checkins@lists.repoze.org
irc:
channels:
- "chat.freenode.net#pyramid"
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,4 @@ Contributors

- Chris McDonough, 2013/04/24
- Michael R, 2017/02/20
- Steve Piercy, 2018/05/02
32 changes: 7 additions & 25 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,7 @@

import sys, os

# Add and use Pyramid theme
if 'sphinx-build' in ' '.join(sys.argv): # protect against dumb importers
from subprocess import call, Popen, PIPE

p = Popen('which git', shell=True, stdout=PIPE)
git = p.stdout.read().strip()
cwd = os.getcwd()
_themes = os.path.join(cwd, '_themes')

if not os.path.isdir(_themes):
call([git, 'clone', 'git://github.com/Pylons/pylons_sphinx_theme.git',
'_themes'])
else:
os.chdir(_themes)
call([git, 'checkout', 'master'])
call([git, 'pull'])
os.chdir(cwd)

sys.path.append(os.path.abspath('_themes'))
import pylons_sphinx_themes

# General configuration
# ---------------------
Expand Down Expand Up @@ -106,12 +88,12 @@
# Options for HTML output
# -----------------------

# Add and use Pylons theme
sys.path.append(os.path.abspath('_themes'))
html_theme_path = ['_themes']
# Add and use pylons-sphinx-themes theme
html_theme = 'pyramid'
html_theme_options = dict(github_url='https://github.com/Pylons/pyramid_ldap')

html_theme_path = pylons_sphinx_themes.get_html_themes_path()
html_theme_options = dict(github_url='https://github.com/Pylons/pyramid_ldap',
canonical_url='http://the_root_domain/latest/docs/',
)
# The style sheet to use for HTML and HTML Help pages. A file of that name
# must exist either in Sphinx' static/ path, or in one of the custom paths
# given in html_static_path.
Expand Down Expand Up @@ -199,7 +181,7 @@

# The name of an image file (relative to this directory) to place at the
# top of the title page.
latex_logo = '.static/logo_hi.gif'
# latex_logo = '.static/logo_hi.gif'

# For "manual" documents, if this is true, then toplevel headings are
# parts, not chapters.
Expand Down
1 change: 1 addition & 0 deletions rtd.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-e .[docs]
39 changes: 24 additions & 15 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
from setuptools import setup, find_packages

here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
try:
with open(os.path.join(here, 'README.rst')) as f:
README = f.read()
with open(os.path.join(here, 'CHANGES.txt')) as f:
CHANGES = f.read()
except IOError:
README = CHANGES = ''

requires = [
'pyramid>=1.3a9',
'pyramid>=1.3',
'six',
]
if not 'READTHEDOCS' in os.environ:
if 'READTHEDOCS' not in os.environ:
# hail mary for readthedocs
requires.extend(['ldappool', 'python-ldap'])

Expand All @@ -18,38 +24,41 @@
'pyramid_debugtoolbar',
]
testing_extras = ['nose', 'coverage']
docs_extras = ['Sphinx']
docs_extras = [
'Sphinx >= 1.7.4',
'pylons-sphinx-themes',
]

setup(name='pyramid_ldap',
version='0.2',
description='pyramid_ldap',
long_description=README + '\n\n' + CHANGES,
long_description=README + '\n\n' + CHANGES,
classifiers=[
"Programming Language :: Python",
"Framework :: Pylons",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Topic :: System :: Systems Administration :: Authentication/Directory :: LDAP",
"License :: Repoze Public License",
],
],
author='Chris McDonough',
author_email='pylons-discuss@groups.google.com',
url='http://pylonsproject.org',
url='https://pylonsproject.org',
license="BSD-derived (http://www.repoze.org/LICENSE.txt)",
keywords='web pyramid pylons ldap',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=requires,
tests_require=requires,
extras_require = {
'sampleapp':sampleapp_extras,
'docs':docs_extras,
'testing':testing_extras,
extras_require={
'sampleapp': sampleapp_extras,
'docs': docs_extras,
'testing': testing_extras,
},
test_suite="pyramid_ldap",
entry_points = """\
[paste.app_factory]
sampleapp = sampleapp:main
entry_points="""\
[paste.app_factory]
sampleapp = sampleapp:main
""",
)
56 changes: 54 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
[tox]
envlist =
py27,cover
py27,py36,37,
docs,pep8,
{py2,py3}-cover,coverage

[testenv]
basepython =
py27: python2.7
py36: python3.6
py37: python3.7
py2: python2.7
py3: python3.6

commands =
python setup.py test -q
pip install -q pyramid_ldap[testing]
nosetests --with-xunit --xunit-file=nosetests-{envname}.xml {posargs:}

[testenv:cover]
basepython =
Expand All @@ -15,3 +25,45 @@ deps =
nose
coverage
nosexcover

[testenv:pep8]
basepython = python3.6
commands =
flake8 pyramid_ldap/
deps =
flake8

[testenv:docs]
basepython = python3.6
whitelist_externals = make
commands =
pip install pyramid_ldap[docs]
make -C docs html epub BUILDDIR={envdir} "SPHINXOPTS=-W -E"

[testenv:py2-cover]
commands =
pip install -q pyramid[testing]
coverage run --source=pyramid_ldap {envbindir}/nosetests
coverage xml -o coverage-py2.xml
setenv =
COVERAGE_FILE=.coverage.py2

[testenv:py3-cover]
commands =
pip install -q pyramid[testing]
coverage run --source=pyramid_ldap {envbindir}/nosetests
coverage xml -o coverage-py3.xml
setenv =
COVERAGE_FILE=.coverage.py3

[testenv:coverage]
basepython = python3.6
commands =
coverage erase
coverage combine
coverage xml
coverage report --show-missing --fail-under=100
deps =
coverage
setenv =
COVERAGE_FILE=.coverage

0 comments on commit 58282d6

Please sign in to comment.