Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
1590bae
WIP github migration
MauroEBordon Oct 13, 2022
0197de4
parcial migration of the first 2 stages
MauroEBordon Oct 14, 2022
71a5b2d
first draft ready for testing with act
MauroEBordon Oct 14, 2022
2d8f1fe
checking if error message is the same as in Act debugger
MauroEBordon Oct 17, 2022
e2bc8d2
add checkout capability and installing pdftotext before faulty setup
MauroEBordon Oct 18, 2022
5be03e4
Ref fix & installing poppler dev library with super user
MauroEBordon Oct 18, 2022
4db3acd
More fixes
MauroEBordon Oct 18, 2022
838a86e
More fixes
MauroEBordon Oct 18, 2022
3630709
advancing version to be able to test the validation stage correctly
MauroEBordon Oct 18, 2022
dfa74ec
fixes
MauroEBordon Oct 18, 2022
c717fb3
sintax error
MauroEBordon Oct 18, 2022
c468371
the script is working locally
MauroEBordon Oct 18, 2022
52c40ce
debbuging
MauroEBordon Oct 18, 2022
6e76dd6
debbuging
MauroEBordon Oct 18, 2022
24629e9
skipping tests
MauroEBordon Oct 18, 2022
e74f4f9
checking all steps
MauroEBordon Oct 18, 2022
f6fea3e
change in failing dependencies
a-rusi Oct 18, 2022
2e726d7
working on testing coverage
MauroEBordon Oct 18, 2022
3cb2108
postgres service fix
MauroEBordon Oct 18, 2022
e345466
postgres service fix
MauroEBordon Oct 18, 2022
e15434c
lint & tests fix
MauroEBordon Oct 18, 2022
4d13f73
syntax fix
MauroEBordon Oct 18, 2022
aedcef5
syntax fix
MauroEBordon Oct 18, 2022
9ac93a2
syntax fix
MauroEBordon Oct 18, 2022
34e9a0f
fixing precommit error while running lint
MauroEBordon Oct 19, 2022
904cf66
testing with old pre-commits configuration
MauroEBordon Oct 20, 2022
c0e84a7
test_db_conn added
MauroEBordon Oct 20, 2022
d540ea3
installing latex
MauroEBordon Oct 20, 2022
905b973
fixing lint
MauroEBordon Oct 20, 2022
79c16ed
checking lint error
MauroEBordon Oct 20, 2022
786b1fe
precommit autoupdate
MauroEBordon Oct 20, 2022
0056791
fix
MauroEBordon Oct 20, 2022
c20d2fb
fix
MauroEBordon Oct 20, 2022
4235279
fix
MauroEBordon Oct 20, 2022
00321a7
changing to self-holsted runners
MauroEBordon Oct 26, 2022
7764206
fix
MauroEBordon Oct 26, 2022
c70bb4d
fix
MauroEBordon Oct 26, 2022
90266a4
fix
MauroEBordon Oct 26, 2022
a553bbf
text
MauroEBordon Oct 26, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 167 additions & 0 deletions .github/workflows/dev.workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
name: Integration workflow - validation & testing

run-name: ${{github.event_name}} by ${{github.actor}}

on:
pull_request:
branches:
- main
- master

env:
PIP_CACHE_DIR: ${{github.workspace}}/.cache/pip
PRE_COMMIT_HOME: ${{github.workspace}}/.cache/pre-commit

jobs:
validate:
runs-on: ubuntu-latest
container: python:3.8.5
env:
TARGET_BRANCH: ${{ github.base_ref }}
HEAD_BRANCH: ${{ github.head_ref }}
steps:
- uses: actions/checkout@v3
- name: New Version Check
run: |
pip install packaging
git fetch origin $HEAD_BRANCH
git fetch origin $TARGET_BRANCH
lib_ver=$(git diff origin/$HEAD_BRANCH origin/$TARGET_BRANCH -- soam/__init__.py | grep __version__ | cut -d = -f 2 | xargs)
python -c "import sys; from packaging import version; exit(not version.parse(sys.argv[1]) > version.parse(sys.argv[2]))" $lib_ver

- name: Check changelog
run: |
git fetch origin $HEAD_BRANCH
git fetch origin $TARGET_BRANCH
added_lines=$(git diff --numstat origin/$TARGET_BRANCH origin/$HEAD_BRANCH -- CHANGELOG.md | awk '{print $1}')
if [ -z $added_lines ] || [ $added_lines -eq 0 ]; then echo "Changelog has not been modified" && exit 1; else echo "Changelog has been modified" && exit 0; fi;


test_stage:
runs-on: ubuntu-latest
needs: validate
container:
image: python:3.8.5
options: --user root
services:
postgres:
image: postgres
env:
POSTGRES_DB: soam_db
POSTGRES_USER: soam_usr
POSTGRES_PASSWORD: soam_pass

options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3

- name: Installing sudo package
run: apt update && apt install sudo

- name: Installing Nox
run: pip install -U nox

- name: Lint
run: |
sudo apt-get install libffi-dev
sudo apt-get install -y texlive-xetex texlive-fonts-recommended libpoppler-cpp-dev libpoppler-dev poppler-utils
pip install --upgrade pre-commit
nox --sessions lint


- name: Tests
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
TEST_DB_CONNSTR: "postgresql://soam_usr:soam_pass@postgres:5432/soam_db"
run: |
pip install pdftotext
nox --sessions tests

- name: DocString Coverage
run: |
pip install interrogate
interrogate soam -c pyproject.toml -vv

- name: Bandit
run: nox --sessions bandit

- name: Pyreverse
run: |
apt-get -qq update
apt-get -qq install -y graphviz
nox --sessions pyreverse

