Skip to content

Commit

Permalink
setup.py: Add test dependencies in external file
Browse files Browse the repository at this point in the history
Closes ppb#222
  • Loading branch information
nbraud committed Apr 1, 2019
1 parent 6bf781e commit 141c112
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ before_install:

install:
- pip install -e .;
- pip install pytest;
- pip install -r requirements-tests.txt;

script:
- pytest
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ environment:

install:
- '%PYTHON%\Scripts\pip install -e .'
- '%PYTHON%\Scripts\pip install pytest'
- '%PYTHON%\Scripts\pip install -r requirements-test.txt'
build: off
test_script:
- '%PYTHON%\Scripts\pytest'
1 change: 1 addition & 0 deletions requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest
10 changes: 8 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@ def readme():
with open('README.md') as file:
return file.read()

def requirements():
with open('requirements.txt') as file:
def requirements(section=None):
if section is None:
filename = "requirements.txt"
else:
filename = f"requirements-{section}.txt"

with open(filename) as file:
return [line.strip() for line in file]

setup(
name='ppb',
version='0.5.0',
packages=['ppb', 'ppb.systems'],
install_requires=requirements(),
tests_require=requirements('tests'),
python_requires=">=3.6",
url='https://github.com/ppb/pursuedpybear',
license='Artistic-2.0',
Expand Down

0 comments on commit 141c112

Please sign in to comment.