Skip to content
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

Add CI gh-actions and pre-commit hook #181

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

eltonn
Copy link

@eltonn eltonn commented Nov 25, 2020

@eltonn eltonn mentioned this pull request Nov 25, 2020
@eltonn eltonn changed the base branch from master to development November 25, 2020 20:33
Copy link
Member

@xmnlab xmnlab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for working on that. I add some comments here.


on:
push:
branches: [ development ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be [ development, master ]

push:
branches: [ development ]
pull_request:
branches: [ development ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be [ development, master ]

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of actions/setup-python@v2, use conda-incubator/setup-miniconda@v2

ref: https://github.com/Quansight/ibis-vega-transform/blob/master/.github/workflows/test.yml#L22

note 1: check all the parameters.
note2: you need always to specify the shell when you want to activate the conda environment in your step: https://github.com/Quansight/ibis-vega-transform/blob/master/.github/workflows/test.yml#L27

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

install requirements using the conda-incubator configuration: https://github.com/Quansight/ibis-vega-transform/blob/master/.github/workflows/test.yml#L25

- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of call flake8 directly, call pre-commit-hook run --all-files
all the parameters should be used from the configuration files.

max-line-length should be 79 in the configuration file.

@@ -54,7 +55,8 @@ def episem(x, sep='W', out='YW'):
"""
Return Brazilian corresponding epidemiological week from x.

:param x: Input date. Can be a string in the format %Y-%m-%d or datetime.datetime
:param x: Input date. Can be a string in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: maybe in the future, it would be good to use numpy doc style for the docstrings. no change is needed now.

@@ -32,17 +35,17 @@
# version is used.
sys.path.insert(0, project_root)

import fludashboard
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep the import here and add a noqa comment for now.

- conda-forge
- defaults
dependencies:
- flask
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: check if it is the same as https://github.com/conda-forge/fludashboard-feedstock/blob/master/recipe/meta.yaml#L24

if it is not the same, consider to change it here or if your changes is necessary, consider to open a PR to update the feedstock.

environment.yml Outdated
- defaults
dependencies:
- flask
- pandas>=0.21
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add space after the name of the lib, eg: pandas >=0.21

environment.yml Outdated
dependencies:
- flask
- pandas>=0.21
- plotly==2.5.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need to add == here, eg: - plotly 2.5.1

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: run enviroment and lint on fludashborad application
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one word for the name, it could be for example test

- name: Checkout branch
uses: actions/checkout@v2
- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: version 2.0.1 was released

jobs:
build:
runs-on: ubuntu-latest
env:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably you can remove this env

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add CI gh-actions and pre-commit hook
2 participants