# version_stage:
# runs-on: ubuntu-latest
# container: python:3.8.5
# steps:

# script:
# - echo "TAG=v$(grep __version__ ./soam/__init__.py | cut -d "'" -f 2)" >> variables.env
# artifacts:
# reports:
# dotenv: variables.env
# before_script:
# - ''
# only:
# refs:
# - master

release_stage:
name: Release Stage
runs-on: ubuntu-latest
needs: test_stage
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Adding Github Workflows
draft: false
prerelease: false

# pages:
# stage: deploy_stage
# script:
# - pip install .[dev]
# - cd documentation
# - sphinx-apidoc -f -o source ../soam
# - make html
# - cd ..
# - mv documentation/build/html/ public/
# artifacts:
# paths:
# - public
# only:
# refs:
# - master

# Deploy from master to package registry
# If PYPI_USERNAME/PYPI_PASSWORD are not set, defaults to gitlab
# package registry, thus using the required variables to do so
# The package will be uploaded to PYPI_URL, which can be overrided
# not to upload to gitlab's PYPI
# deploy:
# stage: deploy_stage
# script:
# - pip install twine
# - python setup.py sdist bdist_wheel
# - export TWINE_USERNAME=${PYPI_USERNAME:=gitlab-ci-token}
# - export TWINE_PASSWORD=${PYPI_PASSWORD:=$CI_JOB_TOKEN}
# - export PYPI_REPO=${PYPI_URL:=https://gitlab.com/api/v4/projects/${CI_PROJECT_ID}/packages/pypi}
# - python -m twine upload --verbose --repository-url ${PYPI_REPO} dist/*
# only:
# refs:
# - master
69 changes: 62 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
exclude: templates/.+|notebook/.+
repos:
- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: requirements-txt-fixer
Expand All @@ -13,16 +13,15 @@ repos:
# args: [--max-line-length=88]
# exclude: templates/* notebook/*
- repo: https://github.com/timothycrosley/isort
rev: 4.3.21
rev: 5.10.1
hooks:
- id: isort
name: isort
entry: isort
language: system
types: [python]
exclude: templates/.+|notebook/.+
- repo: https://github.com/psf/black
rev: 19.10b0
rev: 22.10.0
hooks:
- id: black
name: black
Expand All @@ -32,7 +31,7 @@ repos:
args: [--skip-string-normalization]
exclude: templates/.+|notebook/.+
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.761
rev: v0.982
hooks:
- id: mypy
name: mypy
Expand All @@ -42,7 +41,7 @@ repos:
files: \.py$
exclude: templates/.+|notebook/.+
- repo: https://github.com/pre-commit/mirrors-pylint
rev: v2.4.4
rev: v3.0.0a5
hooks:
- id: pylint
name: pylint
Expand All @@ -60,3 +59,59 @@ repos:
types: [file]
files: 'README.md'
require_serial: true

# exclude: templates/.+|notebook/.+
# repos:
# - repo: https://github.com/pre-commit/pre-commit-hooks.git
# rev: v4.3.0
# hooks:
# - id: trailing-whitespace
# - id: requirements-txt-fixer
# - repo: https://github.com/timothycrosley/isort
# rev: 5.10.1
# hooks:
# - id: isort
# name: isort
# entry: isort
# language: system
# types: [python]
# exclude: templates/.+|notebook/.+
# - repo: https://github.com/psf/black
# rev: 22.10.0
# hooks:
# - id: black
# name: black
# entry: black
# language: python
# types: [python]
# args: [--skip-string-normalization]
# exclude: templates/.+|notebook/.+
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v0.982
# hooks:
# - id: mypy
# name: mypy
# entry: mypy
# language: system
# types: [python]
# files: \.py$
# exclude: templates/.+|notebook/.+
# - repo: https://github.com/pre-commit/mirrors-pylint
# rev: v3.0.0a5
# hooks:
# - id: pylint
# name: pylint
# entry: pylint
# language: system
# exclude: templates/.+|notebook/.+
# files: \.py$
# types: [python]
# - repo: https://github.com/MuttData/gfm-diagram
# rev: v0.3.0
# hooks:
# - id: gfmd
# name: gfmd
# entry: gfmd
# types: [file]
# files: 'README.md'
# require_serial: true
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.10.2- 2022-10-18]
- Added Github Workflow

## [0.10.1- 2022-02-14]

### Fixed
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@
'slack': ["slackclient>=2.0.0"],
'orbit': ['orbit-ml==1.0.13'],
'prophet': ["pystan==2.19.1.1", "fbprophet==0.7.1", "holidays>=0.10.2"],
'pdf_report': ["jupytext==1.10.2", "papermill==2.3.2", "nbconvert==5.6",],
'pdf_report': ["jupytext==1.10.2", "papermill==2.3.2", "nbconvert==5.6","ipython_genutils"],
'gsheets_report': ["gspread_pandas", "muttlib[gsheets]>=1.0,<2"],
'statsmodels': ["statsmodels<0.12,>=0.11"],
'protobuf': ["protobuf~=3.2"],
'mlflow': ["mlflow==1.17.0"],
}

Expand Down Expand Up @@ -84,7 +85,7 @@
tests_require=["pytest", "pytest-cov", "pytest-html", "betamax"],
test_suite='test',
install_requires=[
"jinja2",
"Jinja2>=2.11.3,<3.1.0",
"pandas>=1.0.0,<1.3.0",
"Cython<0.29.18,>=0.29",
"sqlalchemy<1.4.0,>=1.3.0",
Expand Down
2 changes: 1 addition & 1 deletion soam/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Version."""

__version__ = '0.10.1'
__version__ = '0.10.2'