Skip to content

Commit

Permalink
Merge pull request #223 from nbraud/setup.py/dependencies
Browse files Browse the repository at this point in the history
setup.py: Improve dependencies handling
  • Loading branch information
pathunstrom authored Apr 2, 2019
2 parents 5ed92ca + 1dd2b31 commit 1cde076
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 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-tests.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
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pygame
ppb-vector
dataclasses; python_version < "3.7"
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[aliases]
test = pytest
16 changes: 11 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@ def readme():
with open('README.md') as file:
return file.read()

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=[
'pygame',
'ppb-vector',
'dataclasses; python_version < "3.7"'
],
install_requires=requirements(),
setup_requires=['pytest-runner'],
tests_require=requirements('tests'),
python_requires=">=3.6",
url='https://github.com/ppb/pursuedpybear',
license='Artistic-2.0',
Expand Down

0 comments on commit 1cde076

Please sign in to comment.