-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port project to Github Actions and bump dependencies to better support python 3.9 #225
Closed
Closed
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
82a66bb
demo workflow
fpingas 24db823
try pr workflow
fpingas df1a7e7
pin ubuntu 20.04
fpingas f2341e7
scikit-learn fix
fpingas 23f3cd8
remove 3.11
fpingas b444f50
try another coverage syntax
fpingas 4701443
remove 3.10
fpingas d9a10c2
missing -e install
fpingas 2a8a099
try another coverage syntax
fpingas f84bdf9
Another coverage syntax
fpingas 36c5b97
Yet another coverage syntax
fpingas 6deab0b
pin coverage
fpingas ea841c7
remove coverage bot
fpingas 80e7e1f
test fail below coverage
fpingas 88c9766
test wrong test
fpingas 9e90d28
Revert "test wrong test"
fpingas f4b9fd3
Add pip check, type check and linter
fpingas fcd326d
Add type annotation to dict in isolation forest learner
fpingas 02404df
Try implicit optional config for mypy
fpingas 1470a92
more type annotation
fpingas 4a4435a
Change iterable type hint to iterator
fpingas a21bb00
wrap iterator with array
fpingas 120ebc5
add build docs step
fpingas 1c62027
workflow syntax
fpingas 5c647c8
try fix build docs
fpingas bd99f81
test packinging in push; publish workflow; cleanup repo
fpingas 725a8c1
push branch syntax
fpingas a2178bf
run for all branches
fpingas 913a9a8
rollback changes to coveragerc; increment setup classifiers
fpingas c47b653
update coverage threshold
fpingas f131446
Review suggestions
fpingas fb1d8d7
lint
fpingas 1f18eb5
Set version bump
fpingas dbadbec
Add previous changes to changelog
fpingas c1e87e7
change to rc
fpingas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# https://github.com/actions/starter-workflows/blob/main/ci/python-publish.yml | ||
name: Publish Package | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-20.04 | ||
fpingas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install build | ||
- name: Build package | ||
run: python3 -m build | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
name: Test Suite | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
linter: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
- name: | ||
run: | | ||
#!/bin/bash | ||
set -euxo pipefail | ||
python3 -m pip install -q flake8 | ||
python3 -m flake8 \ | ||
--ignore=E731,W503 \ | ||
--filename=*.py \ | ||
--exclude=__init__.py \ | ||
--show-source \ | ||
--statistics \ | ||
--max-line-length=120 \ | ||
src/ tests/ | ||
|
||
test-packaging: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
- name: Build package | ||
run: | | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
python3 -m pip install --upgrade pip | ||
python3 -m pip install build | ||
python3 -m build | ||
|
||
test-suite: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
python-version: ["3.6", "3.7", "3.8", "3.9"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Set up venv | ||
run: | | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
python3 -m venv env | ||
source env/bin/activate | ||
python3 -m pip install --upgrade pip setuptools | ||
|
||
echo "Python path: $(which python3)" | ||
echo "Python version: $(python3 --version)" | ||
echo "pip version: $(python3 -m pip --version)" | ||
- name: Install dependencies | ||
run: | | ||
#!/bin/bash | ||
set -euxo pipefail | ||
source env/bin/activate | ||
|
||
python3 -m pip install -e .[devel] | ||
- name: Pip check | ||
run: | | ||
#!/bin/bash | ||
set -euxo pipefail | ||
source env/bin/activate | ||
|
||
python3 -m pip check | ||
- name: Type check | ||
run: | | ||
#!/bin/bash | ||
set -euxo pipefail | ||
source env/bin/activate | ||
|
||
python3 -m mypy src tests --config mypy.ini | ||
- name: Test with pytest | ||
run: | | ||
#!/bin/bash | ||
set -euxo pipefail | ||
source env/bin/activate | ||
|
||
python3 -m pytest --cov-fail-under=94 --cov=fklearn tests/ | ||
|
||
build-docs: | ||
needs: [linter, test-suite] | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
- name: Set up venv | ||
run: | | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
python3 -m venv env | ||
source env/bin/activate | ||
python3 -m pip install --upgrade pip setuptools | ||
|
||
echo "Python path: $(which python3)" | ||
echo "Python version: $(python3 --version)" | ||
echo "pip version: $(python3 -m pip --version)" | ||
- name: Install dependencies | ||
run: | | ||
#!/bin/bash | ||
set -euxo pipefail | ||
source env/bin/activate | ||
|
||
python3 -m pip install -e .[devel] | ||
python3 -m pip install -r docs/requirements.txt | ||
- name: Generate docs | ||
run: | | ||
#!/bin/bash | ||
set -euxo pipefail | ||
source env/bin/activate | ||
|
||
sudo apt-get install pandoc | ||
cd docs/ && make html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a change in behavior, but seems OK: publish the package in PyPI when there is a published release on GitHub. We can test how this will work with tags and protected branches.