Skip to content

Commit b881091

Browse files
smsearcybbc2
authored andcommitted
Moved dotenv package into src directory so that tests run against installed version.
Added tox to run test suite against multiple versions of Python (with coverage) and run flake8. Updated Travis CI to use tox as well. Updated documentation about running tests.
1 parent 569e131 commit b881091

File tree

15 files changed

+101
-25
lines changed

15 files changed

+101
-25
lines changed

.coveragerc

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
[run]
2-
source = dotenv/
3-
omit =
4-
tests/*
5-
venv/*
6-
*conftest*
2+
source = dotenv
3+
4+
[paths]
5+
source =
6+
src/dotenv
7+
.tox/*/lib/python*/site-packages/dotenv
8+
.tox/pypy*/site-packages/dotenv
9+
10+
[report]
11+
show_missing = True

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ htmlcov/
1010
.cache/
1111
.idea
1212
.pytest_cache/
13+
.tox/

.travis.yml

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,45 @@
11
language: python
2+
cache: pip
23
sudo: false
3-
python:
4-
- '2.7'
5-
- '3.4'
6-
- '3.5'
7-
- '3.6'
8-
- pypy
9-
# Enable 3.7 without globally enabling sudo and dist: xenial for other build jobs
4+
dist: xenial
5+
106
matrix:
117
include:
12-
- python: 3.7
13-
dist: xenial
14-
sudo: true
8+
- python: "3.6"
9+
env: TOXENV=lint
10+
- python: "3.6"
11+
env: TOXENV=manifest
12+
13+
- python: "2.7"
14+
env: TOXENV=py27
15+
- python: "3.4"
16+
env: TOXENV=py34
17+
- python: "3.5"
18+
env: TOXENV=py35
19+
- python: "3.6"
20+
env: TOXENV=py36
21+
- python: "3.7"
22+
env: TOXENV=py37
23+
- python: "pypy"
24+
env: TOXENV=pypy
25+
dist: trusty
26+
- python: "pypy3"
27+
env: TOXENV=pypy3
28+
dist: trusty
29+
1530
install:
16-
- pip install python-coveralls
17-
- pip install -q -r requirements.txt
18-
- pip install --editable .
31+
- pip install tox
32+
1933
script:
20-
- flake8 .
21-
- pytest -v --tb=native --cov
34+
- tox
35+
36+
before_install:
37+
- pip install python-coveralls
38+
2239
after_success:
40+
- tox -e coverage-report
2341
- coveralls
42+
2443
deploy:
2544
provider: pypi
2645
user: theskumar

MANIFEST.in

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1-
include LICENSE
2-
include README.rst
1+
include LICENSE *.md *.yml
2+
3+
include tox.ini
4+
recursive-include tests *.py
5+
6+
include .bumpversion.cfg
7+
include .coveragerc
8+
include .editorconfig
9+
include Makefile
310
include requirements.txt

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,15 @@ people](https://github.com/theskumar/python-dotenv/graphs/contributors).
282282

283283
Executing the tests:
284284

285+
$ pip install -r requirements.txt
286+
$ pip install -e .
285287
$ flake8
286288
$ pytest
287289

290+
or with [tox](https://pypi.org/project/tox/) installed:
291+
292+
$ tox
293+
288294
Changelog
289295
=========
290296

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ pypandoc
66
pytest-cov
77
pytest>=3.9
88
sh>=1.09
9+
tox
910
wheel

setup.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ exclude = .tox,.git,docs,venv,.venv
99
description-file = README.rst
1010

1111
[tool:pytest]
12-
norecursedirs = .svn _build tmp* dist venv .git .venv venv
13-
flake8-max-line-length = 120
12+
testpaths = tests

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
long_description = f.read()
1515

1616
meta = {}
17-
with open('./dotenv/version.py') as f:
17+
with open('./src/dotenv/version.py') as f:
1818
exec(f.read(), meta)
1919

2020
setup(
@@ -28,6 +28,7 @@
2828
keywords=['environment variables', 'deployments', 'settings', 'env', 'dotenv',
2929
'configurations', 'python'],
3030
packages=['dotenv'],
31+
package_dir={'': 'src'},
3132
extras_require={
3233
'cli': ['click>=5.0', ],
3334
},
File renamed without changes.

0 commit comments

Comments
 (0)