diff --git a/.travis.yml b/.travis.yml index c95cf670..f2f7ceb4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ before_install: install: - pip install -e .; - - pip install pytest; + - pip install -r requirements-tests.txt; script: - pytest diff --git a/appveyor.yml b/appveyor.yml index 0b3b88fe..8af33a03 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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' diff --git a/requirements-tests.txt b/requirements-tests.txt new file mode 100644 index 00000000..e079f8a6 --- /dev/null +++ b/requirements-tests.txt @@ -0,0 +1 @@ +pytest diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..0424c85e --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +pygame +ppb-vector +dataclasses; python_version < "3.7" diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..31ad82b6 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[aliases] +test = pytest diff --git a/setup.py b/setup.py index 7d3052fb..1c990658 100644 --- a/setup.py +++ b/setup.py @@ -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',