Skip to content

Commit

Permalink
New ci (#48)
Browse files Browse the repository at this point in the history
Co-authored-by: dmaljovec <daniel.maljovec@recursionpharma.com>
  • Loading branch information
maljovec and dmaljovec committed Nov 22, 2022
1 parent 73ccc95 commit 06a47c5
Show file tree
Hide file tree
Showing 40 changed files with 8,759 additions and 3,753 deletions.
9 changes: 8 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
[paths]
source =
topopy/
/Users/runner/work/topopy/topopy/topopy/
/home/runner/work/topopy/topopy/topopy/
D:\a\topopy\topopy\topopy\

[run]
branch = True
omit =
topopy/tests/*
topopy/topology.py
topopy/topology.py
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
max-line-length = 88
extend-ignore = E203
72 changes: 72 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Release
on:
workflow_run:
workflows: ["Test"]
branches: [main]
types:
- completed
jobs:
push_tag:
name: Push Tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v3
- name: Push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

build_wheels:
needs: push_tag
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macOS-11]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.11.2

- name: Build wheels
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
make
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

publish:
needs: build_wheels
name: Publish Wheels and Source Distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v3
- uses: actions/download-artifact@v3
with:
path: ./wheelhouse
- name: Build source distribution
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
make
python setup.py sdist -d wheelhouse
- run: |
mv artifact/*.whl ./
rm -rf artifact
working-directory: ./wheelhouse
- name: Publish wheels to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: wheelhouse/
18 changes: 18 additions & 0 deletions .github/workflows/quality.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Quality
on: [push]
jobs:
tests:
name: Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: 3.9
- name: update pip
run: |
pip install -U wheel
pip install -U setuptools
python -m pip install -U pip
- run: pip install tox
- run: tox -e style
46 changes: 46 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Test
on: [push]
jobs:
tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
minor_version: [7, 8, 9, 10, 11]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: 3.${{ matrix.minor_version }}
- name: update pip
run: |
pip install -U wheel
pip install -U setuptools
python -m pip install -U pip
- run: pip install tox
- run: make
- run: tox -e py3${{ matrix.minor_version }}
- uses: actions/upload-artifact@v3
with:
name: coverage.${{ matrix.os }}.py3${{ matrix.minor_version }}
path: ./.coverage.py3${{ matrix.minor_version }}
coverage:
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v3
with:
path: .
- run: pip install coverage
- run: |
coverage combine coverage*/
coverage report --fail-under=95
coverage lcov
- name: publish coverage to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coverage.lcov
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ topopy.egg-info/*

.ipynb_checkpoints
docs/_build

.python-version
76 changes: 72 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,74 @@
# https://pre-commit.com/hooks.html

exclude: ^(docs/|.tox)
default_language_version:
python: python3
repos:
- repo: https://github.com/ambv/black
rev: stable
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: black
language_version: python2.7
- id: check-added-large-files # Prevent giant files from being committed
- id: check-ast # Simply check whether the files parse as valid python.
- id: check-byte-order-marker # forbid files which have a UTF-8 byte-order marker
- id: check-builtin-literals # Require literal syntax when initializing empty or zero Python builtin types.
- id: check-case-conflict # Check for files that would conflict in case-insensitive filesystems
- id: check-docstring-first # Checks a common error of defining a docstring after code.
- id: check-executables-have-shebangs # Ensures that (non-binary) executables have a shebang.
- id: check-json # This hook checks json files for parseable syntax.
- id: check-shebang-scripts-are-executable # Ensures that (non-binary) files with a shebang are executable.
- id: pretty-format-json # This hook sets a standard for formatting JSON files.
args: ['--autofix']
- id: check-merge-conflict # Check for files that contain merge conflict strings.
- id: check-symlinks # Checks for symlinks which do not point to anything.
- id: check-toml # This hook checks toml files for parseable syntax.
- id: check-vcs-permalinks # Ensures that links to vcs websites are permalinks.
- id: check-xml # This hook checks xml files for parseable syntax.
- id: check-yaml # This hook checks yaml files for parseable syntax.
- id: debug-statements # Check for debugger imports and py37+ `breakpoint()` calls in python source.
- id: destroyed-symlinks # Detects symlinks which are changed to regular files with a content of a path which that symlink was pointing to.
- id: detect-private-key # Detects the presence of private keys
- id: end-of-file-fixer # Ensures that a file is either empty, or ends with one newline.
- id: fix-byte-order-marker # removes UTF-8 byte order marker
- id: mixed-line-ending # Replaces or checks mixed line ending
- id: sort-simple-yaml # Sorts simple YAML files which consist only of top-level keys, preserving comments and blocks.
- id: trailing-whitespace # This hook trims trailing whitespace.
- repo: local
hooks:
- id: flake8
name: flake8
entry: "flake8 --config ./.flake8"
language: system # will not create a separate virtualenv for the hook and will run it in whatever environment you happen to be in when you run git commit or pre-commit run
types: [python] # trigger for commits changing Python files
require_serial: true # use require_serial so that script is only called once per commit
- id: isort
name: isort
entry: "isort --settings-path=pyproject.toml"
language: system
types: [python]
require_serial: true
- id: black
name: black
entry: "black ."
language: system
types: [python]
require_serial: true
- id: mypy
name: mypy
entry: "mypy --config-file=pyproject.toml"
language: system
types: [python]
require_serial: true
# - id: bandit
# name: bandit
# entry: "bandit -r -c pyproject.toml ."
# language: system
# types: [python]
# require_serial: true
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
hooks:
- id: python-check-blanket-noqa # Enforce that noqa annotations always occur with specific codes. Sample annotations: # noqa: F401, # noqa: F401,W203
# - id: python-check-blanket-type-ignore # Enforce that # type: ignore annotations always occur with specific codes. Sample annotations: # type: ignore[attr-defined], # type: ignore[attr-defined, name-defined]
- id: python-check-mock-methods # Prevent common mistakes of assert mck.not_called(), assert mck.called_once_with(...) and mck.assert_called.
- id: python-use-type-annotations # Enforce that python3.6+ type annotations are used instead of type comments
- id: text-unicode-replacement-char # Forbid files which have a UTF-8 Unicode replacement character
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
[0.0.4]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.3...v0.0.4
[0.0.3]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.2...v0.0.3
[0.0.2]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.1...v0.0.2
[0.0.1]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.0...v0.0.1
[0.0.1]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.0...v0.0.1
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ include *.md
include *.py
include LICENSE
include README.rst
include requirements.txt
1 change: 0 additions & 1 deletion MergeTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,3 @@ std::map< std::pair<int, int>, std::vector<int> > MergeTree<T>::AugmentedEdges()

template class MergeTree<double>;
template class MergeTree<float>;

2 changes: 1 addition & 1 deletion MorseComplex.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,4 @@ class MorseComplex
void ComputeMaximaPersistence();
};

#endif //MC_H
#endif //MC_H
38 changes: 26 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,38 @@ topopy
.. image:: https://img.shields.io/pypi/v/topopy.svg
:target: https://pypi.python.org/pypi/topopy
:alt: PyPI

.. image:: https://travis-ci.org/maljovec/topopy.svg?branch=master
:target: https://travis-ci.org/maljovec/topopy
:alt: Build Status

.. image:: https://coveralls.io/repos/github/maljovec/topopy/badge.svg?branch=master
:target: https://coveralls.io/github/maljovec/topopy?branch=master
:alt: Coverage Status

:alt: Latest Version on PyPI
.. image:: https://img.shields.io/pypi/dm/topopy.svg?label=PyPI%20downloads
:target: https://pypi.org/project/topopy/
:alt: PyPI downloads

.. image:: https://github.com/maljovec/topopy/actions/workflows/quality.yaml/badge.svg?branch=main
:target: https://github.com/maljovec/topopy/actions
:alt: Code Quality Test Results
.. image:: https://github.com/maljovec/topopy/actions/workflows/test.yaml/badge.svg?branch=main
:target: https://github.com/maljovec/topopy/actions
:alt: Test Suite Results

.. image:: https://www.codefactor.io/repository/github/maljovec/topopy/badge
:target: https://www.codefactor.io/repository/github/maljovec/topopy
:alt: CodeFactor
.. image:: https://coveralls.io/repos/github/maljovec/topopy/badge.svg?branch=main
:target: https://coveralls.io/github/maljovec/topopy?branch=main
:alt: Coveralls
.. image:: https://readthedocs.org/projects/topopy/badge/?version=latest
:target: https://topopy.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

:alt: ReadTheDocs
.. image:: https://pyup.io/repos/github/maljovec/topopy/shield.svg
:target: https://pyup.io/repos/github/maljovec/topopy/
:alt: Pyup

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: This code is formatted in black
.. image:: https://img.shields.io/badge/License-BSD_3--Clause-blue.svg
:target: https://opensource.org/licenses/BSD-3-Clause
:alt: BSD 3-Clause License

.. end_badges
.. logo
Expand Down
3 changes: 0 additions & 3 deletions deploy/build.sh

This file was deleted.

31 changes: 0 additions & 31 deletions deploy/test.sh

This file was deleted.

2 changes: 0 additions & 2 deletions deploy/upload.sh

This file was deleted.

0 comments on commit 06a47c5

Please sign in to comment.