Skip to content

Commit fdbfc4b

Browse files
Add pip check to workflows (#40)
* Remove docs and rename pytest to integration * Update workflows * Update codeowners tox and tasks * Update Makefile * Add unit tests * Add unit tests * Address comments * add task tag
1 parent 480b5df commit fdbfc4b

29 files changed

+181
-497
lines changed

.github/CODEOWNERS

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Global rule:
2+
* @sdv-dev/core-contributors

.github/workflows/docs.yml

-30
This file was deleted.

.github/workflows/integration.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Integration Tests
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
unit:
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
python-version: [3.6, 3.7, 3.8]
13+
os: [ubuntu-latest, macos-10.15, windows-latest]
14+
steps:
15+
- uses: actions/checkout@v1
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- if: matrix.os == 'windows-latest'
21+
name: Install dependencies - Windows
22+
run: |
23+
python -m pip install --upgrade pip
24+
python -m pip install 'torch>=1.4,<2' -f https://download.pytorch.org/whl/cpu/torch/
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
python -m pip install invoke .[test]
29+
- name: Run integration tests
30+
run: invoke integration

.github/workflows/lint.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Style Checks
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v1
12+
- name: Set up Python 3.8
13+
uses: actions/setup-python@v1
14+
with:
15+
python-version: 3.8
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
python -m pip install invoke .[dev]
20+
- name: Run lint checks
21+
run: invoke lint

.github/workflows/minimum.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Unit Tests Minimum Versions
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
minimum:
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
python-version: [3.6, 3.7, 3.8]
13+
os: [ubuntu-latest, macos-10.15, windows-latest]
14+
steps:
15+
- uses: actions/checkout@v1
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- if: matrix.os == 'windows-latest'
21+
name: Install dependencies - Windows
22+
run: |
23+
python -m pip install --upgrade pip
24+
python -m pip install 'torch==1.4' -f https://download.pytorch.org/whl/cpu/torch/
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
python -m pip install invoke .[test]
29+
- name: Test with minimum versions
30+
run: invoke minimum

.github/workflows/readme.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Test README
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
readme:
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
python-version: [3.6, 3.7, 3.8]
13+
os: [ubuntu-latest, macos-10.15] # skip windows bc rundoc fails
14+
steps:
15+
- uses: actions/checkout@v1
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
python -m pip install invoke rundoc .
24+
- name: Run the README.md
25+
run: invoke readme

.github/workflows/tests.yml

-113
This file was deleted.

.github/workflows/unit.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Unit Tests
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
unit:
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
python-version: [3.6, 3.7, 3.8]
13+
os: [ubuntu-latest, macos-10.15, windows-latest]
14+
steps:
15+
- uses: actions/checkout@v1
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- if: matrix.os == 'windows-latest'
21+
name: Install dependencies - Windows
22+
run: |
23+
python -m pip install --upgrade pip
24+
python -m pip install 'torch>=1.4,<2' -f https://download.pytorch.org/whl/cpu/torch/
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
python -m pip install invoke .[test]
29+
- name: Run unit tests
30+
run: invoke unit
31+
- if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.8
32+
name: Upload codecov report
33+
run: invoke coverage
34+
uses: codecov/codecov-action@v2

Makefile

+10-29
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@ clean-pyc: ## remove Python file artifacts
4747
find . -name '*~' -exec rm -f {} +
4848
find . -name '__pycache__' -exec rm -fr {} +
4949

50-
.PHONY: clean-docs
51-
clean-docs: ## remove previously built docs
52-
rm -f docs/api/*.rst
53-
rm -rf docs/tutorials
54-
-$(MAKE) -C docs clean 2>/dev/null # this fails if sphinx is not yet installed
55-
5650
.PHONY: clean-coverage
5751
clean-coverage: ## remove coverage artifacts
5852
rm -f .coverage
@@ -65,7 +59,7 @@ clean-test: ## remove test artifacts
6559
rm -fr .pytest_cache
6660

6761
.PHONY: clean
68-
clean: clean-build clean-pyc clean-test clean-coverage clean-docs ## remove all build, test, coverage, docs and Python artifacts
62+
clean: clean-build clean-pyc clean-test clean-coverage ## remove all build, test, coverage and Python artifacts
6963

7064

7165
# INSTALL TARGETS
@@ -109,9 +103,13 @@ fix-lint: ## fix lint issues using autoflake, autopep8, and isort
109103

110104
# TEST TARGETS
111105

112-
.PHONY: test-pytest
113-
test-pytest: ## run all the tests using pytest
114-
invoke pytest
106+
.PHONY: test-unit
107+
test-unit: ## run unit tests using pytest
108+
invoke unit
109+
110+
.PHONY: test-integration
111+
test-integration: ## run integration tests using pytest
112+
invoke integration
115113

116114
.PHONY: test-readme
117115
test-readme: ## run the readme snippets
@@ -126,10 +124,10 @@ check-dependencies: ## test if there are any broken dependencies
126124
pip check
127125

128126
.PHONY: test
129-
test: test-pytest test-readme test-tutorials ## test everything that needs test dependencies
127+
test: test-unit test-integration test-readme test-tutorials ## test everything that needs test dependencies
130128

131129
.PHONY: test-devel
132-
test-devel: lint docs ## test everything that needs development dependencies
130+
test-devel: lint ## test everything that needs development dependencies
133131

134132
.PHONY: test-all
135133
test-all: ## run tests on every Python version with tox
@@ -143,23 +141,6 @@ coverage: ## check code coverage quickly with the default Python
143141
$(BROWSER) htmlcov/index.html
144142

145143

146-
# DOCS TARGETS
147-
148-
.PHONY: docs
149-
docs: clean-docs ## generate Sphinx HTML documentation, including API docs
150-
cp -r tutorials docs/tutorials
151-
sphinx-apidoc --separate --no-toc -M -o docs/api/ deepecho
152-
$(MAKE) -C docs html
153-
154-
.PHONY: view-docs
155-
view-docs: docs ## view docs in browser
156-
$(BROWSER) docs/_build/html/index.html
157-
158-
.PHONY: serve-docs
159-
serve-docs: view-docs ## compile the docs watching for changes
160-
watchmedo shell-command -W -R -D -p '*.rst;*.md' -c '$(MAKE) -C docs html' .
161-
162-
163144
# RELEASE TARGETS
164145

165146
.PHONY: dist

docs/Makefile

-20
This file was deleted.

docs/authors.rst

-1
This file was deleted.

0 commit comments

Comments
 (0)