Skip to content

Commit

Permalink
Add project release config and use Travis build stages.
Browse files Browse the repository at this point in the history
Refs #378.
  • Loading branch information
jezdez committed Oct 18, 2019
1 parent f3d02aa commit 387c0d9
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 44 deletions.
50 changes: 33 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@
sudo: false
language: python
python:
- 2.7
- 3.6
- 3.7
- 3.8-dev
cache: pip

matrix:
dist: xenial
install: travis_retry pip install tox-travis
script: echo "Running tests against $(python --version) ..."
stages:
- test
- name: deploy
if: repo = jazzband/tablib AND tag IS present
jobs:
include:
- python: 2.7
- python: 3.5
- python: 3.6
- python: 3.7
- python: 3.8-dev

install:
- pip install -r requirements.txt
- pip install -U pytest pytest-cov

script: pytest --cov tablib

after_success:
- pip install -U codecov
- codecov
- stage: test
script: tox
after_success:
- pip install -U codecov
- codecov
- stage: deploy
install: skip
script: skip
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: 2 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,9 @@
sys.exit()


if sys.argv[-1] == 'test':
try:
__import__('py')
except ImportError:
print('py.test required.')
sys.exit(1)

errors = os.system('py.test test_tablib.py')
sys.exit(bool(errors))

packages = [
'tablib', 'tablib.formats',
'tablib',
'tablib.formats',
'tablib.packages',
'tablib.packages.dbfpy',
'tablib.packages.dbfpy3'
Expand Down Expand Up @@ -71,7 +62,6 @@
'Programming Language :: Python :: 3.7',
],
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*',
tests_require=['pytest'],
install_requires=install,
extras_require={
'pandas': ['pandas'],
Expand Down
8 changes: 4 additions & 4 deletions tablib/packages/dbfpy/dbf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
dbf = Dbf(filename, True)
for rec in dbf:
for fldName in dbf.fieldNames:
print '%s:\t %s (%s)' % (fldName, rec[fldName],
type(rec[fldName]))
print
print('%s:\t %s (%s)' % (fldName, rec[fldName],
type(rec[fldName])))
print()
dbf.close()
"""
Expand Down Expand Up @@ -258,7 +258,7 @@ def __setitem__(self, index, record):
def demo_read(filename):
_dbf = Dbf(filename, True)
for _rec in _dbf:
print
print()
print(repr(_rec))
_dbf.close()

Expand Down
12 changes: 6 additions & 6 deletions tablib/packages/dbfpy/dbfnew.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ def write_stream(self, stream):
dbfn.add_field("date", 'D', 8)
dbfn.write("tst.dbf")
# test new dbf
print "*** created tst.dbf: ***"
print("*** created tst.dbf: ***")
dbft = Dbf('tst.dbf', readOnly=0)
print repr(dbft)
print(repr(dbft))
# add a record
rec = DbfRecord(dbft)
rec['name'] = 'something'
Expand All @@ -177,13 +177,13 @@ def write_stream(self, stream):
rec.store()

# show the records
print "*** inserted 2 records into tst.dbf: ***"
print repr(dbft)
print("*** inserted 2 records into tst.dbf: ***")
print(repr(dbft))
for i1 in range(len(dbft)):
rec = dbft[i1]
for fldName in dbft.fieldNames:
print '%s:\t %s' % (fldName, rec[fldName])
print
print('%s:\t %s' % (fldName, rec[fldName]))
print()
dbft.close()

# vim: set et sts=4 sw=4 :
5 changes: 2 additions & 3 deletions tablib/packages/dbfpy3/dbf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@
dbf = Dbf(filename, True)
for rec in dbf:
for fldName in dbf.fieldNames:
print '%s:\t %s (%s)' % (fldName, rec[fldName],
type(rec[fldName]))
print
print('%s:\t %s (%s)' % (fldName, rec[fldName],
type(rec[fldName])))
dbf.close()
"""
Expand Down
7 changes: 5 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ minversion = 2.4
envlist = py27, py35, py36, py37

[testenv]
deps = pytest
deps =
pytest
pytest-cov
-rrequirements.txt
extras = pandas
commands = python setup.py test
commands = pytest --cov tablib

0 comments on commit 387c0d9

Please sign in to comment.