Skip to content

Commit

Permalink
More fixes.
Browse files Browse the repository at this point in the history
- isort and flake8 config
- manifest template update
- tox ini extension
- docs build fixes
- docs content fixes
  • Loading branch information
jezdez committed Oct 18, 2019
1 parent 11df300 commit d5b3613
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 85 deletions.
6 changes: 6 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[settings]
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
line_length=88
34 changes: 11 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,15 @@ cache: pip
dist: xenial
install: travis_retry pip install tox-travis
script: tox
stages:
- test
- name: deploy
if: repo = jazzband/tablib AND tag IS present
jobs:
include:
- stage: test
after_success:
- pip install -U codecov
- codecov
- stage: deploy
install: skip
script: skip
after_success: bash <(curl -s https://codecov.io/bash)
deploy:
provider: pypi
user: jazzband
server: https://jazzband.co/projects/tablib/upload
distributions: sdist bdist_wheel
password:
secure: svV4fYtodwW+iTyFOm5ISEfhVwcA+6vTskD3x6peznc40TdMV9Ek8nT3Q/NB4lCbXoUw2qR4H6uhLCjesnv/VvVk/qbitCyD8ySlgwOV5n7NzJs8lC8EYaHSjGQjatTwJAokfGVYkPawkI7HXDqtDggLUQBK+Ag8HDW+XBSbQIU=
on:
tags: true
repo: jazzband/tablib
python: 3.7
deploy:
provider: pypi
user: jazzband
server: https://jazzband.co/projects/tablib/upload
distributions: sdist bdist_wheel
password:
secure: svV4fYtodwW+iTyFOm5ISEfhVwcA+6vTskD3x6peznc40TdMV9Ek8nT3Q/NB4lCbXoUw2qR4H6uhLCjesnv/VvVk/qbitCyD8ySlgwOV5n7NzJs8lC8EYaHSjGQjatTwJAokfGVYkPawkI7HXDqtDggLUQBK+Ag8HDW+XBSbQIU=
on:
tags: true
repo: jazzband/tablib
14 changes: 0 additions & 14 deletions HACKING

This file was deleted.

7 changes: 6 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
include HISTORY.md README.md LICENSE AUTHORS test_tablib.py
recursive-include docs *
recursive-include tests *
include pytest.ini tox.ini .isort.cfg .coveragerc HISTORY.md README.md LICENSE AUTHORS
prune docs/_build
prune *.pyc
prune __pycache__
6 changes: 0 additions & 6 deletions Makefile

This file was deleted.

4 changes: 2 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Functions
---------


.. autofunction:: detect
.. autofunction:: detect_format

.. autofunction:: import_set

Expand All @@ -61,4 +61,4 @@ Exceptions
You're trying to add something that doesn't quite taste right.


Now, go start some :ref:`Tablib Development <development>`.
Now, go start some :ref:`Tablib Development <development>`.
26 changes: 1 addition & 25 deletions docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,31 +150,7 @@ the easiest way to test your changes for potential issues is to simply run the t

.. code-block:: console
$ ./test_tablib.py
`Jenkins CI`_, amongst other tools, supports Java's xUnit testing report format.
Nose_ allows us to generate our own xUnit reports.

Installing nose is simple.

.. code-block:: console
$ pip install nose
Once installed, we can generate our xUnit report with a single command.

.. code-block:: console
$ nosetests test_tablib.py --with-xunit
This will generate a **nosetests.xml** file, which can then be analyzed.

.. _Nose: https://github.com/nose-devs/nose



.. _jenkins:
$ tox
----------------------
Continuous Integration
Expand Down
5 changes: 1 addition & 4 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ Quickstart
==========


.. module:: tablib


Eager to get started?
This page gives a good introduction in how to get started with Tablib.
This assumes you already have Tablib installed.
Expand Down Expand Up @@ -301,7 +298,7 @@ Now that we have extra meta-data on our rows, we can easily filter our :class:`D
It's that simple. The original :class:`Dataset` is untouched.

Open an Excel Workbook and read first sheet
--------------------------------
-------------------------------------------

To open an Excel 2007 and later workbook with a single sheet (or a workbook with multiple sheets but you just want the first sheet), use the following:

Expand Down
2 changes: 1 addition & 1 deletion src/tablib/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ def get_col(self, index):
# ----

def add_formatter(self, col, handler):
"""Adds a :ref:`formatter` to the :class:`Dataset`.
"""Adds a formatter to the :class:`Dataset`.
.. versionadded:: 0.9.5
:param col: column to. Accepts index int or header str.
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt → tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
pytest
pytest-cov
backports.csv; python_version < '3.0'
MarkupPy
odfpy
Expand Down
4 changes: 0 additions & 4 deletions tests/test_tablib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,3 @@ class DocTests(unittest.TestCase):
def test_rst_formatter_doctests(self):
results = doctest.testmod(tablib.formats._rst)
self.assertEqual(results.failed, 0)


if __name__ == '__main__':
unittest.main()
39 changes: 34 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,40 @@
[tox]
usedevelop = true
minversion = 2.4
envlist = py27, py35, py36, py37
envlist =
py{27,35,36,37,38}-tests,
py37-{docs,lint}

[testenv]
basepython =
py27: python2.7
py35: python3.5
py36: python3.6
py37: python3.7
py38: python3.8
deps =
pytest
pytest-cov
-rrequirements.txt
tests: -rtests/requirements.txt
docs: sphinx
extras = pandas
commands = pytest
commands =
tests: pytest {posargs:tests}
docs: sphinx-build -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html

[testenv:py37-lint]
basepython = python3.7
deps =
flake8
# flake8-black
# flake8-isort
twine
check-manifest
commands =
# flake8 src/tablib tests/
check-manifest -v
python setup.py sdist
twine check dist/*

[flake8]
exclude =
.tox
ignore=E501,E127,E128,E124

0 comments on commit d5b3613

Please sign in to comment.