Skip to content

Commit

Permalink
Merge 6fb4504 into 8055e82
Browse files Browse the repository at this point in the history
  • Loading branch information
wumpus committed Nov 28, 2020
2 parents 8055e82 + 6fb4504 commit bc5191e
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ test_coverage: clean_coverage
(cd tests; PYTHONPATH=.. COVERAGE='coverage run -a --source ../scripts,olypy' ./test.sh)
# (cd sim; coverage run -a --source=..,. ./run-tests.py test-inputs/nothing.yml)
touch sim/.coverage
coverage combine .coverage tests/.coverage sim/.coverage
coverage combine -a tests/.coverage sim/.coverage
coverage report

missing:
Expand Down
88 changes: 88 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
trigger:
- master

jobs:
- job: linux
timeoutInMinutes: 10 # does not cause a failure, unfortunately
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
Python35:
python.version: '3.5'
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
Python38:
python.version: '3.8'
Python39:
python.version: '3.9'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
displayName: 'Use Python $(python.version)'

- script: |
python -m pip install --upgrade pip
pip install . .[test]
displayName: 'Install dependencies'
- script: |
set -e
if [ ! -z "$(myenv)" ]; then
export $(myenv)
fi
make test_coverage
displayName: 'pytest'
- script: |
pip install coveralls
export CIRCLE_BRANCH=$BUILD_SOURCEBRANCH
coveralls
displayName: 'coveralls'
env:
CIRCLECI: 1
CIRCLE_BUILD_NUM: $(Build.BuildNumber)
COVERALLS_REPO_TOKEN: $(coveralls_repo_token)
- job: macos
timeoutInMinutes: 10 # does not cause a failure, unfortunately
pool:
vmImage: 'macOS-latest'
strategy:
matrix:
Python38:
python.version: '3.8'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
displayName: 'Use Python $(python.version)'

- script: |
python -m pip install --upgrade pip
pip install . .[test]
displayName: 'Install dependencies'
- script: |
set -e
if [ ! -z "$(myenv)" ]; then
export $(myenv)
fi
make test_coverage
coverage report
displayName: 'pytest'
- script: |
pip install coveralls
export CIRCLE_BRANCH=$BUILD_SOURCEBRANCH
coveralls
displayName: 'coveralls'
env:
CIRCLECI: 1
CIRCLE_BUILD_NUM: $(Build.BuildNumber)
COVERALLS_REPO_TOKEN: $(coveralls_repo_token)
38 changes: 12 additions & 26 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,25 @@
#!/usr/bin/env python

import sys
from os import path

from setuptools import setup
from setuptools.command.test import test as TestCommand


class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass into py.test")]

def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []

def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True

def run_tests(self):
import pytest

errno = pytest.main(self.pytest_args)
sys.exit(errno)


packages = [
'olypy',
'olymap',
]

requires = ['PyYAML', 'pngcanvas']
test_requirements = ['pytest>=3.0.0', 'coverage', 'pytest-cov']
requires = [
'PyYAML',
'pngcanvas',
'Jinja2',
]

test_requirements = ['pytest>=3.0.0', 'pytest-cov']

extras_require = {
'test': test_requirements, # setup no longer tests, so make them an extra
}

scripts = ['scripts/box-to-json',
'scripts/build-player-lib',
Expand Down Expand Up @@ -60,6 +47,7 @@ def run_tests(self):
url='https://github.com/olympiag3/olypy',
packages=packages,
python_requires=">=3.5.*",
extras_require=extras_require,
include_package_data=True,
setup_requires=['setuptools_scm'],
install_requires=requires,
Expand All @@ -81,6 +69,4 @@ def run_tests(self):
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3 :: Only',
],
cmdclass={'test': PyTest},
tests_require=test_requirements,
)

0 comments on commit bc5191e

Please sign in to comment.