Skip to content

Commit 4c2a473

Browse files
authored
Migrate to gh actions (#133)
* Cleanup dependencies and migrate to gh-actions * add mlprimitives extra
1 parent 8446048 commit 4c2a473

File tree

20 files changed

+197
-90
lines changed

20 files changed

+197
-90
lines changed

.github/workflows/docs.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Generate Docs
2+
3+
on:
4+
push:
5+
branches: [ stable ]
6+
7+
jobs:
8+
9+
docs:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Python
15+
uses: actions/setup-python@v1
16+
with:
17+
python-version: 3.8
18+
19+
- name: Build
20+
run: |
21+
sudo apt-get install graphviz pandoc
22+
python -m pip install --upgrade pip
23+
pip install -e .[dev]
24+
make docs
25+
- name: Deploy
26+
uses: peaceiris/actions-gh-pages@v3
27+
with:
28+
github_token: ${{secrets.GITHUB_TOKEN}}
29+
publish_dir: docs/_build/html

.github/workflows/tests.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
branches: [ '*' ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
devel:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
python-version: [3.8]
15+
os: [ubuntu-latest]
16+
steps:
17+
- uses: actions/checkout@v1
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v1
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
- name: Install package
23+
run: pip install .[dev]
24+
- name: make test-devel
25+
run: make test-devel
26+
27+
readme:
28+
runs-on: ${{ matrix.os }}
29+
strategy:
30+
matrix:
31+
python-version: [3.6, 3.7, 3.8]
32+
os: [ubuntu-latest, macos-latest]
33+
steps:
34+
- uses: actions/checkout@v1
35+
- name: Set up Python ${{ matrix.python-version }}
36+
uses: actions/setup-python@v1
37+
with:
38+
python-version: ${{ matrix.python-version }}
39+
- name: Install package and dependencies
40+
run: pip install rundoc .[mlprimitives]
41+
- name: make test-readme
42+
run: make test-readme
43+
44+
unit:
45+
runs-on: ${{ matrix.os }}
46+
strategy:
47+
matrix:
48+
python-version: [3.6, 3.7, 3.8]
49+
os: [ubuntu-latest, macos-latest]
50+
steps:
51+
- uses: actions/checkout@v1
52+
- name: Set up Python ${{ matrix.python-version }}
53+
uses: actions/setup-python@v1
54+
with:
55+
python-version: ${{ matrix.python-version }}
56+
- name: Install package and dependencies
57+
run: pip install .[test]
58+
- name: make test-unit
59+
run: make test-unit
60+
61+
tutorials:
62+
runs-on: ${{ matrix.os }}
63+
strategy:
64+
matrix:
65+
python-version: [3.6, 3.7, 3.8]
66+
os: [ubuntu-latest]
67+
steps:
68+
- uses: actions/checkout@v1
69+
- name: Set up Python ${{ matrix.python-version }}
70+
uses: actions/setup-python@v1
71+
with:
72+
python-version: ${{ matrix.python-version }}
73+
- if: matrix.os == 'ubuntu-latest'
74+
name: Install dependencies - Ubuntu
75+
run: sudo apt-get install graphviz
76+
- name: Install package and dependencies
77+
run: pip install .[examples]
78+
- name: make test-tutorials
79+
run: make test-tutorials

.travis.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

Makefile

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ install-test: clean-build clean-pyc ## install the package and test dependencies
8484
install-develop: clean-build clean-pyc ## install the package in editable mode and dependencies for development
8585
pip install -e .[dev]
8686

87+
MINIMUM := $(shell sed -n '/install_requires = \[/,/]/p' setup.py | grep -v -e '[][]' | sed 's/ *\(.*\),$?$$/\1/g' | tr '>' '=')
88+
89+
.PHONY: install-minimum
90+
install-minimum: ## install the minimum supported versions of the package dependencies
91+
pip install $(MINIMUM)
92+
8793

8894
# LINT TARGETS
8995

@@ -123,7 +129,7 @@ test-readme: ## run the readme snippets
123129
.PHONY: test-tutorials
124130
test-tutorials: ## run the tutorial notebooks
125131
find examples/tutorials -path "*/.ipynb_checkpoints" -prune -false -o -name "*.ipynb" -exec \
126-
jupyter nbconvert --execute --ExecutePreprocessor.timeout=3600 --stdout --to html {} > /dev/null \;
132+
jupyter nbconvert --execute --ExecutePreprocessor.timeout=3600 --stdout --to html {} > /dev/null +
127133

128134
.PHONY: test
129135
test: test-unit test-readme ## test everything that needs test dependencies
@@ -154,11 +160,11 @@ docs: clean-docs ## generate Sphinx HTML documentation, including API docs
154160
$(MAKE) -C docs html
155161

156162
.PHONY: view-docs
157-
view-docs: docs ## view docs in browser
163+
view-docs: ## view the docs in a browser
158164
$(BROWSER) docs/_build/html/index.html
159165

160166
.PHONY: serve-docs
161-
serve-docs: view-docs ## compile the docs watching for changes
167+
serve-docs: ## compile the docs watching for changes
162168
watchmedo shell-command -W -R -D -p '*.rst;*.md' -c '$(MAKE) -C docs html' docs
163169

164170

@@ -170,12 +176,19 @@ dist: clean ## builds source and wheel package
170176
python setup.py bdist_wheel
171177
ls -l dist
172178

173-
.PHONY: test-publish
174-
test-publish: dist ## package and upload a release on TestPyPI
179+
.PHONY: publish-confirm
180+
publish-confirm:
181+
@echo "WARNING: This will irreversibly upload a new version to PyPI!"
182+
@echo -n "Please type 'confirm' to proceed: " \
183+
&& read answer \
184+
&& [ "$${answer}" = "confirm" ]
185+
186+
.PHONY: publish-test
187+
publish-test: dist publish-confirm ## package and upload a release on TestPyPI
175188
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
176189

177190
.PHONY: publish
178-
publish: dist ## package and upload a release
191+
publish: dist publish-confirm ## package and upload a release
179192
twine upload dist/*
180193

181194
.PHONY: bumpversion-release
@@ -204,9 +217,21 @@ bumpversion-minor: ## Bump the version the next minor skipping the release
204217
bumpversion-major: ## Bump the version the next major skipping the release
205218
bumpversion --no-tag major
206219

220+
.PHONY: bumpversion-revert
221+
bumpversion-revert: ## Undo a previous bumpversion-release
222+
git checkout master
223+
git branch -D stable
224+
225+
CLEAN_DIR := $(shell git status --short | grep -v ??)
207226
CURRENT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
208227
CHANGELOG_LINES := $(shell git diff HEAD..origin/stable HISTORY.md 2>&1 | wc -l)
209228

229+
.PHONY: check-clean
230+
check-clean: ## Check if the directory has uncommitted changes
231+
ifneq ($(CLEAN_DIR),)
232+
$(error There are uncommitted changes)
233+
endif
234+
210235
.PHONY: check-master
211236
check-master: ## Check if we are in master branch
212237
ifneq ($(CURRENT_BRANCH),master)
@@ -220,15 +245,21 @@ ifeq ($(CHANGELOG_LINES),0)
220245
endif
221246

222247
.PHONY: check-release
223-
check-release: check-master check-history ## Check if the release can be made
248+
check-release: check-clean check-master check-history ## Check if the release can be made
224249
@echo "A new release can be made"
225250

226251
.PHONY: release
227252
release: check-release bumpversion-release publish bumpversion-patch
228253

254+
.PHONY: release-test
255+
release-test: check-release bumpversion-release-test publish-test bumpversion-revert
256+
229257
.PHONY: release-candidate
230258
release-candidate: check-master publish bumpversion-candidate
231259

260+
.PHONY: release-candidate-test
261+
release-candidate-test: check-clean check-master publish-test
262+
232263
.PHONY: release-minor
233264
release-minor: check-release bumpversion-minor release
234265

README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<p align="left">
2-
<img width=15% src="https://dai.lids.mit.edu/wp-content/uploads/2018/06/Logo_DAI_highres.png" alt=“DAI-Lab” />
3-
<i>An open source project from Data to AI Lab at MIT.</i>
2+
<a href="https://dai.lids.mit.edu">
3+
<img width=15% src="https://dai.lids.mit.edu/wp-content/uploads/2018/06/Logo_DAI_highres.png" alt="DAI-Lab" />
4+
</a>
5+
<i>An Open Source Project from the <a href="https://dai.lids.mit.edu">Data to AI Lab, at MIT</a></i>
46
</p>
57

68
<p align="left">
@@ -13,18 +15,19 @@ Pipelines and Primitives for Machine Learning and Data Science.
1315

1416
[![Development Status](https://img.shields.io/badge/Development%20Status-2%20--%20Pre--Alpha-yellow)](https://pypi.org/search/?c=Development+Status+%3A%3A+2+-+Pre-Alpha)
1517
[![PyPi](https://img.shields.io/pypi/v/mlblocks.svg)](https://pypi.python.org/pypi/mlblocks)
16-
[![Travis](https://travis-ci.com/MLBazaar/MLBlocks.svg?branch=master)](https://travis-ci.com/MLBazaar/MLBlocks)
18+
[![Tests](https://github.com/MLBazaar/MLBlocks/workflows/Run%20Tests/badge.svg)](https://github.com/MLBazaar/MLBlocks/actions?query=workflow%3A%22Run+Tests%22+branch%3Amaster)
1719
[![CodeCov](https://codecov.io/gh/MLBazaar/MLBlocks/branch/master/graph/badge.svg)](https://codecov.io/gh/MLBazaar/MLBlocks)
1820
[![Downloads](https://pepy.tech/badge/mlblocks)](https://pepy.tech/project/mlblocks)
21+
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/MLBazaar/MLBlocks/master?filepath=examples/tutorials)
1922

2023
<br>
2124

2225
# MLBlocks
2326

24-
* Free software: [MIT license](https://github.com/MLBazaar/MLBlocks/blob/master/LICENSE)
25-
* Development Status: [Pre-Alpha](https://pypi.org/search/?c=Development+Status+%3A%3A+2+-+Pre-Alpha)
2627
* Documentation: https://mlbazaar.github.io/MLBlocks
27-
* Homepage: https://github.com/MLBazaar/MLBlocks
28+
* Github: https://github.com/MLBazaar/MLBlocks
29+
* License: [MIT](https://github.com/MLBazaar/MLBlocks/blob/master/LICENSE)
30+
* Development Status: [Pre-Alpha](https://pypi.org/search/?c=Development+Status+%3A%3A+2+-+Pre-Alpha)
2831

2932
## Overview
3033

@@ -49,11 +52,7 @@ Features include:
4952

5053
**MLBlocks** has been developed and tested on [Python 3.6, 3.7 and 3.8](https://www.python.org/downloads/)
5154

52-
Also, although it is not strictly required, the usage of a
53-
[virtualenv](https://virtualenv.pypa.io/en/latest/) is highly recommended in order to avoid
54-
interfering with other software installed in the system where **MLBlocks** is run.
55-
56-
## Install with pip
55+
## Install with `pip`
5756

5857
The easiest and recommended way to install **MLBlocks** is using [pip](
5958
https://pip.pypa.io/en/stable/):

apt.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# apt-get requirements for development and mybinder environment
2+
graphviz
3+
pandoc

docs/api/mlblocks.datasets.rst

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/api/mlblocks.discovery.rst

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ What is MLBlocks?
66
:alt: MLBlocks
77
:align: center
88

9-
* Free software: `MIT license <https://github.com/MLBazaar/MLBlocks/blob/master/LICENSE>`_
109
* Documentation: https://mlbazaar.github.io/MLBlocks
11-
* Homepage: https://github.com/MLBazaar/MLBlocks
10+
* Github: https://github.com/MLBazaar/MLBlocks
11+
* License: `MIT <https://github.com/MLBazaar/MLBlocks/blob/master/LICENSE>`_
1212

1313
MLBlocks is a simple framework for seamlessly combining any possible set of Machine Learning
1414
tools developed in Python, whether they are custom developments or belong to third party

docs/pipeline_examples/graph.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ additional information not found inside `X`.
3030
.. code-block:: python
3131
3232
from mlblocks import MLPipeline
33-
from mlblocks.datasets import load_umls
33+
from mlprimitives.datasets import load_umls
3434
3535
dataset = load_umls()
3636
dataset.describe()

0 commit comments

Comments
 (0)