Git Product home page Git Product logo

scilifelab_epps's Introduction

scilifelab_epps

Collection of EPPs for the Scilifelab Stockholm node.

Table of contents

Overview

The repo is installed inside a designated conda environment on a server hosting Illumina Clarity LIMS.

After installation, the scripts in scripts/ are addded to the bin of the Conda environment, from which they can be called by LIMS.

Installation

Inside the repo, run pip install .

Development

Run pip install requirements-dev.txt to install packages used for development and pip install -e . to make the installation editable.

Automated linting

This repo is configured for automated linting. Linter parameters are defined in pyproject.toml.

As of now, we use:

  • ruff to perform automated formatting and a variety of lint checks.

    • Run with ruff check . and ruff format .
  • mypy for static type checking and to prevent contradictory type annotation.

    • Run with mypy **/*.py
  • pipreqs to check that the requirement files are up-to-date with the code.

    • This is run with a custom Bash script in GitHub Actions which will only compare the list of package names.

      # Extract and sort package names
      awk '{print $1}' $1 | sort -u > "$1".compare
      awk -F'==' '{print $1}' $2 | sort -u > "$2".compare
      
      # Compare package lists
      if cmp -s "$1".compare "$2".compare
      then
        echo "Requirements are the same"
        exit 0
      else
        echo "Requirements are different"
        exit 1
      fi
      
  • prettier to format common languages.

    • Run with prettier .
  • editorconfig-checker to enforce .editorconfig rules for all files not covered by the tools above.

    • Run with
      editorconfig-checker $(git ls-files | grep -v '.py\|.md\|.json\|.yml\|.yaml\|.html')
      

Configured in .github/workflows/lint-code.yml. Will test all commits in pushes or pull requests, but not change code or prevent merges.

Will prevent local commits that fail linting checks. Configured in .pre-commit-config.yml.

To set up pre-commit checking:

  1. Run pip install pre-commit
  2. Navigate to the repo root
  3. Run pre-commit install

This can be disabled with pre-commit uninstall

VS Code automation

To enable automated linting in VS Code, go the the user settings.json and include the following lines:

"[python]": {
    "editor.defaultFormatter": "charliermarsh.ruff",
}

This will run the ruff-mediated linting with the same parameters as the GitHub Actions and pre-commit every time VS Code is used to format the code in the repository.

To run formatting on save, include the lines:

"[python]": {
    "editor.formatOnSave": true,
}

Git blame suppression

When a non-invasive tool is used to tidy up a lot of code, it is useful to supress the Git blame for that particular commit, so the original author can still be traced.

To do this, add the hash of the commit containing the changes to .git-blame-ignore-revs, headed by an explanatory comment.

scilifelab_epps's People

Contributors

aanil avatar alneberg avatar chuan-wang avatar ewels avatar galithil avatar hammarn avatar jgruselius avatar kedhammar avatar parlundin avatar remiolsen avatar senthil10 avatar ssjunnebo avatar sylvinite avatar vezzi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.