Skip to content

Commit

Permalink
[ADD] CI workflow + [UPDATE] setups
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorreia11 committed Nov 25, 2022
1 parent abb441b commit a5eab86
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 24 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Continuous Integration

on:
pull_request:
branches:
- main
- develop

jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
matrix:
os:
- ubuntu-latest
python-version:
- 3.8

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run:
tox -e py
26 changes: 26 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
addopts = "--cov=reactea"
pythonpath = [
".", "src", "tests"
]
testpaths = [
"tests",
]

[tool.mypy]
mypy_path = "src"
check_untyped_defs = true
disallow_any_generics = true
ignore_missing_imports = true
no_implicit_optional = true
show_error_codes = true
strict_equality = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
no_implicit_reexport = true
implicit_reexport = true
5 changes: 5 additions & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
flake8==4.0.1
tox==3.25.0
pytest==7.1.1
pytest-cov==3.0.0
mypy==0.942
27 changes: 3 additions & 24 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,4 @@
from setuptools import setup, find_packages
from setuptools import setup


def readme():
with open('README.md') as f:
return f.read()


setup(
name='reactea',
version='0.0.0',
python_requires='>=3.6',
package_dir={'': 'src'},
packages=find_packages('src'),
include_package_data=True,
zip_safe=False,
author='BiSBII CEB University of Minho',
author_email='[email protected]',
description='...',
license='MIT',
keywords='...',
url='...',
long_description=readme(),
long_description_content_type='text/markdown',
)
if __name__ == "__main__":
setup()
31 changes: 31 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[tox]
minversion = 3.8.0
envlist = py37, py38, flake8, mypy
isolated_build = true
skipsdist = false

[gh-actions]
python =
3.7: py38, mypy, flake8
3.8: py38, mypy, flake8

[testenv]
setenv =
PYTHONPATH = {toxinidir}/src
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/requirements_dev.txt
commands =
pytest --basetemp={envtmpdir}

[testenv:flake8]
basepython = python3
deps = flake8
commands = flake8 src

[testenv:mypy]
basepython = python3
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/requirements_dev.txt
commands = mypy src tests

0 comments on commit a5eab86

Please sign in to comment.