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

Feat/use black lint #716

Merged
merged 20 commits into from
Aug 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 14 additions & 0 deletions .github/workflows/black_linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Black linter and code formatter
on: [pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.7'
- uses: psf/black@stable
with:
options: "--check --verbose"
version: "21.7b0"
11 changes: 7 additions & 4 deletions .github/workflows/pytest_and_coveralls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ jobs:
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
python-version: [3.6]
steps:
# Checkout BALSAMIC
- name: Git checkout
Expand All @@ -33,15 +31,20 @@ jobs:
with:
activate-environment: balsamic
environment-file: BALSAMIC/conda/balsamic.yaml
python-version: ${{ matrix.python-version }}
# Install BALSAMIC
- name: Install BALSAMIC
id: install_balsamic
shell: bash -l {0}
run: |
conda activate balsamic
pip install --no-cache-dir .
# Install pytest coveralls dependencies
- name: Install PyTest and Coveralls
id: install_pytest
shell: bash -l {0}
run: |
conda activate balsamic
pip install --no-cache-dir -r requirements-dev.txt
pip install .
# Run PyTest
- name: Run PyTest
id: pytest
Expand Down
240 changes: 0 additions & 240 deletions .style.yapf

This file was deleted.

2 changes: 1 addition & 1 deletion BALSAMIC/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '7.2.6'
__version__ = "7.2.6"
2 changes: 1 addition & 1 deletion BALSAMIC/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '7.2.6'
__version__ = "7.2.6"
4 changes: 2 additions & 2 deletions BALSAMIC/assets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

##### FILES #####

cg_logo = 'assets/cg.png'
cg_logo = "assets/cg.png"

##### Paths #####

cg_logo_path = pkg_resources.resource_filename('BALSAMIC', cg_logo)
cg_logo_path = pkg_resources.resource_filename("BALSAMIC", cg_logo)
48 changes: 21 additions & 27 deletions BALSAMIC/commands/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,48 +19,42 @@
from BALSAMIC import __version__

LOG = logging.getLogger(__name__)
LOG_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']
LOG_LEVELS = ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]


@click.group()
@click.option('--loglevel',
default='DEBUG',
type=click.Choice(LOG_LEVELS),
help="Set the level of log output.",
show_default=True)
@click.option(
"--loglevel",
default="DEBUG",
type=click.Choice(LOG_LEVELS),
help="Set the level of log output.",
show_default=True,
)
@click.version_option(version=__version__)
@click.pass_context
@doc("""BALSAMIC {version}: Bioinformatic Analysis pipeLine for
SomAtic MutatIons in Cancer""".format(version=__version__))
@doc(
"""BALSAMIC {version}: Bioinformatic Analysis pipeLine for
SomAtic MutatIons in Cancer""".format(
version=__version__
)
)
def cli(context, loglevel):
"BALSAMIC"
coloredlogs.DEFAULT_FIELD_STYLES = {
'asctime': {
'color': 'green'
},
'hostname': {
'color': 'magenta'
},
'levelname': {
'color': 'yellow',
'bold': True
},
'programname': {
'color': 'cyan'
},
'name': {
'color': 'blue'
}
"asctime": {"color": "green"},
"hostname": {"color": "magenta"},
"levelname": {"color": "yellow", "bold": True},
"programname": {"color": "cyan"},
"name": {"color": "blue"},
}
coloredlogs.install(
level=loglevel,
fmt=
'%(programname)s %(hostname)s %(asctime)s %(name)s pid:%(process)d [%(levelname)s] %(message)s'
fmt="%(programname)s %(hostname)s %(asctime)s %(name)s pid:%(process)d [%(levelname)s] %(message)s",
)
LOG.info("Running BALSAMIC version %s", __version__)

context.obj = {}
context.obj['loglevel'] = loglevel
context.obj["loglevel"] = loglevel
# LOG.info(f"BALSAMIC started with log level {loglevel}.")


Expand Down
1 change: 1 addition & 0 deletions BALSAMIC/commands/config/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from BALSAMIC.commands.config.case import case_config as case_command
from BALSAMIC.commands.config.pon import pon_config as pon_command


@click.group()
@click.pass_context
def config(context):
Expand Down
Loading