Skip to content

Commit

Permalink
Merge pull request #8 from DataResponsibly/development
Browse files Browse the repository at this point in the history
Release 0.1.0
  • Loading branch information
denysgerasymuk799 authored Feb 5, 2023
2 parents 637e2f6 + cf02f32 commit 4558707
Show file tree
Hide file tree
Showing 167 changed files with 23,666 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/actions/retrieve-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Create Environment
description: Retrieves Python

inputs:
python:
description: 'Python version'

runs:
using: "composite"

steps:
- name: Retrieve the Python environment
uses: actions/cache/restore@v3
id: retrieve-venv
with:
path: ~/.venv
key: ${{ github.run_id }}-venv-${{ runner.os }}-${{ inputs.python }}
restore-keys: |
${{ runner.os }}-${{ inputs.python }}-venv
- name: Retrieve Virny
uses: actions/cache/restore@v3
id: retrieve-virny
with:
path: ${{ github.workspace }}
key: virny-build-${{ github.run_id }}-${{ runner.os }}-${{ inputs.python }}
61 changes: 61 additions & 0 deletions .github/workflows/build-virny.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: build-virny

on:
workflow_call:
inputs:
python:
type: string
os:
type: string

jobs:
build-virny:
runs-on: ${{ inputs.os }}

# # Instead of using two matrices in the calling Workflow, we can use conditionals here
# if: (inputs.os == 'ubuntu-latest' && inputs.python == '3.11') || github.event_name == 'push'

steps:
- uses: actions/checkout@v3

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

- name: Cache the Python environment
uses: actions/cache@v3
id: cache-venv
with:
path: ~/.venv
key: ${{ runner.os }}-${{ inputs.python }}-venv-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ github.run_id }}-venv-${{ runner.os }}-${{ inputs.python }}
${{ runner.os }}-${{ inputs.python }}-venv-
- name: Install Python dependencies
if: ${{ steps.cache-venv.outputs.cache-hit != 'true' }}
run: |
python -m pip install --upgrade pip
python -m venv ~/.venv
source ~/.venv/bin/activate
pip install wheel
pip install scikit-learn sqlalchemy
pip install pytest-xdist[psutil]
pip install numpydoc jupyter
pip install git+https://github.com/denysgerasymuk799/yamp
- name: Build Virny
run: |
source ~/.venv/bin/activate
pip install -e ".[dev,docs]"
# We should delete the git project from the build cache to avoid conflicts
- name: Delete the Git project
run: rm -r .git

- uses: actions/cache/save@v3
id: cache-virny
with:
path: ${{ github.workspace }}
key: virny-build-${{ github.run_id }}-${{ runner.os }}-${{ inputs.python }}
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: ci

on:
pull_request:
branches:
- development
- main

permissions:
contents: write

jobs:
build-virny:
strategy:
fail-fast: false
matrix:
python: [3.8, 3.9]
os: [ubuntu-latest, macos-latest]

uses: ./.github/workflows/build-virny.yml
with:
python: ${{ matrix.python }}
os: ${{ matrix.os }}

unit-tests:
needs: build-virny
strategy:
fail-fast: false
matrix:
python: [3.8, 3.9]
os: [ubuntu-latest, macos-latest]

uses: ./.github/workflows/unit-tests.yml
with:
python: ${{ matrix.python }}
os: ${{ matrix.os }}

branch-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.8
- uses: actions/cache@v2
with:
key: ${{ github.ref }}
path: .cache

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
pip install -e ".[docs]"
- name: Deploy docs
run: mkdocs gh-deploy --force
26 changes: 26 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: unit-tests

on:
workflow_call:
inputs:
python:
type: string
os:
type: string

jobs:
test:
runs-on: ${{ inputs.os }}

steps:
- uses: actions/checkout@v3

- name: Retrieve the environment and the Virny build
uses: ./.github/actions/retrieve-env
with:
python: ${{ inputs.python }}

- name: pytest [Branch]
run: |
source ~/.venv/bin/activate
pytest --durations=10 -n logical # Run pytest on all logical CPU cores
207 changes: 207 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
*_venv
.DS_Store
.ipynb_checkpoints

# Remove big files from GitHub repo
virny/datasets/2018

# Created by https://www.gitignore.io/api/python,pycharm+all
# Edit at https://www.gitignore.io/?templates=python,pycharm+all

### PyCharm+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

doc/build/*
doc/_build/*

.idea

.idea/*.xml
.idea/*.iml

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### PyCharm+all Patch ###
# Ignores the whole .idea folder and all .iml files
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360

../.idea/

# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023

*.iml
modules.xml
.idea/misc.xml
*.ipr

# Sonarlint plugin
.idea/sonarlint

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

venv/
# End of https://www.gitignore.io/api/python,pycharm+all
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
COMMIT_HASH := $(shell eval git rev-parse HEAD)

convert-notebooks:
jupyter nbconvert --to markdown docs/examples/**.ipynb

doc:
yamp virny --out docs/api --verbose
mkdocs build

livedoc: doc
mkdocs serve

develop:
python ./setup.py develop
Loading

0 comments on commit 4558707

Please sign in to comment.